commit 594b93557017f36aed35e90612509187a23019d7 Author: Fabian Hauser Date: Sat Sep 14 18:18:15 2024 +0300 Initial version diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ebdbf95 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +*.webp filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.mpv filter=lfs diff=lfs merge=lfs -text +*.ogv filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2493d51 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + pull_request: + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + lfs: true + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Run `nix build` + run: nix build . + - uses: actions/upload-pages-artifact@v3 + with: + path: result/ + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + with: + preview: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81ef486 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/result* +/src/public/ +/src/static/processed_images/ +/src/themes/tabi diff --git a/cache.nix b/cache.nix new file mode 100644 index 0000000..5327f8c --- /dev/null +++ b/cache.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: +pkgs.writeShellApplication { + name = "cache"; + meta.description = "Access the website's attic cache."; + runtimeInputs = [ + pkgs.attic-client + pkgs.findutils + pkgs.gnugrep + ]; + text = '' + SERVER="https://attic.qo.is/" + CACHE_NAME="qois" + CACHE_REPO="$CACHE_NAME:qois-infrastructure" + if [ -z "$ATTIC_AUTH_TOKEN" ]; then + echo "Please set the \$ATTIC_AUTH_TOKEN environment variable to access the cache." + exit 3 + fi + attic login "$CACHE_NAME" "$SERVER" "$ATTIC_AUTH_TOKEN" + + case "$1" in + use) + attic use "$CACHE_REPO" + ;; + push) + RESULT_PATH="./result" + # Add build dependencies as well + nix-store -qR --include-outputs "$(nix-store -qd $RESULT_PATH)" | grep -v '\.drv$' \ + | xargs attic push "$CACHE_REPO" "$RESULT_PATH" + ;; + + esac + ''; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9ad9d23 --- /dev/null +++ b/flake.lock @@ -0,0 +1,131 @@ +{ + "nodes": { + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1718194053, + "narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1702272962, + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1725983898, + "narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "deploy-rs": "deploy-rs", + "nixpkgs-unstable": "nixpkgs-unstable", + "tabi": "tabi" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tabi": { + "flake": false, + "locked": { + "lastModified": 1725900558, + "narHash": "sha256-/H++gzEe+bvw57aUIEvPe5hNjZOIqo7FEaGezCTau9w=", + "owner": "welpo", + "repo": "tabi", + "rev": "1b11f4b321d0ae52179d88cc3ecd1b72ef2b37ae", + "type": "github" + }, + "original": { + "owner": "welpo", + "ref": "main", + "repo": "tabi", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9da0ca5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,95 @@ +{ + inputs = { + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + deploy-rs.url = "github:serokell/deploy-rs"; + tabi = { + url = "github:welpo/tabi/main"; + flake = false; + }; + }; + + outputs = + { + self, + nixpkgs-unstable, + deploy-rs, + tabi, + ... + }@inputs: + let + system = "x86_64-linux"; + domain = "fabianhauser.ch"; + version = "2022"; + pkgs = import nixpkgs-unstable { inherit system; }; + deployPkgs = import nixpkgs-unstable { + inherit system; + overlays = [ + deploy-rs.overlay + (self: super: { + deploy-rs = { + inherit (pkgs) deploy-rs; + lib = super.deploy-rs.lib; + }; + }) + ]; + }; + preparePhase = '' + rm -rf themes/tabi + ln -s ${tabi} themes/tabi + ''; + + in + { + formatter.${system} = pkgs.nixfmt-rfc-style; + checks.${system}.default = pkgs.stdenv.mkDerivation { + inherit version; + name = "${domain}-${version}"; + buildInputs = [ pkgs.zola ]; + src = ./src; + installPhase = '' + set -euo pipefail + ${preparePhase} + zola --root . check + mkdir $out + ''; + }; + packages.${system}.default = pkgs.stdenv.mkDerivation { + inherit version; + name = "${domain}-${version}"; + buildInputs = [ pkgs.zola ]; + src = ./src; + installPhase = '' + ${preparePhase} + zola --root . build --output-dir $out + ''; + }; + + deploy.nodes.lindberg-webapps = { + hostname = "lindberg-webapps.backplane.net.qo.is"; + profiles.${domain} = { + sshUser = "nginx-${domain}"; + path = deployPkgs.deploy-rs.lib.activate.noop self.packages.${system}.default; + profilePath = "/var/lib/nginx-${domain}/root"; + }; + }; + + apps.${system} = { + default = + let + zola = pkgs.writeShellScriptBin "zola" '' + cd src + ${preparePhase} + ${pkgs.zola}/bin/zola --root . ''${@} + ''; + in + { + type = "app"; + program = "${zola}/bin/zola"; + }; + deploy = { + type = "app"; + program = "${pkgs.deploy-rs}/bin/deploy"; + }; + }; + }; +} diff --git a/src/config.toml b/src/config.toml new file mode 100644 index 0000000..ce2c0a1 --- /dev/null +++ b/src/config.toml @@ -0,0 +1,46 @@ +title = "FabianHauser.ch" +base_url = "https://fabianhauser.ch" + +# Build options +compile_sass = false +minify_html = false +ignored_content = [".gitignore", ".gitkeep"] + +# Theme +theme = "tabi" +#quick_navigation_buttons = true + +# Search +build_search_index = true + +# Feed +generate_feeds = true +feed_limit = 40 + +# Taxanomy +taxonomies = [ + {name = "tags", feed = true}, # each tag will have its own feed + {name = "tags"}, # you can have taxonomies with the same name in multiple languages + {name = "categories", paginate_by = 5}, # 5 items per page for a term +] + +[link_checker] +external_level = "warn" + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true + +[slugify] +paths = "safe" +taxonomies = "safe" +anchors = "on" + +[extra] +author = "Fabian Hauser" +menu = [ + { name = "about", url = "", trailing_slash = true }, + { name = "projects", url = "projects", trailing_slash = true }, +] + diff --git a/src/content/_index.md b/src/content/_index.md new file mode 100644 index 0000000..8c80cd2 --- /dev/null +++ b/src/content/_index.md @@ -0,0 +1,24 @@ ++++ +#path = "/" +title = "About" +template = "home.html" + +[extra] +header = {title = "Hi! I'm Fabian.", img = "img/profile.webp" } ++++ + +I’m a passionate traveller, mountaineer, [photographer](https://portfolio.pixelfed.social/fabianhauser) and lifelong learner. +Currently, I'm taking a sabbatical to travel eastern Asia šŸŒ + +Professionally, I've been active in computer science and teaching with a focus on software engineering, distributed systems and [open source software](./projects). + +Before, I was bringing secure and privacy first communication to the general public at [Threema](https://threema.ch/) +and giving lectures on Software Engineering at [OST – Fachhochschule Ostschweiz](https://www.ost.ch/). + +  + +[šŸ“¬ fabian@fh2.ch](mailto:fabian@fh2.ch) +[šŸ“· Pixelfed Portfolio](https://portfolio.pixelfed.social/fabianhauser) +[āš™ļø github.com/fabianhauser](https://github.com/fabianhauser) +šŸ”’ **GPG-Key**: [`0x8a52a140bebf7d2c`](https://keys.openpgp.org/search?q=fabian%40fh2.ch) +     Fingerprint: `50B7 11F4 3DFD 2018 DCE6 E8D0 8A52 A140 BEBF 7D2C` diff --git a/src/content/_projects/_index.md b/src/content/_projects/_index.md new file mode 100644 index 0000000..52656d2 --- /dev/null +++ b/src/content/_projects/_index.md @@ -0,0 +1,7 @@ ++++ +title = "Projects" +sort_by = "weight" +template = "cards.html" ++++ + + diff --git a/src/content/_projects/nixos.md b/src/content/_projects/nixos.md new file mode 100644 index 0000000..3f044e8 --- /dev/null +++ b/src/content/_projects/nixos.md @@ -0,0 +1,9 @@ ++++ +title = "NixOS" +description = "Contributor and package maintainer" +weight = 1 + +[extra] +local_image = "img/projects/nixos.svg" +link_to = "https://github.com/NixOS" ++++ diff --git a/src/content/_projects/openhsr.md b/src/content/_projects/openhsr.md new file mode 100644 index 0000000..f4f7f57 --- /dev/null +++ b/src/content/_projects/openhsr.md @@ -0,0 +1,9 @@ ++++ +title = "open\\HSR" +description = "Association to advance the open source community and usage of alternative operation systems (particularly Linux) at HSR University of Applied Sciences (now OST)." +weight = 1 + +[extra] +local_image = "img/projects/open-hsr-logo-transparent.svg" +link_to = "https://github.com/openhsr" ++++ diff --git a/src/content/_projects/redbackup.md b/src/content/_projects/redbackup.md new file mode 100644 index 0000000..6394412 --- /dev/null +++ b/src/content/_projects/redbackup.md @@ -0,0 +1,9 @@ ++++ +title = "Redbackup" +description = "Prototype of a distributed backups software written in Rust.\nJoint study project with Raphael Zimmermann." +weight = 1 + +[extra] +local_image = "img/projects/redbackup.png" +link_to = "https://redbackup.github.io/" ++++ diff --git a/src/content/_projects/xmpp-grid-broker.md b/src/content/_projects/xmpp-grid-broker.md new file mode 100644 index 0000000..936eb6c --- /dev/null +++ b/src/content/_projects/xmpp-grid-broker.md @@ -0,0 +1,9 @@ ++++ +title = "XMPP-Grid Broker" +description = "Feasibility study and implementation prototype of [RFC8600](https://tools.ietf.org/html/rfc8600) as contribution to the (then ongoing) standardization process.\nJoint bachelor thesis with Raphael Zimmermann." +weight = 1 + +[extra] +local_image = "img/projects/xmpp-grid-broker.svg" +link_to = "https://xmpp-grid-broker.github.io/" ++++ diff --git a/src/content/projects.md b/src/content/projects.md new file mode 100644 index 0000000..bb965b5 --- /dev/null +++ b/src/content/projects.md @@ -0,0 +1,88 @@ ++++ +title = "Projects" +weight = 5 + +[extra] +show_reading_time = false ++++ + +A selection of projects and associations I am (or was) involved with. + +## Computer Science & Open Source + +{% references() %} + +[**NixOS**](https://nixos.org/) +Package Maintainer and active community member. + +[**Redbackup**](https://github.com/redbackup) +Prototype of a distributed backups software written in +[Rust](https://www.rust-lang.org/). +Joint study project with [Raphael Zimmermann](https://www.raphael.li). + +[**XMPP-Grid Broker**](https://xmpp-grid-broker.github.io) +Feasibility study and implementation prototype of +[RFC8600](https://tools.ietf.org/html/rfc8600) as contribution to +the (then ongoing) standardization process. +Joint bachelor thesis with [Raphael Zimmermann](https://www.raphael.li). + +**[open\\HSR](https://openhsr.ch/)**: **Co-founder and former board +member** +Association to advance the open source community and usage of +alternative operation systems (particularly Linux) at HSR University +of Applied Sciences (now OST). + +**open\\HSR Git/GitHub Workshop** 2019 + +**open\\HSR Linux Workshop** 2020 + +**open\\HSR Connect** +Prototype of a lecture slide, documents and notes managing tool for +students. + +[**Swiss Python Summit**](https://python-summit.ch) helper (2017, +2018) + +[**ZuriHac**](https://www.zurihac.info) attendee/helper (2019) + +[**Dafny programming language**](https://github.com/dafny-lang) and, +in particular, the [VSCode IDE Dafny integration](https://github.com/dafnyvscode) with a +[LSP](https://microsoft.github.io/language-server-protocol/) +integration + +[**Das Studentenportal**](https://studentenportal.ch/) +Platform for students to exchange learning aids, announcing events +(mostly parties) and sharing funny anecdotes. + +**Various small side projects** -- take a look at my [GitHub profile](https://github.com/fabianhauser/) + +{% end %} + + +## Various + +{% references() %} + + + +[**Coredump**](https://www.coredump.ch) Hacker- and Makerspace +Rapperswil-Jona + +[**Various lecture +summaries**](https://github.com/michiwieland/hsr-zusammenfassungen) +together with [Michael Wieland](https://michiwieland.dev/) + +[**Little House on the +Prairie**](https://littlehouseontheprairie.ch) (website) + +[**Emmentaler Filmtage**](https://emmentaler-filmtage.ch) a short +film festival in the rural area of Emmental (Switzerland, 2009-2014) + +[**Klettergarten Ilanz/Schnaus**](https://www.klettern-gr.ch/) +realization of a climbing area near Ilanz and Schnaus and former +website + +[**Spielgruppe Ilanz**](https://spielgruppe-ilanz.ch/) former +website and technology support + +{% end %} diff --git a/src/static/.gitkeep b/src/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/static/img/profile.webp b/src/static/img/profile.webp new file mode 100644 index 0000000..01fb095 --- /dev/null +++ b/src/static/img/profile.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4152867c1b4123ee6e3c9de5dc8f0de3cbcb9324f6cc8acc40523e889d3fe6a8 +size 46022 diff --git a/src/static/img/projects/nixos.svg b/src/static/img/projects/nixos.svg new file mode 100644 index 0000000..d69da69 --- /dev/null +++ b/src/static/img/projects/nixos.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/static/img/projects/open-hsr-logo-transparent.svg b/src/static/img/projects/open-hsr-logo-transparent.svg new file mode 100644 index 0000000..7244cd9 --- /dev/null +++ b/src/static/img/projects/open-hsr-logo-transparent.svg @@ -0,0 +1,169 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + open-hsr-logo + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/static/img/projects/redbackup.png b/src/static/img/projects/redbackup.png new file mode 100644 index 0000000..b77281d --- /dev/null +++ b/src/static/img/projects/redbackup.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83666c41198a71b31da0dae44b6a0d8fa246d27cc908b84ffae8503e1369749a +size 46667 diff --git a/src/static/img/projects/redbackup.svg b/src/static/img/projects/redbackup.svg new file mode 100644 index 0000000..2619d1b --- /dev/null +++ b/src/static/img/projects/redbackup.svg @@ -0,0 +1,236 @@ + + + + + + + image/svg+xml + + 05 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 05 + + + + + + + + + + + + diff --git a/src/static/img/projects/xmpp-grid-broker.svg b/src/static/img/projects/xmpp-grid-broker.svg new file mode 100644 index 0000000..87da8da --- /dev/null +++ b/src/static/img/projects/xmpp-grid-broker.svg @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/templates/.gitkeep b/src/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/templates/home.html b/src/templates/home.html new file mode 100644 index 0000000..cb25f97 --- /dev/null +++ b/src/templates/home.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% block main_content %} + +
+{% if section.extra.section_path -%} + {% set extra_section = get_section(path=section.extra.section_path) %} +{% endif -%} + +{%- if section.extra.header %} + {%- include "partials/home_banner.html" -%} +{% endif -%} +
+ +{% if paginator %} + {%- include "partials/paginate.html" -%} +{% endif %} + +{% endblock main_content %} diff --git a/src/templates/journey.html b/src/templates/journey.html new file mode 100644 index 0000000..3cec49a --- /dev/null +++ b/src/templates/journey.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block main_content %} + {% if section.extra.section_path -%} + {% set section = get_section(path=section.extra.section_path) %} + {% endif -%} + + {{ macros_page_header::page_header(title=section.title) }} + +
+ {% if section.content -%} +
{{ section.content | safe }}
+ {% endif %} + + {%- if paginator %} + {%- set show_pages = paginator.pages -%} + {% else %} + {%- set show_pages = section.pages -%} + {% endif -%} + + {%- include "partials/journey_pages.html" -%} +
+ + {% if paginator %} + {%- include "partials/paginate.html" -%} + {% endif %} +{% endblock main_content %} diff --git a/src/templates/partials/journey_pages.html b/src/templates/partials/journey_pages.html new file mode 100644 index 0000000..0af4425 --- /dev/null +++ b/src/templates/partials/journey_pages.html @@ -0,0 +1,42 @@ +{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} + +
+ {%- for page in show_pages %} +
+ {# Determine which URL to use, default is page.permalink #} + {%- if page.extra.link_to and config.markdown.external_links_target_blank -%} + {%- set blank_target = "target=_blank" -%} + {%- else -%} + {%- set blank_target = "" -%} + {%- endif -%} + + {% set target_url = page.extra.link_to | default(value=page.permalink) %} + + + {% if page.extra.local_image %} + {% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %} + {{ page.extra.local_image }} + {% elif page.extra.remote_image %} + {{ page.extra.remote_image }} + {% else %} +
+ {% endif %} +
+ +
+

+ {{ page.title }} +

+ {% if journey.description %} +

{{ journey.description }}

+ {% endif %} + +
+ {% if page.description %} + {{ page.description }} + {% endif %} +
+
+
+ {% endfor -%} +
diff --git a/src/templates/partials/travel_listing.html b/src/templates/partials/travel_listing.html new file mode 100644 index 0000000..3437149 --- /dev/null +++ b/src/templates/partials/travel_listing.html @@ -0,0 +1,54 @@ +{# Set locale for date #} +{% set date_locale = macros_translate::translate(key="date_locale", default="en_GB", language_strings=language_strings) %} + + +
+ +
diff --git a/src/templates/travel-stop.html b/src/templates/travel-stop.html new file mode 100644 index 0000000..e8155dd --- /dev/null +++ b/src/templates/travel-stop.html @@ -0,0 +1,160 @@ +{% extends "base.html" %} + +{% block main_content %} +{%- set separator = config.extra.separator | default(value="•") -%} + +{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} + +{%- if config.markdown.external_links_target_blank -%} + {%- set blank_target = "target=_blank" -%} +{%- else -%} + {%- set blank_target = "" -%} +{%- endif -%} + +{# Debugging #} +{# {% set last_ancestor = page.ancestors | slice(start=-1) %} +{% set current_section = get_section(path=last_ancestor.0) %} + +{% set settings_to_test = [ + "footnote_backlinks", + "katex", + "quick_navigation_buttons", + "show_reading_time", + "show_remote_changes", + "toc", +] %} + + + + + + + + + + + + + {% for setting in settings_to_test %} + + + + + + + + {% endfor %} + +
settingpagesectionconfigmacro output
{{ setting }}{{ page.extra[setting] | default(value="⬛") }}{{ current_section.extra[setting] | default(value="⬛") }}{{ config.extra[setting] | default(value="⬛") }}{{ macros_settings::evaluate_setting_priority(setting=setting, page=page) }}
#} +{# {{ __tera_context }} #} +{# End debugging #} + + + +
+
+ {% if page.ancestors | length > 2 %} + +{% endif %} +

+ {{ page.title }} +

+ +
    + {% if page.draft %} +
  • {{ macros_translate::translate(key="draft", default="DRAFT", language_strings=language_strings) }}
  • + {% endif %} + + {% if page.date %} +
  • {{ macros_format_date::format_date(date=page.date, short=true, language_strings=language_strings) }}
  • + {% endif %} + + {# page settings override config settings #} + {% if macros_settings::evaluate_setting_priority(setting="show_reading_time", page=page, default_global_value=true) == "true" %} + {{ separator }}
  • {{ page.reading_time }} {{ macros_translate::translate(key="min_read", default="min read", language_strings=language_strings) }}
  • + {% endif %} + + {%- if page.taxonomies and page.taxonomies.tags -%} + {{ separator }} 
  • {{- macros_translate::translate(key="tags", default="tags", language_strings=language_strings) | capitalize -}}: 
  • + {%- for tag in page.taxonomies.tags -%} +
  • {{ tag }} + {%- if not loop.last -%} + ,  + {%- endif -%} +
  • + {%- endfor -%} + {%- endif -%} + + {% if page.updated %} +
  • {{ macros_translate::translate(key="last_updated_on", default="Last updated on", language_strings=language_strings) }} {{ macros_format_date::format_date(date=page.updated, short=true, language_strings=language_strings) }}
  • + {# Show link to remote changes if enabled #} + {% if config.extra.remote_repository_url and macros_settings::evaluate_setting_priority(setting="show_remote_changes", page=page, default_global_value=true) == "true" %} + {{ separator }} +
  • {{ macros_translate::translate(key="see_changes", default="See changes", language_strings=language_strings) }} ↗
  • + {% endif %} + {% endif %} +
+ + {% if page.extra.tldr %} +
+

TL;DR:

+

{{ page.extra.tldr }}

+
+ {% endif %} + + {# Optional table of contents below the header #} + {% if page.toc and macros_settings::evaluate_setting_priority(setting="toc", page=page, default_global_value=false) == "true" %} + {{ macros_toc::toc(page=page, header=true, language_strings=language_strings) }} + {% endif %} + +
+ {# The replace pattern is used to enable arbitrary locations for the Table of Contents #} + {# This is Philipp Oppermann's workaround: https://github.com/getzola/zola/issues/584#issuecomment-474329637 #} + {{ page.content | replace(from="", to=macros_toc::toc(page=page, header=false, language_strings=language_strings)) | safe }} +
+ + {# Check if comments are enabled, checking that they are not disabled on the specific page #} + {% set systems = ["giscus", "utterances", "hyvortalk", "isso"] %} + {% set enabled_systems = 0 %} + {% set comment_system = "" %} + + {% for system in systems %} + {% set global_enabled = config.extra[system].enabled_for_all_posts | default(value=false) %} + {% set page_enabled = page.extra[system] | default(value=global_enabled) %} + {% set is_enabled = global_enabled and page_enabled != false or page_enabled == true %} + + {% if is_enabled %} + {% set_global comment_system = system %} + {% set_global enabled_systems = enabled_systems + 1 %} + {% endif %} + {% endfor %} + + {# Ensure only one comment system is enabled #} + {% if enabled_systems > 1 %} + {{ throw(message="ERROR: Multiple comment systems have been enabled for the same page. Check your config.toml and individual page settings to ensure only one comment system is activated at a time.") }} + {% endif %} + + {% if comment_system %} + {% include "partials/comments.html" %} + {% endif %} + +
+
+ +{%- include "partials/extra_features.html" -%} + +{% endblock main_content %} diff --git a/src/templates/travel.html b/src/templates/travel.html new file mode 100644 index 0000000..15d26a3 --- /dev/null +++ b/src/templates/travel.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} + +{% block main_content %} + {% if section.extra.section_path -%} + {% set section = get_section(path=section.extra.section_path) %} + {% endif -%} + + {{ macros_page_header::page_header(title=section.title) }} + +
+ {% if section.content -%} +
{{ section.content | safe }}
+ {% endif %} + + {%- if paginator %} + {%- set show_journeys = paginator.subsections -%} + {%- set show_pages = paginator.pages -%} + {% else %} + {%- set show_journeys = section.subsections -%} + {%- set show_pages = section.pages -%} + {% endif -%} + + {%- include "partials/travel_listing.html" -%} +
+ + {% if paginator %} + {%- include "partials/paginate.html" -%} + {% endif %} +{% endblock main_content %} diff --git a/src/themes/.gitkeep b/src/themes/.gitkeep new file mode 100644 index 0000000..e69de29