From 809806c8cd18969a77cb5e1b1884aeb73da66334 Mon Sep 17 00:00:00 2001
From: Tanner Collin
Date: Fri, 4 Sep 2020 00:40:33 +0000
Subject: [PATCH] Add meta tags and optimize loading
---
pelicanconf.py | 2 +-
themes/theme/static/enable-darkmode.js | 8 +++++
themes/theme/templates/article.html | 24 +++++++++++++
themes/theme/templates/base.html | 36 ++++++++-----------
.../{static/fonts => templates}/fonts.css | 0
themes/theme/templates/index.html | 7 ++++
6 files changed, 55 insertions(+), 22 deletions(-)
create mode 100644 themes/theme/static/enable-darkmode.js
rename themes/theme/{static/fonts => templates}/fonts.css (100%)
diff --git a/pelicanconf.py b/pelicanconf.py
index 340230a..f891e14 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
-AUTHOR = 'Tanner'
+AUTHOR = 'Tanner Collin'
SITENAME = 'Tanner Collin'
SITEURL = ''
diff --git a/themes/theme/static/enable-darkmode.js b/themes/theme/static/enable-darkmode.js
new file mode 100644
index 0000000..0757490
--- /dev/null
+++ b/themes/theme/static/enable-darkmode.js
@@ -0,0 +1,8 @@
+const options = {
+ bottom: '16px',
+ right: '16px',
+ buttonColorDark: '#666',
+ buttonColorLight: '#aaa',
+ label: '🌙',
+};
+new Darkmode(options).showWidget();
diff --git a/themes/theme/templates/article.html b/themes/theme/templates/article.html
index 60cf311..b96822e 100644
--- a/themes/theme/templates/article.html
+++ b/themes/theme/templates/article.html
@@ -1,5 +1,29 @@
{% extends "base.html" %}
+{% block title %}{{ SITENAME }} - {{ article.title|striptags }}{% endblock %}
+
+{% block head %}
+ {{ super() }}
+
+ {% if article.date %}
+
+ {% endif %}
+
+ {% if article.summary %}
+
+
+ {% endif %}
+
+ {% if article.category %}
+
+ {% endif %}
+
+ {% for tag in article.tags %}
+
+ {% endfor %}
+
+{% endblock %}
+
{% block content %}
← Return to Home
diff --git a/themes/theme/templates/base.html b/themes/theme/templates/base.html
index 54b7070..ecbdf69 100644
--- a/themes/theme/templates/base.html
+++ b/themes/theme/templates/base.html
@@ -1,16 +1,22 @@
+ {% block head %}
+ {% block title %}{{ SITENAME }}{% endblock title %}
+
+ {% endblock head %}
+
-
-
- Tanner Collin
+
+
+
@@ -22,9 +28,9 @@
Tanner Collin
-
-
-
+
+
+
@@ -34,9 +40,9 @@
@@ -44,18 +50,6 @@
{% endblock %}
-
-
-
diff --git a/themes/theme/static/fonts/fonts.css b/themes/theme/templates/fonts.css
similarity index 100%
rename from themes/theme/static/fonts/fonts.css
rename to themes/theme/templates/fonts.css
diff --git a/themes/theme/templates/index.html b/themes/theme/templates/index.html
index b7aa815..d268814 100644
--- a/themes/theme/templates/index.html
+++ b/themes/theme/templates/index.html
@@ -1,5 +1,12 @@
{% extends "base.html" %}
+{% block head %}
+ {{ super() }}
+
+
+
+{% endblock %}
+
{% block content %}
Hi, I'm Tanner! I do firmware and web development in Calgary.