commit 0c8765a5142295cd0163f9228ba987663111ff61 Author: Elf M. Sternberg Date: Sun Apr 24 17:22:51 2022 -0700 First check-in of "Elf's Notes" This is the initial checkin of my notes site. It's mostly a cheat-sheet format, with two different strands: 1. A reference sheet of commands in the order that matters to *me*, i.e. the things I use most, or forget most often, appear at the top of the documents. 2. A collection of recipes for getting common tasks completed. Basically, my cookbook of things that I care about diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..8b2b7d4 --- /dev/null +++ b/config.toml @@ -0,0 +1,16 @@ +# The URL the site will be built for +base_url = "https://elfsternberg.com/notes" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = true + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true + +[extra] +# Put all your custom variables here diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..e4cfdaf --- /dev/null +++ b/content/_index.md @@ -0,0 +1,19 @@ ++++ +title = "Elf's Notes" + +# The homepage contents +[extra] +lead = "This is Elf Sternberg's brain dump of notes about various software things he knows. If you find it useful, good! Just be aware that this site is probably a bit random, as it consists of explanations, snippets, and recipes for how I do things. It's meant to be a guide from a past version of myself to explain things to a future version that may have forgotten." + +# Menu items +[[extra.menu.main]] +name = "Blog" +section = "blog" +url = "https://elfsternberg.com" +weight = 20 + +[[extra.list]] +title = "Zola" +url="/docs/zola" +content = 'This site is hosted with Zola, a static site generator written in Rust.' ++++ diff --git a/content/docs/zola/_index.md b/content/docs/zola/_index.md new file mode 100644 index 0000000..3091169 --- /dev/null +++ b/content/docs/zola/_index.md @@ -0,0 +1,177 @@ ++++ +title = "Zola" +description = "Zola is a static site generator" +date = 2025-05-01T18:00:00+00:00 +updated = 2021-05-01T18:00:00+00:00 +template = "section.html" +sort_by = "weight" +weight = 4 +draft = false ++++ + +# Zola + +[Zola](https://getzola.org) is a static site generator written in +[Rust](../rust). It builds an entire web page out of a structured markdown +collection and a collection of HTML templates. The templating language is called +[Tera](https://tera.netlify.app). + +## Running Zola + +- `zola init` - Starts a new Zola project. Not for the faint of heart. +- `zola serve` - Starts a localhost webserver to serve your content for demo +- `zola build` - Builds a Zola project into a collection of static HTML. + +## Project layout + +The following files and folders define a basic Zola project + +- `config.toml`: A configuration file in the [TOML](https://toml.io/en/) + configuration language. Can contain a lot of information that will be made + available to *all* pages in the system. +- `content/`: The structured content folder. +- `sass/`: [Sass](../sass) is a CSS preprocessor language that makes CSS easier. +- `static/`: Static content such as images, fonts, and Javascript +- `templates`: The HTML templates (and includes, etc) that define the website's + layouts + +Note that if you want to use modern Javascript features such as a precompiler +like Typescript or a bundler like Webpack, that is outside the functionality of +Zola. You'll have to have a separate project for that, or a subfolder or git +submodule, and you'll have to have a separate build step for that. + +It's also a bit of a shame that Tera is 100% an HTML play, and there's no HAML +or similar HTML templating involved. That would be a nifty project. + +## Tera + +The Tera templating language looks a lot like Django's, or for that matter any +number of templating languages. Every page generated with Tera receives a +_context_, which can be thought of as a JSON object with which to populate the +page (it is, technically, a [Serde::Serializable](https://serde.rs/)). Zola +provides a large and complex context, which is explained further down. + +Tera has the following syntax. Everything within these markers is processed by +Tera; everything outside is left untouched. + +- `{{` and `}}` for expressions +- `{%` and `%}` for statements +- `{#` and `#}` for comments + +Statements that have a dash as part of their delimeter remove all whitespace +from around the delimiter. `{%-` says to eliminate all whitespace between this +statement and anything that came before it; `-%}` says to eliminate everything +that comes after it. + +### Statements + +#### `set` + +Variables are set in a given scope with `set`: + +```jinja2 +{% set my_var = "hello" %} +``` + +Sets a variable `my_var`. Variables can contain booleans, floats, strings, +integers, and arrays. There is a special syntax, `set_global`, that can be used +to set variables one level up in scope when working inside `for` loops (i.e. in +the outer scope containing the loop, preserving its content between iterations). + +#### `if` + +Conditional statements are managed with `if/is ... else ... endif` + +```jinja2 +{% if my_var is ... %} ... {% endif %} +``` + +The list of `is` tests that are shipped with Zola are: + +- `defined`: the given variable is defined. +- `undefined`: the given variable is undefined. +- `odd`: the given variable is an odd number. +- `even`: the given variable is an even number. +- `string`: the given variable is a string. +- `number`: the given variable is a number. +- `divisibleby`: the given expression is divisible by the arg given. +- `iterable`: Returns true if the given variable can be iterated over in Tera (i.e. is an array/tuple or an object). +- `object`: Returns true if the given variable is an object (i.e. can be iterated over key, value). +- `starting_with(string)`: Returns true if the given variable is a string and starts with the arg given. +- `ending_with(string)`: Returns true if the given variable is a string and ends with the arg given. +- `containing(val)`: Returns true if the given variable contains the arg given. + - strings: is the arg a substring? + - arrays: is the arg given one of the members of the array? + - maps: is the arg given a key of the map? +- `matching(regexp)`: Returns true if the given variable is a string and matches the regex in the argument. + +#### `for` + +Arrays are iterated with the `for x in array/map ... endfor` syntax. + +```jinja2 +{% for name in users %} +Hello: {{ name }} +{% endfor %} +``` + +Maps will provide a key/value pair. The names of the two fields are arbitrary: + +```jinja2 +{% for name, label in options %} + +{% endfor %} +``` + +Array filters (see below) are invoked before the loop. The following will print +the list in reverse order. + +```jinja2 +{% for name in users | reverse %}{{ name }}{% endfor %} +``` + +#### `include` + +Include other content into the current template being rendered. Include strings +cannot be built out of variables, but they _may_ be a list, in which case the +first filename found is rendered. If the include block has the phrase 'ignore +missing' at the end a missing file will not cause an error at build time. + +```jinja2 +{% include "header.html" %} +``` + +#### Macros + +Macros are blocks of template that can be passed variables; they're basically +just big chunks of content that can be parameterized. Macros must be defined in +a file separate from the main content and imported with a distinct syntax from +`import`: + +```jinja2 +{% import "header.html" as header %} +``` + +The header macro can be invoked in that file like this: + +```jinja2 +{{ header::header("My Blog!") }} +``` + +And an example of this macro (again, in the `header.html` file) would look like this: + +```jinja2 +{% macro header(title) %} +
+

{ title }

+
+{% endmacro %} + ``` + + +```jinja2 +{% raw %}Content {{ goes here }}{% endraw %} +``` + +Content within the `raw` block will not be processed. + diff --git a/hold/index.md b/hold/index.md new file mode 100644 index 0000000..83fa157 --- /dev/null +++ b/hold/index.md @@ -0,0 +1,25 @@ + +[[extra.list]] +title = "React ⚛" +url="/docs/react" +content = 'React is a library for writing responsive web pages. Professionally, I write React, and I write a lot of it.' + +[[extra.list]] +title = "Typescript" +url="/docs/typescript" +content = "Typescript is a superset of Javascript that provides a language of types and type flow. It's my preferred front-end language." + +[[extra.list]] +title = "CSS" +url="/docs/css" +content = "CSS is the language of styles for web development." + +[[extra.list]] +title = "Sass" +url="/docs/sass" +content = "Sass is a high-level language that compiles down to CSS." + +[[extra.list]] +title = "Rust" +url="/docs/rust" +content = "Rust is a system programming language that provides the speed of C/C++, but imposes a strict discipline on memory management that creates much safer and more reliable code." diff --git a/static/fonts/nunito/Nunito-Black.ttf b/static/fonts/nunito/Nunito-Black.ttf new file mode 100644 index 0000000..498e70e Binary files /dev/null and b/static/fonts/nunito/Nunito-Black.ttf differ diff --git a/static/fonts/nunito/Nunito-Black.woff b/static/fonts/nunito/Nunito-Black.woff new file mode 100644 index 0000000..d8c0cbd Binary files /dev/null and b/static/fonts/nunito/Nunito-Black.woff differ diff --git a/static/fonts/nunito/Nunito-Black.woff2 b/static/fonts/nunito/Nunito-Black.woff2 new file mode 100644 index 0000000..091533a Binary files /dev/null and b/static/fonts/nunito/Nunito-Black.woff2 differ diff --git a/static/fonts/nunito/Nunito-BlackItalic.ttf b/static/fonts/nunito/Nunito-BlackItalic.ttf new file mode 100644 index 0000000..7e57a5c Binary files /dev/null and b/static/fonts/nunito/Nunito-BlackItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-BlackItalic.woff b/static/fonts/nunito/Nunito-BlackItalic.woff new file mode 100644 index 0000000..f662a91 Binary files /dev/null and b/static/fonts/nunito/Nunito-BlackItalic.woff differ diff --git a/static/fonts/nunito/Nunito-BlackItalic.woff2 b/static/fonts/nunito/Nunito-BlackItalic.woff2 new file mode 100644 index 0000000..c144028 Binary files /dev/null and b/static/fonts/nunito/Nunito-BlackItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-Bold.ttf b/static/fonts/nunito/Nunito-Bold.ttf new file mode 100644 index 0000000..992ad7b Binary files /dev/null and b/static/fonts/nunito/Nunito-Bold.ttf differ diff --git a/static/fonts/nunito/Nunito-Bold.woff b/static/fonts/nunito/Nunito-Bold.woff new file mode 100644 index 0000000..f23fc9e Binary files /dev/null and b/static/fonts/nunito/Nunito-Bold.woff differ diff --git a/static/fonts/nunito/Nunito-Bold.woff2 b/static/fonts/nunito/Nunito-Bold.woff2 new file mode 100644 index 0000000..a159e65 Binary files /dev/null and b/static/fonts/nunito/Nunito-Bold.woff2 differ diff --git a/static/fonts/nunito/Nunito-BoldItalic.ttf b/static/fonts/nunito/Nunito-BoldItalic.ttf new file mode 100644 index 0000000..6fabbd1 Binary files /dev/null and b/static/fonts/nunito/Nunito-BoldItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-BoldItalic.woff b/static/fonts/nunito/Nunito-BoldItalic.woff new file mode 100644 index 0000000..6a8e56d Binary files /dev/null and b/static/fonts/nunito/Nunito-BoldItalic.woff differ diff --git a/static/fonts/nunito/Nunito-BoldItalic.woff2 b/static/fonts/nunito/Nunito-BoldItalic.woff2 new file mode 100644 index 0000000..a5e5117 Binary files /dev/null and b/static/fonts/nunito/Nunito-BoldItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-ExtraBold.ttf b/static/fonts/nunito/Nunito-ExtraBold.ttf new file mode 100644 index 0000000..a167e2e Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraBold.ttf differ diff --git a/static/fonts/nunito/Nunito-ExtraBold.woff b/static/fonts/nunito/Nunito-ExtraBold.woff new file mode 100644 index 0000000..dbd367e Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraBold.woff differ diff --git a/static/fonts/nunito/Nunito-ExtraBold.woff2 b/static/fonts/nunito/Nunito-ExtraBold.woff2 new file mode 100644 index 0000000..3a5b3b1 Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraBold.woff2 differ diff --git a/static/fonts/nunito/Nunito-ExtraBoldItalic.ttf b/static/fonts/nunito/Nunito-ExtraBoldItalic.ttf new file mode 100644 index 0000000..629849b Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraBoldItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-ExtraBoldItalic.woff b/static/fonts/nunito/Nunito-ExtraBoldItalic.woff new file mode 100644 index 0000000..6d8927a Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraBoldItalic.woff differ diff --git a/static/fonts/nunito/Nunito-ExtraBoldItalic.woff2 b/static/fonts/nunito/Nunito-ExtraBoldItalic.woff2 new file mode 100644 index 0000000..e8fb4ae Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraBoldItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-ExtraLight.ttf b/static/fonts/nunito/Nunito-ExtraLight.ttf new file mode 100644 index 0000000..dd0174c Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraLight.ttf differ diff --git a/static/fonts/nunito/Nunito-ExtraLight.woff b/static/fonts/nunito/Nunito-ExtraLight.woff new file mode 100644 index 0000000..b4f1897 Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraLight.woff differ diff --git a/static/fonts/nunito/Nunito-ExtraLight.woff2 b/static/fonts/nunito/Nunito-ExtraLight.woff2 new file mode 100644 index 0000000..380dbeb Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraLight.woff2 differ diff --git a/static/fonts/nunito/Nunito-ExtraLightItalic.ttf b/static/fonts/nunito/Nunito-ExtraLightItalic.ttf new file mode 100644 index 0000000..c4219a8 Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraLightItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-ExtraLightItalic.woff b/static/fonts/nunito/Nunito-ExtraLightItalic.woff new file mode 100644 index 0000000..648e31f Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraLightItalic.woff differ diff --git a/static/fonts/nunito/Nunito-ExtraLightItalic.woff2 b/static/fonts/nunito/Nunito-ExtraLightItalic.woff2 new file mode 100644 index 0000000..137af6c Binary files /dev/null and b/static/fonts/nunito/Nunito-ExtraLightItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-Italic-VariableFont_wght.ttf b/static/fonts/nunito/Nunito-Italic-VariableFont_wght.ttf new file mode 100644 index 0000000..7e3fb11 Binary files /dev/null and b/static/fonts/nunito/Nunito-Italic-VariableFont_wght.ttf differ diff --git a/static/fonts/nunito/Nunito-Italic-VariableFont_wght.woff b/static/fonts/nunito/Nunito-Italic-VariableFont_wght.woff new file mode 100644 index 0000000..de2c31d Binary files /dev/null and b/static/fonts/nunito/Nunito-Italic-VariableFont_wght.woff differ diff --git a/static/fonts/nunito/Nunito-Italic-VariableFont_wght.woff2 b/static/fonts/nunito/Nunito-Italic-VariableFont_wght.woff2 new file mode 100644 index 0000000..00636c9 Binary files /dev/null and b/static/fonts/nunito/Nunito-Italic-VariableFont_wght.woff2 differ diff --git a/static/fonts/nunito/Nunito-Italic.ttf b/static/fonts/nunito/Nunito-Italic.ttf new file mode 100644 index 0000000..3629748 Binary files /dev/null and b/static/fonts/nunito/Nunito-Italic.ttf differ diff --git a/static/fonts/nunito/Nunito-Italic.woff b/static/fonts/nunito/Nunito-Italic.woff new file mode 100644 index 0000000..8073fcc Binary files /dev/null and b/static/fonts/nunito/Nunito-Italic.woff differ diff --git a/static/fonts/nunito/Nunito-Italic.woff2 b/static/fonts/nunito/Nunito-Italic.woff2 new file mode 100644 index 0000000..a836d35 Binary files /dev/null and b/static/fonts/nunito/Nunito-Italic.woff2 differ diff --git a/static/fonts/nunito/Nunito-Light.ttf b/static/fonts/nunito/Nunito-Light.ttf new file mode 100644 index 0000000..faebd68 Binary files /dev/null and b/static/fonts/nunito/Nunito-Light.ttf differ diff --git a/static/fonts/nunito/Nunito-Light.woff b/static/fonts/nunito/Nunito-Light.woff new file mode 100644 index 0000000..96626b6 Binary files /dev/null and b/static/fonts/nunito/Nunito-Light.woff differ diff --git a/static/fonts/nunito/Nunito-Light.woff2 b/static/fonts/nunito/Nunito-Light.woff2 new file mode 100644 index 0000000..dbe2324 Binary files /dev/null and b/static/fonts/nunito/Nunito-Light.woff2 differ diff --git a/static/fonts/nunito/Nunito-LightItalic.ttf b/static/fonts/nunito/Nunito-LightItalic.ttf new file mode 100644 index 0000000..0c3218d Binary files /dev/null and b/static/fonts/nunito/Nunito-LightItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-LightItalic.woff b/static/fonts/nunito/Nunito-LightItalic.woff new file mode 100644 index 0000000..c5c41e5 Binary files /dev/null and b/static/fonts/nunito/Nunito-LightItalic.woff differ diff --git a/static/fonts/nunito/Nunito-LightItalic.woff2 b/static/fonts/nunito/Nunito-LightItalic.woff2 new file mode 100644 index 0000000..5fcb263 Binary files /dev/null and b/static/fonts/nunito/Nunito-LightItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-Medium.ttf b/static/fonts/nunito/Nunito-Medium.ttf new file mode 100644 index 0000000..a9a0083 Binary files /dev/null and b/static/fonts/nunito/Nunito-Medium.ttf differ diff --git a/static/fonts/nunito/Nunito-Medium.woff b/static/fonts/nunito/Nunito-Medium.woff new file mode 100644 index 0000000..7cd832d Binary files /dev/null and b/static/fonts/nunito/Nunito-Medium.woff differ diff --git a/static/fonts/nunito/Nunito-Medium.woff2 b/static/fonts/nunito/Nunito-Medium.woff2 new file mode 100644 index 0000000..a4b60d9 Binary files /dev/null and b/static/fonts/nunito/Nunito-Medium.woff2 differ diff --git a/static/fonts/nunito/Nunito-MediumItalic.ttf b/static/fonts/nunito/Nunito-MediumItalic.ttf new file mode 100644 index 0000000..e17671c Binary files /dev/null and b/static/fonts/nunito/Nunito-MediumItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-MediumItalic.woff b/static/fonts/nunito/Nunito-MediumItalic.woff new file mode 100644 index 0000000..83d9fa6 Binary files /dev/null and b/static/fonts/nunito/Nunito-MediumItalic.woff differ diff --git a/static/fonts/nunito/Nunito-MediumItalic.woff2 b/static/fonts/nunito/Nunito-MediumItalic.woff2 new file mode 100644 index 0000000..1bb4e88 Binary files /dev/null and b/static/fonts/nunito/Nunito-MediumItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-Regular.ttf b/static/fonts/nunito/Nunito-Regular.ttf new file mode 100644 index 0000000..ab7452c Binary files /dev/null and b/static/fonts/nunito/Nunito-Regular.ttf differ diff --git a/static/fonts/nunito/Nunito-Regular.woff b/static/fonts/nunito/Nunito-Regular.woff new file mode 100644 index 0000000..fc6ca33 Binary files /dev/null and b/static/fonts/nunito/Nunito-Regular.woff differ diff --git a/static/fonts/nunito/Nunito-Regular.woff2 b/static/fonts/nunito/Nunito-Regular.woff2 new file mode 100644 index 0000000..99c3247 Binary files /dev/null and b/static/fonts/nunito/Nunito-Regular.woff2 differ diff --git a/static/fonts/nunito/Nunito-SemiBold.ttf b/static/fonts/nunito/Nunito-SemiBold.ttf new file mode 100644 index 0000000..dbcbf0b Binary files /dev/null and b/static/fonts/nunito/Nunito-SemiBold.ttf differ diff --git a/static/fonts/nunito/Nunito-SemiBold.woff b/static/fonts/nunito/Nunito-SemiBold.woff new file mode 100644 index 0000000..c2f5dcb Binary files /dev/null and b/static/fonts/nunito/Nunito-SemiBold.woff differ diff --git a/static/fonts/nunito/Nunito-SemiBold.woff2 b/static/fonts/nunito/Nunito-SemiBold.woff2 new file mode 100644 index 0000000..1891e3f Binary files /dev/null and b/static/fonts/nunito/Nunito-SemiBold.woff2 differ diff --git a/static/fonts/nunito/Nunito-SemiBoldItalic.ttf b/static/fonts/nunito/Nunito-SemiBoldItalic.ttf new file mode 100644 index 0000000..5263c64 Binary files /dev/null and b/static/fonts/nunito/Nunito-SemiBoldItalic.ttf differ diff --git a/static/fonts/nunito/Nunito-SemiBoldItalic.woff b/static/fonts/nunito/Nunito-SemiBoldItalic.woff new file mode 100644 index 0000000..00b2598 Binary files /dev/null and b/static/fonts/nunito/Nunito-SemiBoldItalic.woff differ diff --git a/static/fonts/nunito/Nunito-SemiBoldItalic.woff2 b/static/fonts/nunito/Nunito-SemiBoldItalic.woff2 new file mode 100644 index 0000000..afd5692 Binary files /dev/null and b/static/fonts/nunito/Nunito-SemiBoldItalic.woff2 differ diff --git a/static/fonts/nunito/Nunito-VariableFont_wght.ttf b/static/fonts/nunito/Nunito-VariableFont_wght.ttf new file mode 100644 index 0000000..fb9c130 Binary files /dev/null and b/static/fonts/nunito/Nunito-VariableFont_wght.ttf differ diff --git a/static/fonts/nunito/Nunito-VariableFont_wght.woff b/static/fonts/nunito/Nunito-VariableFont_wght.woff new file mode 100644 index 0000000..6e9e773 Binary files /dev/null and b/static/fonts/nunito/Nunito-VariableFont_wght.woff differ diff --git a/static/fonts/nunito/Nunito-VariableFont_wght.woff2 b/static/fonts/nunito/Nunito-VariableFont_wght.woff2 new file mode 100644 index 0000000..28a600f Binary files /dev/null and b/static/fonts/nunito/Nunito-VariableFont_wght.woff2 differ diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..e975818 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,26 @@ +{%- import 'macros/font_preloads.html' as font_preloads -%} +{%- import 'macros/stylesheets.html' as stylesheets -%} +{%- import 'macros/header.html' as header -%} +{%- import 'macros/footer.html' as footer -%} + + + + + + +{{ font_preloads::preloads() }} +{{ stylesheets::stylesheets() }} + +{% block body %}{% set page_class="home" %}{% endblock body %} + + {% block header %} + {{ header::header(current_section="/") }} + {% endblock header %} + + {% block content %}{% endblock content %} + + {% block footer %} + {{ footer::footer() }} + {% endblock footer %} + + diff --git a/templates/docs/section.html b/templates/docs/section.html new file mode 100644 index 0000000..dc6d1c8 --- /dev/null +++ b/templates/docs/section.html @@ -0,0 +1,48 @@ +{% extends "section.html" %} + +{% block body %} +{% set page_class = "docs list" %} +{% endblock body %} + +{% block header %} +{% set current_section = "docs" %} +{{ macros_header::header(current_section=current_section)}} +{% endblock header %} + +{% block content %} +
+
+
+
+
+

{{ section.title }}

+
{{ section.content | safe }}
+
+ {% set index_path = current_path ~ "_index.md" | trim_start_matches(pat="/") %} + {% set index = get_section(path=index_path) %} + {% for page in index.pages %} + + {% endfor %} + {% for s in index.subsections %} + {% set subsection = get_section(path=s) %} + {% if subsection.pages %} + {% for page in subsection.pages %} + + {% endfor %} + {% endif %} + {% endfor %} +
+
+
+
+
+
+{% endblock content %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..a0c29c4 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+
+
+

{{ section.title | default(value="Elf's Notes") }}

+
+
+

+ {{ section.extra.lead | default(value="Please start setting config.toml and adding + your content.") | safe }} +

+
+
+
+
+
+ +
+
+
+ {% if section.extra.list %} {% for val in section.extra.list %} +
+

{{ val.title }}

+

{{ val.content | safe }}

+
+ {% endfor %} {% endif %} +
+
+
+{% endblock %} diff --git a/templates/macros/font_preloads.html b/templates/macros/font_preloads.html new file mode 100644 index 0000000..89dc987 --- /dev/null +++ b/templates/macros/font_preloads.html @@ -0,0 +1,12 @@ +{% macro preloads() %} + {% if config.extra.preloads %} + {% for preload in config.extra.preloads %} + + {% endfor %} + {% endif %} +{% endmacro %} diff --git a/templates/macros/footer.html b/templates/macros/footer.html new file mode 100644 index 0000000..8ea9211 --- /dev/null +++ b/templates/macros/footer.html @@ -0,0 +1,24 @@ +{% macro footer() %} + +{% endmacro %} diff --git a/templates/macros/header.html b/templates/macros/header.html new file mode 100644 index 0000000..6575ac1 --- /dev/null +++ b/templates/macros/header.html @@ -0,0 +1,10 @@ +{% macro header(current_section) %} + +{% endmacro %} diff --git a/templates/macros/stylesheets.html b/templates/macros/stylesheets.html new file mode 100644 index 0000000..b409a8a --- /dev/null +++ b/templates/macros/stylesheets.html @@ -0,0 +1,3 @@ +{% macro stylesheets() %} + +{% endmacro %} diff --git a/templates/section.html b/templates/section.html new file mode 100644 index 0000000..a7dc9c3 --- /dev/null +++ b/templates/section.html @@ -0,0 +1,50 @@ +{# Default section.html template #} + +{% extends "base.html" %} + +{% block seo %} +{{ super() }} +{% set title_addition = "" %} + +{% if section.title and config.title %} +{% set title = section.title %} +{% set title_addition = title_separator ~ config.title %} +{% elif section.title %} +{% set title = section.title %} +{% else %} +{% set title = config.title %} +{% endif %} + +{% if section.description %} +{% set description = section.description %} +{% else %} +{% set description = config.description %} +{% endif %} + +{{ macros_head::seo(title=title, title_addition=title_addition, description=description) }} +{% endblock seo %} + +{% block body %} +{% if section.extra.class %} +{% set page_class = section.extra.class %} +{% else %} +{% set page_class = "page list" %} +{% endif %} +{% endblock body %} + +{% block content %} +
+
+
+
+
+ + {{ section.content | safe }} +
+
+
+
+
+{% endblock content %}