No description
Find a file
2024-11-26 20:45:38 +01:00
src Initial commit 2024-11-17 23:06:42 +01:00
static Moved style.css to static directory 2024-11-26 20:45:38 +01:00
.gitignore Initial commit 2024-11-17 23:06:42 +01:00
build.sh Moved style.css to static directory 2024-11-26 20:45:38 +01:00
README.md Added README.md 2024-11-26 20:41:25 +01:00
template.awk Rewrote templating engine 2024-11-19 22:51:41 +01:00
template.tpl Added build signature to template 2024-11-22 12:47:22 +01:00

Jocelyns HSMW website

This repository contains the generator, static files and source files for my HSMW website

Build

To build this website you need:

  • GNU Bash (5.2.32)
  • GNU awk (1.3.4)
  • sed (4.9)
  • Pandoc (3.1.11.1)

Any half-recent version should suffice, I added a tested version in parentheses. To run the build, execute the build.sh script from the root directory. This will:

  • Delete the dist folder if it exists
  • Create a dist folder
  • Copy over all static files
  • Compile the website from src into dist

Templates

Templates use a custom template language heavily inspired by the one used by werc. It works by embedding bash code directly into the html skeleton used to build the pages. There are two ways of doing so:

Escaped lines

If a line starts with an arbitrary amount of whitespace (even 0) followed by a percent sign, the rest of the line will be treated as a shell command, and the commands output will be inserted in its place. For example:

<h1>
% echo 'Hallo Mittweida!'
</h1>

will be evaluated to

<h1>
Hallo Mittweida!
</h1>

NOTE: Keep control over your templates, as they could expose information about your system!

Inline expressions

Inline expressions can be written by encasing the expression in %( and %). Those expressions will be evaluated as if put in double quotes, and the result will be inserted in their place. Example:

<a href="%($LINK%)">link</a>

will put the contents of the shell variable LINK in the href-attribute field of the link object.