- TypeScript 65%
- CSS 20.2%
- Pug 8.9%
- JavaScript 5.9%
Any page can now ask to be skipped from its own metadata — front matter
for .md/.pug/.html, a top-level key in a .yaml page, a `% @ignore: true`
header comment in a .tex sheet (beside @menu/@render, so it is visible to
the parser only and never printed or rendered). The file stays where it is;
the build does not render it, list it in the menu or the memo index, and
prints how many files it skipped. true/yes/1 all count.
An ignored .tex sheet is never rendered or compiled, so a site whose
sheets are all ignored builds without TeX installed.
Wanted for artur.gurgul.pro, which becomes a landing page while keeping
its memo sources in the repo.
Verified: tsc clean; artur.gurgul.pro with all 163 memos + memos.md marked
builds only index, the résumé and testing/* ("164 file(s) ignored"), no
TeX needed, and no memo index is written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|---|---|---|
| bin | ||
| empty | ||
| src | ||
| types | ||
| .gitignore | ||
| .npmignore | ||
| .nvim.lua | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Sajt
It is project that is runring your notes in Mardown format into website
Layout might be created in pug or html
Publishing throught SSH (ftp and dav is planned)
Initialize project in current directory with default theme
sajt init
sajt init "Project name"
start server
sajt build
--clean # remove local files that are not revelant to the project anymore
--publish or --serve -p 3000 --watch # Publish or serve with options -p PORT, --watch observe changes and rebuild the page if thare are any
--config config.yaml or -c config.yaml
--private # include private resources as well
sajt publish
--override # default is skip, if file exists, do not change it
--clean # remove remote files that not longer exists in the build folder
Project structure
.sajt/config.yaml # default config, you can override values pointing secundary file using --config flag
.sajt/media # copy all files as they are
.sajt/layouts # pug files that describes the layout the pages
Leaving a file out of the build
Any page can ask to be skipped with ignore: true in its own metadata. The file
stays where it is; sajt build does not build it, list it in the menu, or put
it in the memo index, and says how many files it skipped.
--- # .md, .pug, .html — the front matter
ignore: true
---
ignore: true # .yaml — a top-level key
% @ignore: true # .tex — a header comment, before the first TeX line
true, yes and 1 all count. An ignored .tex file is not compiled, so a
site whose sheets are all ignored needs no TeX installed to build.
LaTeX pages (.tex)
Every *.tex file in the site (outside .sajt/) becomes a page. sajt build
compiles it with xelatex, turns page 1 into an SVG with pdftocairo, and
puts name.html, name.svg, name.pdf and name.tex side by side in
.build/. The page shows the SVG at the width of the text column (a click
opens it alone at its real A4 size) with links to the PDF and to the LaTeX
source. The pages go into the menu like any other, grouped by folder.
It is made for one-page sheets on printup-sheet.sty, which the site keeps in
.sajt/tex/. Everything there is on TeX's search path (TEXINPUTS), as is the
sheet's own folder. What a page shows comes from the sheet itself:
% @labels: area=swift kind=concept topic=concurrency,actors → chips
% @tags: actors, reentrancy → chips
% @ignore: true → not built
\sheettitle{Actors \& reentrancy}{swift · memo} → the title
The % lines are read only in the header, before the first line of TeX. The
title is the first argument of \sheettitle, with TeX markup removed. A sheet
without \sheettitle gets no title, so it stays out of the menu (the build
warns).
Fonts. They are passed in before the sheet is read, as \printupbody and
\printupmono, which is how the printing tool does it — so the web page and
the printed sheet are the same. Set them in .sajt/config.yaml:
tex:
body: Atkinson Hyperlegible # the default
mono: 0xProto Nerd Font Mono # the default
Requirements. The build stops, before anything in .build/ is touched, if
any of these is missing, and says what to install:
| Need | Debian |
|---|---|
xelatex + the LaTeX packages the sheets use |
sudo apt-get install -y texlive-xetex texlive-latex-extra |
pdftocairo, pdfinfo |
sudo apt-get install -y poppler-utils |
fc-list |
sudo apt-get install -y fontconfig |
| Atkinson Hyperlegible | sudo apt-get install -y fonts-atkinson-hyperlegible |
| 0xProto Nerd Font Mono | 0xProto.zip from the nerd-fonts releases, unpacked into ~/.local/share/fonts/, then fc-cache -f |
A sheet that does not compile fails the build (exit 1) — the other pages are
still tried, so one run lists every broken sheet. The message names the sheet,
shows TeX's ! lines with the line they point at, and keeps the full log in
.sajt/cache/tex/failed/<name>.log.
Cache. Results live in .sajt/cache/tex/<hash>/. The hash covers the sheet,
every file in .sajt/tex/ and the two fonts, so an unchanged sheet is not
compiled again, and a change to the style recompiles them all. After a build in
which everything succeeded, entries no sheet used are removed. The cache can be
deleted at any time. Add it to the site's .gitignore:
.sajt/cache/
A file a sheet \inputs from its own folder is not part of the hash — delete
the cache after changing one.
Default theme and fonts
The default theme (empty/.sajt, copied by sajt init) uses two bundled
fonts, both under the SIL Open Font License 1.1:
- Rajdhani (Indian Type Foundry), for headings, navigation and text. It is converted to WOFF2 and subset to Latin.
- 0xProto (0xType), for code. These are upstream's WOFF2 files, unmodified.
Each family's OFL.txt sits beside its files in empty/.sajt/static/fonts/,
and FONTS.md there records the source, version and checksum of every file.
The OFL lets them be bundled and redistributed with this package. Keep the
licence files with the fonts, and don't sell the fonts on their own.
Support
If you think the project is or might be usefull and wish me to work on it: https://buymeacoffee.com/artur.gurgul
Development
Install local package
npm link sajt
This is my website which is generated by sajt: https://artur.gurgul.pro