Personal website of Tsvetan R. Yordanov (Tseko), served by GitHub Pages at https://tsryo.github.io/.
Static files, in English, Bulgarian, Spanish and Dutch:
src/index.html: the page template. Text is{{key}}placeholders.src/i18n/<lang>.json: the strings for each language (en,bg,es,nl).tools/build.py: buildsindex.htmland<lang>/index.htmlfor the other languages from the two above ({{> name}}includessrc/partials/name.html). Standard library only.css/style.css: all styles. Colours are tokens at the top.js/main.js,js/ambience.js: optional extras (active nav link, Konami code, click-to-load SoundCloud, generative ambience). The page works without them.404.html: served by GitHub Pages for unknown URLs, so it uses root-absolute paths.electron-to-pixel/: an interactive explainer, linked from the story.assets/: self-hosted fonts (SIL OFL), images (including the skyline painting), the map (Natural Earth, public domain) andpdf/resume.pdf.
Change the template or the JSON files, never the generated index.html files, then rebuild:
python tools/build.pyThe build stops if a language is missing a key or has one the template doesn't use.
- Copy
src/i18n/en.jsontosrc/i18n/<code>.json. - Translate the values and set
_name,_code,_locale,_path("<code>/") and_flag(the flag painted on its banner in the language switcher). - Run the build. The language switcher and
hreflanglinks update themselves. - Optionally, give it a home: a sky tint and its lit windows under
html[lang="<code>"]incss/style.css, and a music flavour inFLAVOURSinjs/ambience.js(otherwise the English one plays).
Long compound words, as in Dutch, may need ­ where space is tight, such as the skill tree. Check the top bar on a 320 px phone too: every banner takes room from the section links.
Fonts cover Latin and Cyrillic. A language in another script needs a font for it in css/style.css.
The painting at the foot of the hero (a Bulgarian village at dusk, with Scotland, Valencia and the Netherlands on the horizon) is drawn by code:
python tools/render_skyline.py
python tools/build.pytools/draw_skyline.py writes the artwork as SVG (seeded, so it always draws the same scene) and src/partials/skyline.html, the live layers over it: the sun, window glow, the windmill's sails, smoke and the saltire. tools/render_skyline.py runs it, renders the SVG with headless Edge or Chrome, and saves assets/img/skyline-{1280,1920,2880}.webp with Pillow. Only this step needs a browser and Pillow.
GitHub Pages can't send custom headers, so each page carries its Content Security Policy in a <meta> tag: scripts only from this site, no inline scripts or eval, Trusted Types required, and frames only from SoundCloud, whose player loads on request in a sandboxed iframe. To keep it working:
- Put scripts in
.jsfiles, never inline or inon…attributes. - Strings in
src/i18n/*.jsongo into the page as HTML, so only put trusted text there.
frame-ancestors only works as a header, so other sites can still frame the pages.
- Sections below the hero skip rendering until the first paint (
content-visibility).main.jslays them out afterwards, or at once when an in-page link is followed, so links land exactly. - Prefer
transformandopacityfor animation: other properties repaint or re-lay out the page every frame. - What's out of view rests: SVG animations pause, and sections get
.is-resting. - No
backdrop-filteror fixed full-screen layers: both are slow on older machines. - Visitors who turn on Save-Data or reduced motion get a still page.
python -m http.server 8000Then open http://localhost:8000/. Pushing to main publishes the site.