kataras / kataras/blocks

template function for css and js?

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
77
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Hi @kataras thank you very much for creating the iris framework and blocks. I am new to go but i miss something to get started. I have basic `view` folder with an `index.html` like this:

```html

Index Body


Message: {{.Message}}

h1 {
color: red;
}

h3 {
color: green;
}

alert('Hello World');

```
inside my `layouts/main.html` file i define the templates `css` and `js` like this:
```html



{{.Title}}
{{ template "css" . }}
{{ template "js" . }}

{{ template "content" . }}
{{ partial "partials/footer" . }}

```
You can probably already guess what I would like to achieve. The `styles` and the `js` code from the `index.html` should be inserted into the `main.html` automatically, just like it happens with the `content` template function.

Is that possible? How can i achieve this? Could blocks support this as well?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.