From 6ec238ef421822333f1a5223cf86ab005a039864 Mon Sep 17 00:00:00 2001 From: wzykubek Date: Sun, 22 Dec 2024 01:06:27 +0100 Subject: [PATCH] Initial commit --- .gitignore | 2 + LICENSE | 21 ++ archetypes/default.md | 5 + assets/css/main.css | 183 ++++++++++++++++++ assets/css/rose-pine-dawn.css | 17 ++ assets/css/rose-pine-main.css | 17 ++ assets/css/rose-pine-moon.css | 17 ++ assets/js/main.js | 1 + content/en/_index.md | 15 ++ content/en/blog/_index.md | 5 + ...-arch-linux-with-btrfs-luks-and-yubikey.md | 182 +++++++++++++++++ content/en/contact.md | 7 + hugo.yaml | 82 ++++++++ layouts/_default/_markup/render-heading.html | 1 + layouts/_default/baseof.html | 17 ++ layouts/_default/home.html | 14 ++ layouts/_default/list.html | 11 ++ layouts/_default/section.rss.xml | 59 ++++++ layouts/_default/single.html | 9 + layouts/partials/footer.html | 11 ++ layouts/partials/head.html | 8 + layouts/partials/head/css.html | 14 ++ layouts/partials/head/js.html | 12 ++ layouts/partials/header.html | 22 +++ layouts/partials/menu.html | 51 +++++ layouts/partials/terms.html | 23 +++ static/favicon.ico | Bin 0 -> 15406 bytes 27 files changed, 806 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 archetypes/default.md create mode 100644 assets/css/main.css create mode 100644 assets/css/rose-pine-dawn.css create mode 100644 assets/css/rose-pine-main.css create mode 100644 assets/css/rose-pine-moon.css create mode 100644 assets/js/main.js create mode 100644 content/en/_index.md create mode 100644 content/en/blog/_index.md create mode 100644 content/en/blog/installing-arch-linux-with-btrfs-luks-and-yubikey.md create mode 100644 content/en/contact.md create mode 100644 hugo.yaml create mode 100644 layouts/_default/_markup/render-heading.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/home.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/section.rss.xml create mode 100644 layouts/_default/single.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/head/css.html create mode 100644 layouts/partials/head/js.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/menu.html create mode 100644 layouts/partials/terms.html create mode 100644 static/favicon.ico diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..56af776 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +public/ +*.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8aa2645 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [year] [fullname] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..c6f3fce --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = '{{ replace .File.ContentBaseName "-" " " | title }}' +date = {{ .Date }} +draft = true ++++ diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..8bfce8d --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,183 @@ +@import url("https://fonts.googleapis.com/css2?family=Funnel+Display:wght@300..800&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap"); + +body { + background-color: var(--base); + color: var(--text); + font-family: "Funnel Display", sans-serif; + line-height: 1.5; + margin: auto; + max-width: 768px; +} + +@media only screen and (max-width: 810px) { + body { + max-width: 90vw; + } + + .hidden-on-mobile { + display: none; + } +} + +header { + border-bottom: 1px solid var(--highlightLow); + margin-bottom: 1rem; +} + +nav > ul { + margin: 0; + padding: 0; +} + +nav > ul > li { + display: inline; + list-style: none; + margin-right: 10px; +} + +ul { + padding-left: 15px; +} + +.flex-space-between { + display: flex; + justify-content: space-between; +} + +time { + font-size: 14px; + color: var(--muted); +} + +footer { + border-top: 1px solid var(--highlightLow); + margin-top: 1rem; + color: var(--muted); +} + +p { + text-align: justify; + font-size: 15px; +} + +/* */ +:is(h1, h2, h3, h4, h5) { + color: var(--gold); +} + +:is(h1, h2, h3, h4, h5) > a { + color: var(--pine); +} + +h1 > a { + color: var(--love); +} + +a { + color: var(--love); + text-decoration: none; + font-weight: bold; +} + +a:hover { + color: var(--rose); + text-decoration: underline; + transition: 0.3s; +} + +:is(h1, h2, h3, h4, h5, h6)::before { + content: "#"; + color: var(--muted); + margin-right: 10px; +} + +header > h1::after { + content: "_"; + color: var(--muted); + + animation: blink-animation 1.5s steps(5, start) infinite; + -webkit-animation: blink-animation 1.5s steps(5, start) infinite; +} + +@keyframes blink-animation { + to { + visibility: hidden; + } +} + +@-webkit-keyframes blink-animation { + to { + visibility: hidden; + } +} + +.inline-heading { + display: inline; + margin-left: 10px; +} + +blockquote { + border-left: 5px solid var(--rose); + border-radius: 3px; + margin: 0px; + background-color: var(--surface); +} + +blockquote > p { + margin-left: 10px; + padding: 3px; +} + +pre, +code { + background-color: var(--overlay) !important; + font-family: "Roboto Mono", monospace; + font-size: 14px; + border-radius: 3px; +} + +pre { + padding: 10px 16px; + overflow: auto; +} + +code { + color: var(--gold); + padding: 0px 3px; +} + +pre > code { + padding: 0; +} + +code > span { + color: var(--iris); +} + +table { + margin: auto; + width: 100%; +} + +th, +td { + padding: 5px 10px; +} + +th { + /*min-width: 180px;*/ + background-color: var(--overlay); + text-align: center !important; +} + +tr { + max-width: 500px; +} + +tr:nth-child(odd) { + background-color: var(--highlightHigh); +} + +tr:nth-child(even) { + background-color: var(--highlightMed); +} diff --git a/assets/css/rose-pine-dawn.css b/assets/css/rose-pine-dawn.css new file mode 100644 index 0000000..959baad --- /dev/null +++ b/assets/css/rose-pine-dawn.css @@ -0,0 +1,17 @@ +* { + --base: #faf4ed; + --surface: #fffaf3; + --overlay: #f2e9e1; + --muted: #9893a5; + --subtle: #797593; + --text: #575279; + --love: #b4637a; + --gold: #ea9d34; + --rose: #d7827e; + --pine: #286983; + --foam: #56949f; + --iris: #907aa9; + --highlightLow: #f4ede8; + --highlightMed: #dfdad9; + --highlightHigh: #cecacd; +} diff --git a/assets/css/rose-pine-main.css b/assets/css/rose-pine-main.css new file mode 100644 index 0000000..036b421 --- /dev/null +++ b/assets/css/rose-pine-main.css @@ -0,0 +1,17 @@ +* { + --base: #191724; + --surface: #1f1d2e; + --overlay: #26233a; + --muted: #6e6a86; + --subtle: #908caa; + --text: #e0def4; + --love: #eb6f92; + --gold: #f6c177; + --rose: #ebbcba; + --pine: #31748f; + --foam: #9ccfd8; + --iris: #c4a7e7; + --highlightLow: #21202e; + --highlightMed: #403d52; + --highlightHigh: #524f67; +} diff --git a/assets/css/rose-pine-moon.css b/assets/css/rose-pine-moon.css new file mode 100644 index 0000000..c67f42d --- /dev/null +++ b/assets/css/rose-pine-moon.css @@ -0,0 +1,17 @@ +* { + --base: #232136; + --surface: #2a273f; + --overlay: #393552; + --muted: #6e6a86; + --subtle: #908caa; + --text: #e0def4; + --love: #eb6f92; + --gold: #f6c177; + --rose: #ea9a97; + --pine: #3e8fb0; + --foam: #9ccfd8; + --iris: #c4a7e7; + --highlightLow: #2a283e; + --highlightMed: #44415a; + --highlightHigh: #56526e; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..e2aac52 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1 @@ +console.log('This site was generated by Hugo.'); diff --git a/content/en/_index.md b/content/en/_index.md new file mode 100644 index 0000000..93d54f1 --- /dev/null +++ b/content/en/_index.md @@ -0,0 +1,15 @@ ++++ +title = 'Home' +date = 2023-01-01T08:00:00-07:00 +draft = false ++++ + +_Hello World!_ :wave: I'm **Wiktor** - computer science freak. I love everything about computers, but especially free software, Linux and servers, software development, [music production](https://lugnx.xyz), graphics... Oh, that's a lot, but I didn't even named a half of the things. I don't have enough time in my life to do everything I want to do, but on this website I will share all kind of content for which I found some time and put enough effort. + +Find me on +[Gitea](https://git.brono.cloud/wzykubek), +[GitHub](https://github.com/wzykubek), +[Telegram](https://t.me/wzykubek), +[RSS](blog/index.xml) +or +[e-mail](mailto:contact@wzykubek.xyz). diff --git a/content/en/blog/_index.md b/content/en/blog/_index.md new file mode 100644 index 0000000..a5ecda8 --- /dev/null +++ b/content/en/blog/_index.md @@ -0,0 +1,5 @@ ++++ +title = 'Blog' +date = '2024-11-23T13:39:35+01:00' +draft = false ++++ diff --git a/content/en/blog/installing-arch-linux-with-btrfs-luks-and-yubikey.md b/content/en/blog/installing-arch-linux-with-btrfs-luks-and-yubikey.md new file mode 100644 index 0000000..d8fb8e7 --- /dev/null +++ b/content/en/blog/installing-arch-linux-with-btrfs-luks-and-yubikey.md @@ -0,0 +1,182 @@ ++++ +date = '2024-11-23T13:39:35+01:00' +draft = false +title = 'Installing Arch Linux with Btrfs, LUKS encryption and YubiKey Authentication' ++++ + +In this tutorial I will show you how to use your YubiKey with LUKS. In this case we will use our key to shorten encryption password. Person, who will get access to your machine but without key, will be prompted for very long, computer generated password. On the other hand - _you_ - will be prompted only for the PIN for your attached YubiKey. Of course your PIN also should be as long and complicated as possible, but you should be able to memorize it. + +## My setup + +I will use following configuration: + ++ Two partitions: one for EFI system partition, second one for root with Btrfs filesystem. This will allow us creating volumes for directories like `/home` and `/var` with no need to use [LVM](https://en.wikipedia.org/wiki/Logical_volume_management). + ++ systemd-boot as a bootloader. This is only my preference, on my main desktop I use rEFInd, but systemd-boot is simpler to configure and is bundled with systemd and that is crucial for me. I perform all procedure on my Chromebook with 16 GB eMMC memory. + ++ Encrypted root partition with LUKS which can be unlocked using YubiKey or any other hardware token which support FIDO2 HMAC Secret extension. You can add spare key as well. For critical situation we have also secure (128 characters) password for recovery. + +## Prerequisites + ++ USB stick with fresh [Arch Linux Live ISO](https://archlinux.org/download/). +Latest ISO should have all the tools we will use so you don't need to install anything additional. + ++ Follow official [installation guide](https://wiki.archlinux.org/title/Installation_guide), but use this tutorial in important moments. + +## Destroy disk + +Wipe disk before encryption. + +```bash +cryptsetup open --type plain --key-file /dev/urandom --sector-size 4096 /dev/sda wipeit +``` + +```bash +dd if=/dev/zero of=/dev/mapper/wipeit status=progress bs=1M +``` + +```bash +cryptsetup close wipeit +``` + +## Partitioning + +Create only two partitions. One for ESP and one for filesystem. To simplify next steps I will use the following template. + +| Partition | Target | +| :-------- | :--------------------- | +| /dev/sda1 | Boot partition | +| /dev/sda2 | Filesystem partition | + +Format boot partition using following command. + +```bash +mkfs -t fat -F32 /dev/sda1 +``` + +Format second partition as a LUKS volume. This command will prompt you for passphrase. Generate it with your password manager (e.g. Bitwarden) using random characters. I recommend using 128 characters. You will not use it to unlock your drive, it will be only your recovery option in case you loose your YubiKey. This is probably the most painful step, because you need to type this passphrase few times but it is worth it to keep it secure. + +```bash +cryptsetup -v luksFormat /dev/sda2 +``` + +Decrypt and open volume (you need to enter password). + +```bash +cryptsetup open /dev/sda2 root +``` + +## Adding YubiKey(s) + +Connect only one key at once and run command bellow, enter passphrase and touch your key two times. It won't display anything after password, so you need to remember. + +```bash +systemd-cryptenroll --fido2-device=auto --fido2-with-client-pin=true --fido2-with-user-presence=true /dev/sda2 +``` + +If you have spare key, disconnect first one, connect second and run exact same command again. + +You can verify if everything is addedd correctly using command bellow. + +```bash +cryptsetup luksDump /dev/sda2 +``` + +You should see 3 entries in Keyslots category and two in Tokens. + +## Create filesystem on encrypted volume + +Create filesystem. + +```bash +mkfs -t btrfs /dev/mapper/root +``` + +Mount mapper. + +```bash +mount /dev/mapper/root /mnt +``` + +Create Btrfs subvolumes. + +```bash +btrfs subvolume create /mnt/@ +``` +```bash +btrfs subvolume create /mnt/@home +``` +```bash +btrfs subvolume create /mnt/@var +``` + +Remount volumes. + +```bash +umount /mnt +``` +```bash +mount /dev/sda1 --mkdir /mnt/boot +``` +```bash +mount /dev/mapper/root -o subvol=@ /mnt +``` +```bash +mount /dev/mapper/root -o subvol=@home --mkdir /mnt/home +``` +```bash +mount /dev/mapper/root -o subvol=@var --mkdir /mnt/var +``` + +## Initramfs + +Follow next steps of the official guideline, enter chroot and stop at the moment. We need to configure and recreate initramfs image. + +Edit `/etc/mkinitcpio.conf`. You need to configure `HOOKS` and `BINARIES` section to contain following items. + +> Note: You will need to install `libfido2` on your new system. + +``` +BINARIES=(/usr/lib/libfido2.so.1) +HOOKS=(base systemd autodetect microcode modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck) +``` + +## Bootloader + +In this tutorial I will use systemd-boot. We need to install bootloader on ESP and add some options to decrypt drive on boot. + +Install bootloader. + +```bash +bootctl install +``` + +Edit `/boot/loader/loader.conf` and add this line at the beggining: + +``` +default arch.conf +``` + +Now create `/boot/loader/entries/arch.conf` with following content. I use Linux Zen kernel but if you use stable one just remove `-zen` from entries. + +``` +title Arch Linux +linux /vmlinuz-linux-zen +initrd /initramfs-linux-zen.img +options rd.luks.name=YOUR_UUID=root root=/dev/mapper/root rootflags=subvol=@ rw +``` + +Replace _YOUR_UUID_ with actual UUID of `/dev/sda2`. You can get it from `blkid /dev/sda2` command. + +## Final thoughts + +You can also setup [Plymouth](https://wiki.archlinux.org/title/Plymouth) to get nice and colorful password or PIN prompt instead of terminal window. + + + + + + + + + diff --git a/content/en/contact.md b/content/en/contact.md new file mode 100644 index 0000000..2bf119c --- /dev/null +++ b/content/en/contact.md @@ -0,0 +1,7 @@ ++++ +title = 'Contact' +date = '2024-11-23T13:39:35+01:00' +draft = false ++++ + +Simply, write me an [e-mail](mailto:contact@wzykubek.xyz). diff --git a/hugo.yaml b/hugo.yaml new file mode 100644 index 0000000..038f2a4 --- /dev/null +++ b/hugo.yaml @@ -0,0 +1,82 @@ +baseURL: https://wzykubek.xyz +title: Wiktor Zykubek +copyright: Copyright © 2024 Wiktor Zykubek + +defaultContentLanguage: en +defaultContentLanguageInSubdir: true +pluralizeListTitles: false +enableEmoji: true + +languages: + en: + contentDir: content/en + disabled: false + languageCode: en + languageDirection: ltr + languageName: English + weight: 1 + params: + subtitle: Personal website + menus: + main: + - name: Home + pageRef: / + weight: 10 + - name: Blog + pageRef: /blog + weight: 20 + - name: Projects + url: https://git.brono.cloud/wzykubek + weight: 30 + - name: Music + url: https://lugnx.xyz + weight: 40 + - name: Contact + pageRef: /contact + weight: 50 + pl: + contentDir: content/pl + disabled: false + languageCode: pl + languageDirection: ltr + languageName: Polski + weight: 2 + params: + subtitle: Moja strona + menus: + main: + - name: Strona Główna + pageRef: / + weight: 10 + - name: Blog + pageRef: /blog + weight: 20 + - name: Projekty + url: https://git.brono.cloud/wzykubek + weight: 30 + - name: Muzyka + url: https://lugnx.xyz + weight: 40 + - name: Kontakt + pageRef: /contact + weight: 50 + +params: + contact: + email: contact@wzykubek.xyz + author: + name: Wiktor Zykubek + email: contact@wzykubek.xyz + + +outputs: + home: + - html + section: + - html + - rss + +module: + hugoVersion: + extended: false + min: 0.116.0 diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..8a3a64c --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1 @@ +{{ .Text | safeHTML }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..39dcbec --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,17 @@ + + + + {{ partial "head.html" . }} + + +
+ {{ partial "header.html" . }} +
+
+ {{ block "main" . }}{{ end }} +
+ + + diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..75b698f --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,14 @@ +{{ define "main" }} + {{ .Content }} + {{ range site.Sections.ByWeight.Reverse }} +

{{ .LinkTitle }}

+ {{ range first 3 .Pages }} + + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + +

{{ .LinkTitle }}

+ {{ end }} + {{ end }} +{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..d5cd6cb --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,11 @@ +{{ define "main" }} +

{{ .Title }}

+ {{ .Content }} + {{ range .Pages }} +

{{ .LinkTitle }}

+ {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + {{ .Summary }} + {{ end }} +{{ end }} diff --git a/layouts/_default/section.rss.xml b/layouts/_default/section.rss.xml new file mode 100644 index 0000000..6de6dd0 --- /dev/null +++ b/layouts/_default/section.rss.xml @@ -0,0 +1,59 @@ +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- end }} + +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} + {{ . }}{{ end }}{{ if not .Date.IsZero }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ .Permalink }} + {{ .Content | transform.XMLEscape | safeHTML }} + + {{- end }} + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..06bb6fc --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,9 @@ +{{ define "main" }} +

{{ .Title }}

+ + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_medium" }} + + {{ .Content }} + {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..aff7a87 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,11 @@ +

+ {{ .Site.Copyright }} + + {{ if eq .Site.Language.LanguageCode "en" }} + Used Rosé Pine palette + {{ else if eq .Site.Language.LanguageCode "pl" }} + Wykorzystano paletę kolorów Rosé Pine + {{ end }} + + +

diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..d3df3a4 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,8 @@ + + +{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} +{{ partialCached "head/css.html" . }} +{{ partialCached "head/js.html" . }} +{{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} +{{ end }} diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..ae47c3a --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,14 @@ +{{- with resources.Get "css/main.css" }} + {{- if eq hugo.Environment "development" }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} + + +{{- with resources.Get "css/rose-pine-main.css" }} + +{{- end }} diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html new file mode 100644 index 0000000..18fe842 --- /dev/null +++ b/layouts/partials/head/js.html @@ -0,0 +1,12 @@ +{{- with resources.Get "js/main.js" }} + {{- if eq hugo.Environment "development" }} + {{- with . | js.Build }} + + {{- end }} + {{- else }} + {{- $opts := dict "minify" true }} + {{- with . | js.Build $opts | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..be77051 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,22 @@ +

{{ site.Title }}

+
+ + {{ partial "menu.html" (dict "menuID" "main" "page" .) }} + + + {{ if .IsTranslated }} + {{ range .Translations }} + + + {{ .Site.Language.LanguageCode }} + + {{ if eq .Site.Language.LanguageCode "en" }} + {{ ":gb:" | .RenderString }} + {{ else if eq .Site.Language.LanguageCode "pl" }} + {{ ":poland:" | .RenderString }} + {{ end }} + + {{ end }} + {{ end }} + +
diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..7183180 --- /dev/null +++ b/layouts/partials/menu.html @@ -0,0 +1,51 @@ +{{- /* +Renders a menu for the given menu ID. + +@context {page} page The current page. +@context {string} menuID The menu ID. + +@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $menuID := .menuID }} + +{{- with index site.Menus $menuID }} + +{{- end }} + +{{- define "partials/inline/menu/walk.html" }} + {{- $page := .page }} + {{- range .menuEntries }} + {{- $attrs := dict "href" .URL }} + {{- if $page.IsMenuCurrent .Menu . }} + {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} + {{- else if $page.HasMenuCurrent .Menu .}} + {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} + {{- end }} + {{- $name := .Name }} + {{- with .Identifier }} + {{- with T . }} + {{- $name = . }} + {{- end }} + {{- end }} +
  • + {{ $name }} + {{- with .Children }} + + {{- end }} +
  • + {{- end }} +{{- end }} diff --git a/layouts/partials/terms.html b/layouts/partials/terms.html new file mode 100644 index 0000000..8a6ebec --- /dev/null +++ b/layouts/partials/terms.html @@ -0,0 +1,23 @@ +{{- /* +For a given taxonomy, renders a list of terms assigned to the page. + +@context {page} page The current page. +@context {string} taxonomy The taxonomy. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $taxonomy := .taxonomy }} + +{{- with $page.GetTerms $taxonomy }} + {{- $label := (index . 0).Parent.LinkTitle }} +
    +
    {{ $label }}:
    + +
    +{{- end }} diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..67f8b777851849527933b78b1f98bd564d8255d1 GIT binary patch literal 15406 zcmeI3%WEH16vro|f`O{FV5Nc>unpZA42Xe(zeP4Fn0Fu>#YKe(c41L;qszMJ-bXDi z>L1W57+rSdLS5OG#!V^IKxvbj6n@gC#QOREdT$vg^US^Tf(#t)%-r+%o^#KA&hHll zeL;V)Z(l$;7%c7yg4co|7#w``eB{|6_?CCW!=`>H2!44k2#&ym2ojIpQ{=j)r>9?; zot^z+et!PXxw*M}BHinq>XMXKboc`~d=&+uPNklCgSOc%pC zkdxhQd};55Lm1#0hSD%6>D`)|ni^JI((I(w8QJADo{YL>VsSr%Ckg*U$-2s8+X=sG z{FIYm*irl0d{!y{D{f@u4p-n@#^$z+5S`e?RJu8p?Lq>0x`@}vIu7kfT z8Od5bMN4D{&~ch_$NgBcM#n%A`@~N^|ABlif3x_ci!t%#JQ&cWarai1&Z6~TkWOa9 zw}_GQ!9UZ~o(wFidYcy6DoF0rq<yz2-5e zTyl`ty!pUE-U+vC*KNN6@vklal>5+`8rxs}uh#LW?(tW105Q;7(Wx&Lm6uJ~)`e`X z^RF;~r?T~jY{_Q$A_iJ-m%jcoHny$5gr&~)r;P=1C}sVP-puv4#i0EM{FfkKed1Em zy4%`}me{Us{}sjpj#~DgVGO#rYen+cu9FI~=yTd>3AzfcLA`SnbFXu|pT#pXGc&>2(2!(N+83v|%y-!B zH|JI#fb9Zw1NxWuxyA*n7Wlp875YYr(Gs{zKTE)l_AX1Q6wmo%>|9k+6aP<2dk>lant}U*_E8rG3D-5uK;;yPx-8W%=Kfda!;c%(fl0 ze&XHrrr^uM0oGf>Z1DFnHhqLl>1%^5TzTuk|3H|*ul4(0o-gE;Z3>^kyq|VB2&R>$ z;3|M)g|TQza{|6pwl*t(FLk^UW^(9F%1?ditXdD)PeI>TZP%AQuxqb<#h1RS^?+T! z8Ck2^t}lCF{~KLC_TZ^~%@^LN9`I|g*;@RHecST~{FkHc(w1kiUj^&=w&0Dy`6E8G zdj4Yla1TF#N4vKWh(zA3A5dm)G|O@NEjS_AkOu zAJA`duQdQy-kiND%)+h<+}gi?*&_V<{_uGJE+68oBmMcH-Rl|t`yCgB%e&5Zsqq=>yyS- z+H#S&ls3nqdmTC0`~O|AJhXPJKi1jW{{U!5hztM# literal 0 HcmV?d00001