Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
hex e32c33de4f updated readme 3 роки тому
license.md license and cleanup 3 роки тому
readme.md updated readme 3 роки тому
stagen.py markdown post support 3 роки тому

readme.md

This is an incredibly simple static site generator

HOW TO USE: Your project should look like this.

stagen.py
templates/{templates}.html
templates/post.html
templates/posts.html
content/{html files here}.html
output/
posts/{posts}.md

An easy way to install this is checkout the repo and symlink stagen.py to your project root directory

When you run stagen.py it just takes jinja2 and processes every .html file in content as a template mirrored to the output directory. You can access templates in the templates folder but these are not automatically processed. Refer to the Jinja2 docs for more info.

For posts, the post.html file is used when processing a post in markdown format, and posts.html is used for displaying the list of posts.

More documentation on that in the future but for now just make sure those files exist or it’ll get mad at you

EXAMPLE

templates/page.html

<h1>A header</h1>
{% block content %}{% endblock %}

content/index.html

{% extends "templates/page.html" %}
{% block content %}
<p>Some Content</p>
{% endblock %}

this will output a file in the output folder titled index.html with the contents

<h1>A header</h1>
<p>Some Content</p>

html files in the output directory are rewritten each run but everything else is safe.