siter

Crates.iositer
lib.rssiter
version0.1.1
sourcesrc
created_at2020-09-08 14:32:35.832941
updated_at2021-12-03 09:24:37.194859
descriptionA static site generator where even content and config are templates
homepage
repositoryhttps://github.com/storyfeet/siter
max_upload_size
id286153
size48,118
(storyfeet)

documentation

README

Siter

A static website generator, where every content item is a template and so are the templates.

The advantage of making content pages also templates is that you can sneak javascript into them for little bits and pieces, or loops without having to reorganise everything to fit them.

The setup for a basic website looks something like this.

  • root_config.ito
  • content
    • index.md
    • anotherpage.md
    • apples.md
  • templates
    • page.html
  • static
    • any static files

root_config.ito

{{export
output="public"
}}
{{@export menu}}
<a href="/">HOME</a>
<a href="/apples">apples</a>
{{/export}}

index.md

{{export
title="My Website"
}}{{@md}}
Markdown
=======

By limiting markdown to specifig blocks we can include other kinds of content outside

{{/md}}
<script>
    function not_markdown(){
        return "This function will not be gobbled up by markdown"
    }
</script>
{{@md}}
Realisitically most content pages won't need javascript, but it's nice to know you CAN.
{{/md}}

templates/page.html

{{export as_index=true}}
<doctype! HTML>
<html>
<head>
    <title>{{first .title "My Default Title"}}</title>
    {{#If the page has any head data include that here#}}
    {{first .head}}
</head>
<body>
    <div id="menu">{{.menu}}</div>
    <div id="content">
        {{$1}}{{# $1 is the page content #}}
    </div>
</body>
</html>

Commit count: 50

cargo fmt