M .build.yml => .build.yml +3 -2
@@ 2,13 2,14 @@ image: alpine/latest
oauth: pages.sr.ht/PAGES:RW
packages:
- hut
- - hugo
+ - zola
environment:
site: truita.es
tasks:
- build: |
cd $site
- hugo
+ zola build
+ rm public/404.html
- package: |
cd $site
tar -C public -cvz . > ../site.tar.gz
M config.toml => config.toml +8 -7
@@ 1,7 1,8 @@
-baseURL = 'https://truita.es/'
-title = 'truita.es'
-rssLimit = 10
-disableKinds = ["taxonomy"]
-
-[outputs]
-home = ["HTML"]
+base_url = "https://truita.es"
+title = "truita.es"
+compile_sass = false
+[markdown]
+# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
+highlight_code = true
+[extra]
+# Put all your custom variables here
M content/_index.md => content/_index.md +3 -0
@@ 1,3 1,6 @@
+---
+title: truita.es
+---
Hi! I'm Josep Mengual. I write pretty dumb programs from time to time.
You can contact me at [josep@truita.es](mailto:josep@truita.es).
A content/blog/_index.md => content/blog/_index.md +6 -0
@@ 0,0 1,6 @@
++++
+title = "Blog"
+sort_by = "date"
+template = "blog/section.html"
+page_template = "blog/page.html"
++++
A content/projects/_index.md => content/projects/_index.md +4 -0
@@ 0,0 1,4 @@
+---
+title: Projects
+template: projects.html
+---
D layouts/_default/single.html => layouts/_default/single.html +0 -8
@@ 1,8 0,0 @@
-{{ partial "header.html" . }}
-
-<body>
-
-{{ partial "nav.html" . }}
-{{ .Content }}
-</body>
-</html>
D layouts/blog/section.html => layouts/blog/section.html +0 -10
@@ 1,10 0,0 @@
-{{ partial "header.html" . }}
-
-<body>
-
-{{ partial "nav.html" . -}}
-{{ range (where .Site.RegularPages "Section" "blog") }}
- <p>{{.Date.Format "January 2, 2006"}}<br><a href="{{.RelPermalink}}">{{.Title}}</a></p>
- {{ end }}
-</body>
-</html>
D layouts/index.html => layouts/index.html +0 -1
@@ 1,1 0,0 @@
-_default/single.html>
\ No newline at end of file
D => +0 -1
D => +0 -12
@@ 1,12 0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href ="/style.css">
{{- if eq .Page.RelPermalink "/projects/" }}
<link rel="stylesheet" href ="/projects.css">
{{- end }}
<link rel="icon" type="image/png" href="/bubbles.png">
<title>{{ with .Params.title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}</title>
</head>
D layouts/partials/nav.html => layouts/partials/nav.html +0 -4
@@ 1,4 0,0 @@
- <header>
- <h1>{{ if ne .Page.RelPermalink "/" }}<a href="/">{{ end }}truita.es{{ if ne .Page.RelPermalink "/" }}</a>{{ end }}</h1>
- <nav>{{ if ne .Page.RelPermalink "/projects/" }}<a href="/projects">{{ end }}Projects{{ if ne .Page.RelPermalink "/projects/" }}</a>{{ end }} — {{ if ne .Page.RelPermalink "/blog/" }}<a href="/blog">{{ end }}Blog{{ if ne .Page.RelPermalink "/blog/" }}</a>{{ end }}</nav>
- </header>
A templates/base.html => templates/base.html +24 -0
@@ 0,0 1,24 @@
+<!doctype html>
+{% if page %}
+{% set section = page %}
+{% endif %}
+<html lang="en">
+ <head>
+ {% block head %}
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <link rel="stylesheet" href="/style.css" />
+ <title>{% block title %}{{ config.title }}{% endblock title %}</title>
+ <link rel="icon" type="image/png" href="/bubbles.png" />
+ {% endblock head %}
+ </head>
+ <body>
+ <header>
+ <h1>{% if section.path != "/" %}<a href="/">{% endif %}{{ config.title }}{% if section.path != "/" %}</a>{% endif %}</h1>
+ <nav>
+ {% if section.path != "/projects/" %}<a href="/projects">{% endif %}Projects{% if section.path != "/projects" %}</a>{% endif %} —
+ {% if section.path != "/blog/" %}<a href="/blog">{% endif %}Blog{% if section.path != "/blog/" %}</a>{% endif %}
+ </nav>
+ </header>
+ {% block content %}{% endblock content %}
+ </body>
+</html>
R layouts/blog/single.html => templates/blog/page.html +15 -18
@@ 1,18 1,15 @@
-{{ partial "header.html" . }}
-
-<body>
- <main>
- <h1>{{ $.Title }}</h1>
- <small>{{ .Date.Format "January 2, 2006" }} on <a href="/">{{ .Site.Title }}</a></small>
-
-{{ .Content }}
- </main>
-
- <footer>
- <small>
- This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA-4.0 license</a>.
- </small>
- </footer>
-
-</body>
-</html>
+{% extends "base.html" %}
+{% block content %}
+<main>
+ <h1>{{ page.title }}</h1>
+ <small>{{ page.date | date(format="%d %B, %Y") }}</small>
+
+ {{ page.content | safe }}
+</main>
+
+<footer>
+ <small>
+ This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA-4.0 license</a>.
+ </small>
+</footer>
+{% endblock %}
A templates/blog/section.html => templates/blog/section.html +8 -0
@@ 0,0 1,8 @@
+{% extends "section.html" %}
+
+{% block content %}
+ {% for page in section.pages %}
+ <p>{{ page.date | date(format="%d %B, %Y") }}<br><a href="{{ page.permalink }}">{{ page.title }}</a></p>
+ {% endfor %}
+</ul>
+{% endblock content %}
A templates/index.html => templates/index.html +3 -0
@@ 0,0 1,3 @@
+{% extends "base.html" %}
+{% block title %}{{ section.title }}{% endblock title %}
+{% block content %}{{ section.content | safe }}{% endblock content %}
R content/projects.html => templates/projects.html +7 -3
@@ 1,6 1,9 @@
----
-title: Projects
----
+{% extends "section.html" %}
+{% block head %}
+{{ super() }}
+<link rel="stylesheet" href="projects.css" />
+{% endblock head %}
+{% block content %}
<div class="projects">
<div class="wip">
<h2><a href="https://sr.ht/~truita/deessa">Deessa (WIP)</a></h2>
@@ 15,3 18,4 @@ title: Projects
<p>A simple MPU9250 library in the ESP-IDF framework</p>
</div>
</div>
+{% endblock content %}
A templates/section.html => templates/section.html +3 -0
@@ 0,0 1,3 @@
+{% extends "base.html" %}
+{% block title %}{{ section.title }}{% endblock title %}
+{% block content %}{{ section.content | safe }}{% endblock content %}