You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My tool for building websites. See philosophy for details.
Plans
do not rewrite mathematics/mathematics.cards.json to index.html
file.cards.json should generate file-cards.html
Autogenerate index.html?
"Daily/", etc. categories?
Blog RSS feed and fix tags/categories in dev server
later: Linter to always ensure trailing slash for local URLs
later: for each page autogenerate: references, backreferences, other meatdata,
tags, etc.
Some interactive apps should have a "freeze" button. to save output, like from
a command line. SSR or render caches this, and anything with side-effects
cannot be ran unless unfrozen
Sauerkraut is a static site generator. Conventionally, it recursively reads
input files from content/. Then, it processes each file path and content.
Finally, it writes the result path and content to build/.
Content Files
Content files are any files located in the content directory that aren't
special files.
Transformations are done by default to file paths in two cases:
If a file ends with .md (or similar) files, it is converted into a .html
file.
/mathematics.md -> /mathematics.html
/index.md -> /index.html
If a file name (excluding file extensions) is the same as the directory name
of it's parent directory, then that file is renamed to index.html.
/about/about.md -> /about/index.html
This makes it easier to edit files in IDEs (unlike Next.js's page.js).
Supported Formats
The following formats are supported:
JSX
These files are processed with esbuild.
Typically, they use Nano JSX.
HTML
These files are automatically given the proper HTML boilerplate.
Markdown
These files are processed with the markdown parser
markdown-it.
This file potentially customizes the behavior of the whole website. To be
recognized, its name must match /sk.config.js.
It can export:
title
rootDir
contentDir
staticDir
outputDir
transformUri()
validateFrontmatter()
createHtml()
Page JavaScript Customization
This file potentially customizes the behavior of a single page. To be
recognized, its name must match /**/<adjacentPage>.sk.js.
It can export:
Meta()
Head()
GenerateSlugMapping()
GenerateTemplateVariables()
Directory Structure
build/
Where output files are written to.
content/
These files are processed and written to the build directory.
static/
These files are copied directly to the build directory without processing.
Older Ideas
Entrypoints. Entrypoints were created to make it easier to approximate
tracking dependencies of a page. For example, if /math/theme.cls changed, then
probably /math/slides.tex should be regenerated as well. This breaks down too
often, as it's not uncommon for files under a particular directory to be
unrelated. An alternative to entrypoints was tracking dependencies of a page by
parsing the page with either regular expressions or a laguage parser library.
This wasn't chosen since it would mean adding regular expressions or traverse
functions for each markup language. And, detection would not be posssible with
more dynamic markup languages.