Format the about page correctly

This commit is contained in:
Sami Samhuri 2019-12-01 22:22:21 -08:00
parent acad65d1a5
commit b2ca0ab0fd
4 changed files with 18 additions and 3 deletions

View file

@ -24,6 +24,10 @@ struct TemplateContext {
var template: String {
page.template ?? site.template
}
var currentYear: Int {
Calendar.current.dateComponents([.year], from: Date()).year!
}
}
// MARK: - Dictionary form
@ -38,6 +42,7 @@ extension TemplateContext {
"body": body,
"styles": site.styles + page.styles,
"scripts": site.scripts + page.scripts,
"currentYear": currentYear,
]
}
}

View file

@ -1,5 +1,6 @@
---
Title: About me
Template: article
---
I'm Sami Samhuri, a software developer and general technology geek. Sometimes
@ -97,7 +98,6 @@ compiled with [harp][] before [Apache][] serves it up. The header and body font,
[Museo]: http://www.exljbris.com/museosans.html
[TypeKit]: https://typekit.com/fonts
Oh, and a shout out to [Font Awesome][fa] for being awesome.
<i class="fa fa-thumbs-up" style="color: #ccc"></i>
Oh, and a shout out to [Font Awesome][fa] for being awesome. <i class="fa fa-thumbs-up" style="color: #ccc"></i>
[fa]: http://fontawesome.io

10
templates/article.html Normal file
View file

@ -0,0 +1,10 @@
{% extends "samhuri.net.html" %}
{% block body %}
<article class="container">
<h2>{{ page.title }}</h2>
{{ body }}
</article>
<div class="row clearfix">
<p class="fin"><i class="fa fa-code"></i></p>
</div>
{% endblock %}

View file

@ -73,7 +73,7 @@
<div class="clearfix"></div>
</header>
{% block body %}footage not found{% endblock %}
{% block body %}{{ body }}{% endblock %}
<footer class="container">
&copy; 2006 - {{ currentYear }} <a href="/about">{{ site.author }}</a>