Add meta tags and optimize loading

columns
Tanner Collin 4 years ago
parent 975484a03c
commit 809806c8cd
  1. 2
      pelicanconf.py
  2. 8
      themes/theme/static/enable-darkmode.js
  3. 24
      themes/theme/templates/article.html
  4. 36
      themes/theme/templates/base.html
  5. 0
      themes/theme/templates/fonts.css
  6. 7
      themes/theme/templates/index.html

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Tanner'
AUTHOR = 'Tanner Collin'
SITENAME = 'Tanner Collin'
SITEURL = ''

@ -0,0 +1,8 @@
const options = {
bottom: '16px',
right: '16px',
buttonColorDark: '#666',
buttonColorLight: '#aaa',
label: '🌙',
};
new Darkmode(options).showWidget();

@ -1,5 +1,29 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - {{ article.title|striptags }}{% endblock %}
{% block head %}
{{ super() }}
{% if article.date %}
<meta name="date" content="{{article.date}}" />
{% endif %}
{% if article.summary %}
<meta name="description" content="{{article.summary|striptags}}" />
<meta name="summary" content="{{article.summary|striptags}}" />
{% endif %}
{% if article.category %}
<meta name="category" content="{{article.category}}" />
{% endif %}
{% for tag in article.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block content %}
<p><a href="/">← Return to Home</a></p>
<header>

@ -1,16 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/>
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
<meta name="author" content="{{ AUTHOR }}" />
{% endblock head %}
<style>
{% include 'style.css' %}
{% include 'fonts.css' %}
</style>
<link rel="stylesheet" type="text/css" href="/theme/fonts/fonts.css" />
<title>Tanner Collin</title>
<script defer src="/theme/darkmode-js.min.js"></script>
<script defer src="/theme/enable-darkmode.js"></script>
</script>
</head>
<body>
@ -22,9 +28,9 @@
Tanner Collin
</p>
<p class="contact-icons">
<a href="mailto:site@tannercollin.com"><img src="/theme/mail.svg" /></a>
<a href="https://t.me/tannercollin" target="_blank"><img src="/theme/telegram.svg" /></a>
<a href="https://github.com/tannercollin" target="_blank"><img src="/theme/github.svg" /></a>
<a href="mailto:site@tannercollin.com"><img alt="email icon" src="/theme/mail.svg" /></a>
<a href="https://t.me/tannercollin" target="_blank"><img alt="telegram logo" src="/theme/telegram.svg" /></a>
<a href="https://github.com/tannercollin" target="_blank"><img alt="github logo" src="/theme/github.svg" /></a>
</p>
</div>
</div>
@ -34,9 +40,9 @@
<div class="info">
Tanner Collin
<p class="contact-icons">
<a href="mailto:site@tannercollin.com"><img src="/theme/mail.svg" /></a>
<a href="https://t.me/tannercollin" target="_blank"><img src="/theme/telegram.svg" /></a>
<a href="https://github.com/tannercollin" target="_blank"><img src="/theme/github.svg" /></a>
<a href="mailto:site@tannercollin.com"><img alt="email icon" src="/theme/mail.svg" /></a>
<a href="https://t.me/tannercollin" target="_blank"><img alt="telegram logo" src="/theme/telegram.svg" /></a>
<a href="https://github.com/tannercollin" target="_blank"><img alt="github logo" src="/theme/github.svg" /></a>
</p>
</div>
</div>
@ -44,18 +50,6 @@
{% endblock %}
</div>
</div>
<script src="/theme/darkmode-js.min.js"></script>
<script>
const options = {
bottom: '16px',
right: '16px',
buttonColorDark: '#666',
buttonColorLight: '#aaa',
label: '🌙',
};
new Darkmode(options).showWidget();
</script>
</body>
</html>

@ -1,5 +1,12 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
<meta name="description" content="The personal website of Tanner Collin." />
<meta name="summary" content="The personal website of Tanner Collin." />
{% endblock %}
{% block content %}
<p>
Hi, I'm Tanner! I do firmware and web development in Calgary.

Loading…
Cancel
Save