Skip to content

ntaulbut/simplesitesystem

Repository files navigation

Simple Site System

Code style: black

Create a website just like you would in plain HTML, but using Jinja templates. For example:

blog/
├─ base.html.jinja
├─ ramen-recipe.html.jinja
img/
├─ catpicture.jpg
index.html.jinja

Usage

To build the website: simple build [Source Dir] [Output Dir].

To start a dev server: simple dev [Source Dir] [Output Dir].

Link all templates in a folder

Use autolink("[Directory Name]") to get a tuple with the url, the title (<title>), and the description (<meta name="description">), of each page in the directory.

<ul>
{% for url, title, description in autolink("blog") %}
    <li>
        <a href="{{ url }}">{{ title }}</a>: {{ description }}
    </li>
{% endfor %}
</ul>

Localisation

simple build -s strings.toml src dist

[en]
ramen_recipe_title = "My Ramen Recipe"

[jp]
ramen_recipe_title = "私のラーメンレシピ"
<head>
    <title>{{ locale }}: {{ strings.ramen_recipe_title }}</title>
</head>

Code highlighting

<head>
    <style>
    {{ code_style("one-dark") }}
    </style>
</head>
<p>
{% code "python" %}
def main():
    print("Hello, world")
{% endcode %}
</p>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks