Use haml templates

This commit is contained in:
Tasia Iso 2024-05-26 20:10:32 +02:00
parent b6930e0313
commit 98ee101788
Signed by: tasiaiso
SSH key fingerprint: SHA256:KiRjUay5C9i6objsEOIycygBHn54pDBB3Lj7fyJ0Elw
7 changed files with 159 additions and 189 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
node_modules
site
NOTES.md
theme/*.html

View file

@ -1 +1,2 @@
**/*.md
**/*.md
theme/*.html

View file

@ -1,9 +1,14 @@
# Build the website
build:
site/index.html: docs/** theme/** theme/main.html
mkdocs build
theme/main.html: haml/main.haml
haml render $< > $@.tmp
cat $@.tmp > $@
rm $@.tmp
# Serve the website at http://127.0.0.1:8000/~tasiaiso/
serve:
serve: theme/main.html
mkdocs serve -w theme
format: format-code format-markdown

View file

@ -12,7 +12,7 @@
> - a Discord or Telegram bot;
> - anything else really! Automation, systems administrations, etc.
>
> Feel free to send me an email at (my username)@proton.me - Thanks!
> Feel free to send me an email at `(my username)@proton.me` - Thanks!
this is my personal website.
@ -83,6 +83,7 @@ If you like my posts, please consider supporting me on [Liberapay](https://liber
- move build scripts to a Makefile
- add johnvertisement
- add linux badge
- use haml for the main template
### v1.0.1 (2024-05-18)

145
haml/main.haml Normal file
View file

@ -0,0 +1,145 @@
<!doctype html>
%html(lang="en_US")
%head
%meta(charset="UTF-8")
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
%link(rel="icon" type="image/png" href="/~tasiaiso/favicon.png")
%link(rel="icon" type="image/x-icon" href="/~tasiaiso/favicon.ico")
%link(rel="stylesheet" href="/~tasiaiso/gruvbox-dark.css")
%link(rel="stylesheet" href="/~tasiaiso/style.css")
%title {% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}
-# <!-- <meta name="description" content="Page description"> -->
%meta(name="keywords" content="programming, technical writing")
%meta(name="author" content="Tasia Iso")
%link(rel="me" href="https://kitsunes.club/@tasiaiso")
%meta(name="ICBM" content="44.6, 4.4")
-# <!-- <meta
-# name="robots"
-# content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"
-# /> -->
%body
-# Link to root
{% if not page.is_homepage %}
%a(href="/") root
%br
%br
{% endif %}
pages
{% if nav|length>1 %}
-# Categories / Directories
%ul
{% for nav_item in nav %}
{% if nav_item.children %}
%li
{{ nav_item.title }}
-# Posts / Files
%ul
{% for nav_item in nav_item.children %}
{% if not nav_item.meta.unlisted %}
-# TODO
%li(class="{% if nav_item.active %}current{% endif %}")
%a(href="{{ nav_item.url|url }}")
{{ nav_item.meta.date }}
{% if nav_item.meta.date %} - {% endif %}
{{ nav_item.title }}
{% endif %}
{% endfor %}
{% else %}
-# TODO
%li(class="{% if nav_item.active %}current{% endif %}")
%a(href="{{ nav_item.url|url }}") {{ nav_item.title }}
{% endif %}
{% endfor %}
{% endif %}
{% if not page.is_homepage %}
table of contents
%ul
{% for toc_item in page.toc %}
%li
%a(href="{{ toc_item.url }}") {{ toc_item.title }}
{% for toc_item in toc_item.children %}
%li
%a(href="{{ toc_item.url }}") {{ toc_item.title }}
{% endfor %}
{% endfor %}
{% endif %}
%hr
{{ page.content }}
-# Webrings
%p
%a(href="https://fediring.net/previous?host=tilde.club%2F~tasiaiso" target="_top") &larr;
%a(href="https://fediring.net") Fediring
%a(href="https://fediring.net/next?host=tilde.club%2F~tasiaiso" target="_top") &rarr;
%p
%a(href="http://tilde.club/~harper/link.html?action=random" target="_top") &larr;
%a(href="https://tilde.club") tilde.club
%a(href="http://tilde.club/~harper/link.html?action=random" target="_top") &rarr;
-# 88x31 badges
%a(href="https://tea.cuddleslut.fr")
%img(src="/~tasiaiso/images/badges/tea.png" alt="fediring badge")
%a(href="https://fediring.net")
%img(src="/~tasiaiso/images/badges/fediring.png" alt="fediring badge")
%a(href="https://kitsu.life")
%img(src="/~tasiaiso/images/badges/kitsulife.png" alt="kitsulife badge")
%a(href="https://nixos.org")
%img(src="/~tasiaiso/images/badges/nixos.png" alt="nixos badge")
%a(href="https://tilde.club")
%img(src="/~tasiaiso/images/badges/tildeclub.png" alt="tilde.club badge")
%a(href="https://linux.org")
%img(src="/~tasiaiso/images/badges/linux.png" alt="tilde.club badge")
(
%a(href="/~tasiaiso/images/badges/credits.txt") credits
)
%br
%a(href="https://citrons.xyz/a/memetic-apioform-page.html") memetic apiopage
%br
%hr
This webite's source code and built webpages when shared in their entirety are provided under the
%a(href="https://www.gnu.org/licenses/gpl-3.0.en.html") GPL-3.0
license. All blog posts, articles and Markdown files contained within the
%a(href="https://gitea.com/tasiaiso/tilde") git repository
are shared under the
%a(href="https://creativecommons.org/licenses/by-nc-sa/4.0/") CC BY-NC-SA 4.0
license. If you want to use my content for commercial purposes, feel free to contact me.
%br
%br
This is an
%a(href="https://actualwebsite.org") actual website
\. This page is cleaner than 0% of all web pages globally according to
%a(href="https://www.websitecarbon.com/website/tilde-club-tasiaiso") websitecarbon.com
\.
%br
Built by
%a(href="https://www.mkdocs.org") mkdocs
and served by
%a(href="https://tilde.club") tilde.club
\.
%br
%br
-# Johnvertisement
%iframe(src="https://john.citrons.xyz/embed?ref=example.com" style="margin-left: auto; display: block; margin-right: auto; max-width: 732px; width: 100%; height: 94px; border: none;")
%br
%br

View file

@ -3,5 +3,6 @@ pkgs.mkShell{
nativeBuildInputs = with pkgs; [
python310Packages.mkdocs
python310Packages.mkdocs-minify
rubyPackages.haml
];
}

View file

@ -1,185 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/~tasiaiso/favicon.png" />
<link rel="icon" type="image/x-icon" href="/~tasiaiso/favicon.ico" />
<link rel="stylesheet" href="/~tasiaiso/gruvbox-dark.css" />
<link rel="stylesheet" href="/~tasiaiso/style.css" />
<title>
{% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}
</title>
<!-- <meta name="description" content="Page description"> -->
<meta name="keywords" content="programming, technical writing" />
<meta name="author" content="Tasia Iso" />
<link rel="me" href="https://kitsunes.club/@tasiaiso" />
<meta name="ICBM" content="44.6, 4.4" />
<!-- <meta
name="robots"
content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"
/> -->
</head>
<body>
{% if not page.is_homepage %}
<a href="/">root</a>
<br /><br />
{% endif %}
<!-- -->
pages
<!-- -->
{% if nav|length>1 %}
<ul>
{% for nav_item in nav %}
<!-- -->
{% if nav_item.children %}
<li>
{{ nav_item.title }}
<ul>
{% for nav_item in nav_item.children %} {% if not
nav_item.meta.unlisted%}
<li class="{% if nav_item.active %}current{% endif %}">
<a href="{{ nav_item.url|url }}"
>{{ nav_item.meta.date }} {% if nav_item.meta.date %} - {% endif
%} {{ nav_item.title }}</a
>
</li>
{% endif %} {% endfor %}
</ul>
</li>
{% else %}
<li class="{% if nav_item.active %}current{% endif %}">
<a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
</li>
{% endif %}
<!-- -->
{% endfor %}
</ul>
<!-- -->
{% endif %}
<!-- -->
{% if not page.is_homepage %}
<!-- -->
table of contents
<ul>
{% for toc_item in page.toc %}
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{% for toc_item in toc_item.children %}
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{% endfor %}
<!-- -->
{% endfor %}
</ul>
{% endif %}
<hr />
{{ page.content }}
<!-- Webrings -->
<p>
<a
href="https://fediring.net/previous?host=tilde.club%2F~tasiaiso"
target="_top"
>&larr;</a
>
<a href="https://fediring.net">Fediring</a>
<a
href="https://fediring.net/next?host=tilde.club%2F~tasiaiso"
target="_top"
>&rarr;</a
>
</p>
<p>
<a href="http://tilde.club/~harper/link.html?action=random" target="_top"
>&larr;</a
>
<a href="https://tilde.club">tilde.club</a>
<a href="http://tilde.club/~harper/link.html?action=random" target="_top"
>&rarr;</a
>
</p>
<!-- 88x31 badges -->
<a href="https://tea.cuddleslut.fr"
><img src="/~tasiaiso/images/badges/tea.png" alt="fediring badge"
/></a>
<a href="https://fediring.net"
><img src="/~tasiaiso/images/badges/fediring.png" alt="fediring badge"
/></a>
<a href="https://kitsu.life"
><img src="/~tasiaiso/images/badges/kitsulife.png" alt="kitsulife badge"
/></a>
<a href="https://nixos.org"
><img src="/~tasiaiso/images/badges/nixos.png" alt="nixos badge"
/></a>
<a href="https://tilde.club"
><img src="/~tasiaiso/images/badges/tildeclub.png" alt="tilde.club badge"
/></a>
<a href="https://linux.org"
><img src="/~tasiaiso/images/badges/linux.png" alt="tilde.club badge"
/></a>
(<a href="/~tasiaiso/images/badges/credits.txt">credits</a>)
<br />
<a href="https://citrons.xyz/a/memetic-apioform-page.html"
>memetic apiopage</a
>
<br />
<hr />
This webite's source code and built webpages when shared in their entirety
are provided under the
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPL-3.0</a> license.
All blog posts, articles and Markdown files contained within the
<a href="https://gitea.com/tasiaiso/tilde">git repository</a> are shared
under the
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"
>CC BY-NC-SA 4.0</a
>
license. If you want to use my content for commercial purposes, feel free to
contact me.
<br />
<br />
This is an
<a href="https://actualwebsite.org">actual website</a>. This page is cleaner
than 0% of all web pages globally according to
<a href="https://www.websitecarbon.com/website/tilde-club-tasiaiso"
>websitecarbon.com</a
>.
<br />
Built by <a href="https://www.mkdocs.org">mkdocs</a> and served by
<a href="https://tilde.club">tilde.club</a>.
<br /><br />
<iframe
src="https://john.citrons.xyz/embed?ref=example.com"
style="
margin-left: auto;
display: block;
margin-right: auto;
max-width: 732px;
width: 100%;
height: 94px;
border: none;
"
></iframe>
<br /><br />
</body>
</html>