mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-12-22 19:02:18 +00:00
display random taglines on each page load
This commit is contained in:
parent
288998aac3
commit
fc359e9cdd
3 changed files with 45 additions and 1 deletions
|
@ -10,8 +10,24 @@ palette = "runtimeterror"
|
|||
# Sidebar: about/bio
|
||||
[about]
|
||||
title = "runtimeterror"
|
||||
description = "Better living through less-bad code."
|
||||
logo = "images/broken-computer.svg"
|
||||
taglines = [
|
||||
"better living through less shitty code",
|
||||
"bugs are like onions, they have layers",
|
||||
"bugs, uh, find a way",
|
||||
"creating new and exciting bugs",
|
||||
"houston, we have a bug",
|
||||
"i ain't afraid of no code",
|
||||
"i see null pointers",
|
||||
"i'm not a real programmer",
|
||||
"keep your friends close, but your breakpoints closer",
|
||||
"may the code be with you",
|
||||
"ship things and breakfast",
|
||||
"there's no place like localhost",
|
||||
"tonight we test in prod",
|
||||
"why did it have to be bugs",
|
||||
"you can't handle the exception",
|
||||
]
|
||||
|
||||
# Sidebar: social links
|
||||
# Available icon sets:
|
||||
|
|
15
layouts/partials/about.html
Normal file
15
layouts/partials/about.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ with .Site.Params.about }}
|
||||
<div class="aside__about">
|
||||
{{ with .logo }}<img class="about__logo" src="{{ . | absURL }}" alt="Logo">{{ end }}
|
||||
<h1 class="about__title">{{ .title }}</h1>
|
||||
{{ partial "tagline.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<ul class="aside__social-links">
|
||||
{{ range $item := .Site.Params.socialLinks }}
|
||||
<li>
|
||||
<a href="{{ $item.url }}" rel="me" aria-label="{{ $item.title }}" title="{{ $item.title }}"><i class="{{ $item.icon }}" aria-hidden="true"></i></a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
13
layouts/partials/tagline.html
Normal file
13
layouts/partials/tagline.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{ with . }}
|
||||
<meta name="taglines" content="{{ .taglines | jsonify }}" />
|
||||
{{ end }}
|
||||
<script language="Javascript" type="text/javascript">
|
||||
var taglines = JSON.parse(document.getElementsByTagName("meta")["taglines"].content);
|
||||
function getTagline() {
|
||||
var randIndex = Math.floor(Math.random() * taglines.length);
|
||||
document.getElementById("tagline").innerHTML = taglines[randIndex];
|
||||
}
|
||||
console.log(taglines)
|
||||
window.addEventListener("pageshow", getTagline);
|
||||
</script>
|
||||
<div id="tagline"></div>
|
Loading…
Reference in a new issue