No description
Find a file
2025-10-18 20:20:39 +02:00
preproc Custom HTML preprocessor; New banner; Team page 2025-10-18 20:20:39 +02:00
src Custom HTML preprocessor; New banner; Team page 2025-10-18 20:20:39 +02:00
.gitignore Crude build script 2025-08-18 16:05:21 +02:00
build.sh Custom HTML preprocessor; New banner; Team page 2025-10-18 20:20:39 +02:00
deploy-to-server.sh Added --delete flag to rsync call 2025-10-09 16:12:53 +02:00
Readme.md Custom HTML preprocessor; New banner; Team page 2025-10-18 20:20:39 +02:00

KarlOS Landing Page

This is the source code for the public KarlOS landing page. It is a static HTML website. To reduce duplication, the source code is preprocessed by a set of POSIX shell + awk scripts which allow you to set and insert variables, and to execute arbitrary shell commands (spicy!). To build the website, simply run build.sh. If you have SSH access to the server machine, you can run deploy-to-server.sh to push your local state to the production web page.

The Preprocessor Syntax

Lines starting with two percent signs are considered comments and ignored:

%% This line won't show up in the resulting HTML

Lines starting with a percent sign and a tilde can execute shell commands:

%~ date # Inserts the current date at the time the build script is run

In addition to regular shell commands, the following additional commands are also provided:

  • include <filename>: Inserts the contents of the given file, recursively preprocessing it too.
  • include_raw <filename>: Inserts the contents of the given file without any processing.
  • include_md <filename>: Treats the given file as a markdown file, converting it to HTML and inserting it.
  • die <reason>: Throw an error and stop building the website. All commands are executed in the root directory of this repository.

Lines of the form %VARIABLE:VALUE can be used to store a string in a variable:

%PAGE_TITLE:Hello, World!

Within any line that isn't one of the above directives, patterns of the form %[VARIABLE] are replaced by the string that is stored in the variable:

<title>%[PAGE_TITLE]</title>