all repos — homestead @ ef74eb1fac8d50814d84c99ce7f6b01ab0d714b2

Code for my website

Initial commit

Alan Pearce
commit

ef74eb1fac8d50814d84c99ce7f6b01ab0d714b2

A .envrc
@@ -0,0 +1,1 @@
+use flake
A flake.lock
@@ -0,0 +1,61 @@
+{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1681693905, + "narHash": "sha256-XdXMvCt+i2ZcmAIPZvu3RUwcdaC9OX7d1WMAJJokzeA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "db34d7561caa508ece0265a56f382c5d3b7a6c1b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +}
A flake.nix
@@ -0,0 +1,20 @@
+{ + description = "A bear blog theme for Zola"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + git + gnugrep + zola + ]; + }; + }); +}
A templates/404.html
@@ -0,0 +1,8 @@
+{% extends "base.html" %} + +{% block title %}404{% endblock %} + +{% block main %} +<h1>404</h1> +<h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2> +{% endblock %}
A templates/base.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html> +<html lang="{{ lang or "en-US" }}"> + +<head> + <meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" /> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + {%- include "favicon.html" ignore missing -%} + <title>{%- block title %}{{ config.title }}{%- endblock %}</title> + + {%- include "seo_tags.html" ignore missing -%} + <meta name="referrer" content="no-referrer-when-downgrade" /> + + {%- if config.generate_feed %} + {%- block rss -%} + <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}"> + {% endblock -%} + {%- endif %} + + {%- include "style.html" ignore missing -%} + + {%- include "custom_head.html" ignore missing -%} +</head> + +<body> + <header> + {%- include "header.html" ignore missing -%} + </header> + <main> + {%- block main %}{%- endblock %} + </main> + <footer> + {%- include "footer.html" ignore missing -%} + </footer> + + {%- include "custom_body.html" ignore missing -%} +</body> + +</html>
A templates/favicon.html
@@ -0,0 +1,3 @@
+{% if config.extra.favicon %} + <link rel="shortcut icon" href="{{ config.extra.favicon }}" /> +{%- endif %}
A templates/footer.html
@@ -0,0 +1,3 @@
+{% if not config.extra.hide_made_with_line %} +Made with <a href="https://codeberg.org/alanpearce/zola-bearblog">Zola ʕ•ᴥ•ʔ Bear</a> +{% endif %}
A templates/header.html
@@ -0,0 +1,4 @@
+<a href="{{ config.base_url }}" class="title"> + <h2>{{ config.title }}</h2> +</a> +<nav>{% include "nav.html" %}</nav>
A templates/index.html
@@ -0,0 +1,7 @@
+{% extends "base.html" %} + +{% block main %} +<content> + {{ section.content | safe }} +</content> +{% endblock %}
A templates/nav.html
@@ -0,0 +1,6 @@
+<a href="{{ config.base_url }}">Home</a> +{%- if config.extra.main_menu %} +{%- for item in config.extra.main_menu %} +<a href="{{ get_url(path=item.url )}}">{{ item.name }}</a> +{%- endfor %} +{%- endif %}
A templates/page.html
@@ -0,0 +1,33 @@
+{% extends "base.html" %} + +{% block title %} +{{ page.title }} | {{ super() }} +{% endblock %} + +{% block main %} +{%- if not page.extra.menu %} +<h1>{{ page.title }}</h1> +{%- if page.date %} +<p> + <i> + <time datetime='{{ page.date | date(format='%+') }}' pubdate> + {{ page.date | date(format="%d %b, %Y") }} + </time> + </i> +</p> +{%- endif %} +{%- endif %} +<content> + {{ page.content | safe }} +</content> +<p> + {%- if page.taxonomies %} + {%- for name, taxon in page.taxonomies %} + {{ name | capitalize }}: + {%- for item in taxon %} + <a href="{{ get_taxonomy_url(kind=name, name=item) }}">#{{ item }}</a> + {%- endfor %} + {%- endfor %} + {%- endif %} +</p> +{% endblock %}
A templates/section.html
@@ -0,0 +1,38 @@
+{% extends "base.html" %} + +{% block main %} +<content> + {%- if taxonomy.term %} + <h3 style="margin-bottom:0">Filtering for "{{ section.title }}"</h3> + <small> + <a href="{{ get_url(path="@/blog/_index.md") }}">Remove filter</a> + </small> + {%- endif %} + <ul class="blog-posts"> + {% for page in section.pages | reverse %} + <li> + <span> + <i> + <time datetime='{{ page.date | date(format='%+') }}' pubdate> + {{ page.date | date(format="%d %b, %Y") }} + </time> + </i> + </span> + <a href="{{ page.permalink }}">{{ page.title }}</a> + </li> + {% else %} + <li> + No posts yet + </li> + {% endfor %} + </ul> + <small> + <div> + {% set tags = get_taxonomy(kind="tags") %} + {% for post in tags.items %} + <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp; + {% endfor %} + </div> + </small> +</content> +{% endblock %}
A templates/seo_tags.html
@@ -0,0 +1,1 @@
+<meta name="title" content="{% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %}" />
A templates/style.html
@@ -0,0 +1,173 @@
+<style> + body { + font-family: Verdana, sans-serif; + margin: auto; + padding: 20px; + max-width: 720px; + text-align: left; + background-color: #fff; + word-wrap: break-word; + overflow-wrap: break-word; + line-height: 1.5; + color: #444; + } + + h1, + h2, + h3, + h4, + h5, + h6, + strong, + b { + color: #222; + } + + a { + color: #3273dc; + /*color: #ff5e6c;*/ + } + + .title { + text-decoration: none; + border: 0; + } + + .title span { + font-weight: 400; + } + + nav a { + margin-right: 10px; + } + + textarea { + width: 100%; + font-size: 16px; + } + + input { + font-size: 16px; + } + + content { + line-height: 1.6; + } + + table { + width: 100%; + } + + img { + max-width: 100%; + } + + code { + padding: 2px 5px; + background-color: #f2f2f2; + } + + pre code { + color: #222; + display: block; + padding: 20px; + white-space: pre-wrap; + font-size: 14px; + overflow-x: auto; + } + + div.highlight pre { + background-color: initial; + color: initial; + } + + div.highlight code { + background-color: unset; + color: unset; + } + + blockquote { + border-left: 1px solid #999; + color: #222; + padding-left: 20px; + font-style: italic; + } + + footer { + padding: 25px; + text-align: center; + } + + .helptext { + color: #777; + font-size: small; + } + + .errorlist { + color: #eba613; + font-size: small; + } + + /* blog posts */ + ul.blog-posts { + list-style-type: none; + padding: unset; + } + + ul.blog-posts li { + display: flex; + } + + ul.blog-posts li span { + flex: 0 0 130px; + } + + ul.blog-posts li a:visited { + color: #8b6fcb; + } + + @media (prefers-color-scheme: dark) { + body { + background-color: #333; + color: #ddd; + } + + h1, + h2, + h3, + h4, + h5, + h6, + strong, + b { + color: #eee; + } + + a { + color: #8cc2dd; + } + + code { + background-color: #777; + } + + pre code { + color: #ddd; + } + + blockquote { + color: #ccc; + } + + textarea, + input { + background-color: #252525; + color: #ddd; + } + + .helptext { + color: #aaa; + } + } + +</style>
A templates/taxonomy_list.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %} + +{% block main %} +<content> + <small> + <div> + {% set tags = get_taxonomy(kind="tags") %} + {% for post in tags.items %} + <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp; + {% endfor %} + </div> + </small> +</content> +{% endblock %}
A templates/taxonomy_single.html
@@ -0,0 +1,30 @@
+{% extends "base.html" %} + +{% block main %} +<content> + {%- if taxonomy.term %} + <h3 style="margin-bottom:0">Filtering for "{{ term.name }}"</h3> + <small> + <a href="{{ get_url(path="@/blog/_index.md") }}">Remove filter</a> + </small> + {%- endif %} + <ul class="blog-posts"> + {% for page in term.pages | reverse %} + <li> + <span> + <i> + <time datetime='{{ page.date | date(format='%+') }}' pubdate> + {{ page.date | date(format="%d %b, %Y") }} + </time> + </i> + </span> + <a href="{{ page.permalink }}">{{ page.title }}</a> + </li> + {% else %} + <li> + No posts yet + </li> + {% endfor %} + </ul> +</content> +{% endblock %}
A theme.toml
@@ -0,0 +1,23 @@
+name = "Bear" +description = "Bear blog theme" +license = "MIT" +homepage = "https://github.com/getzola/hyde" +# The minimum version of Zola required +min_version = "0.4.0" +# An optional live demo URL +demo = "" + +# Any variable there can be overridden in the end user `config.toml` +# You don't need to prefix variables by the theme name but as this will +# be merged with user data, some kind of prefix or nesting is preferable +# Use snake_casing to be consistent with the rest of Zola +[extra] + +[author] +name = "Alan Pearce" +homepage = "https://alanpearce.eu" + +[original] +author = "janraasch" +repo = "https://github.com/janraasch/hugo-bearblog/" +homepage = "https://www.janraasch.com"