Skip to content

Commit

Permalink
escape example vars in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
barelyhuman committed Apr 2, 2023
1 parent a741ee9 commit c4b3cdd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
20 changes: 11 additions & 9 deletions docs/pages/01-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@ repeated layout across your markdown files, this has now been replaced
by the `_layout.html` file which wraps around your markdown content and
can be defined as its shown below

```html
```go-html-template
<!DOCTYPE html>
<html lang="en">
<head>
<!-- head content -->
</head>
<head></head>
<body>
<!-- {{ .Content }} acts like an empty slot that gets filled with your markdown data -->
{{.Content}}
{ { .Content } }
</body>
</html>
```

`.Content` can be used as a slot or placeholder to be replaced by the content of each markdown file.

> **Note**: Make sure to remove the spaces between the `{` and `}` in the above code snippet, these were added to avoid getting replaced by the template code
## Hooks

The other reason for writing `alvu` was to be able to extend simple functionalities when
Expand All @@ -64,11 +65,12 @@ function, this function receives the data of the file that's currently being pro

So, if `alvu` is processing `index.md` then you will get the name, path, its current content, which you can return as is or change it and that'll override the content for the compiled version of the file.

For example, you can check this very documentation site's source code to check how the navigation is added
to each file.
For example, you can check this very documentation site's source code to check how the navigation is added
to each file.

## Public

Pretty self-explanatory but the `public` folder will copy everything
put into it to the `dist` folder. This can be used for assets, styles, etc.
put into it to the `dist` folder. This can be used for assets, styles, etc.

Let's move forward to [scripting &rarr;]({{.Meta.BaseURL}}02-scripting)
10 changes: 7 additions & 3 deletions docs/pages/02-scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ not all keys that you send back are taken into consideration.
If you did send the above data `name = "reaper"` and would like to access it in
all templates, you could just do the following

```html
<p>{{.Data.name}}</p>
```go-html-template
<p>
{ { .Data.name } }
</p>
<!-- or if you set it under extras -->
<p>{{.Extras.name}}</p>
<p>
{ { .Extras.name } }
</p>
```

The lua table could nest as much as needed and the same could be accessed in the
Expand Down

0 comments on commit c4b3cdd

Please sign in to comment.