commit 30c8a3e0246fe2136682fcb9aa038ad383e800f1
parent 72030737cd1af22258cbb67ea7c1b5db19181262
Author: pyratebeard <root@pyratebeard.net>
Date: Wed, 13 Jan 2021 21:21:32 +0000
blog files
index and post page template. custom css. pandoc script
Diffstat:
4 files changed, 134 insertions(+), 0 deletions(-)
diff --git a/index.html b/index.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <link href="./style.css" rel="stylesheet">
+ <title>pyratelog</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
+<body>
+<h3 class="index">tales from a beard in the information age</h3>
+<ul>
+</ul>
+</body>
+</html>
+
diff --git a/post_template.html b/post_template.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <link href="../style.css" rel="stylesheet">
+ <title>pyratelog - $title$</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
+<body>
+<h3 class="index">tales from a beard in the information age</h3>
+$body$
+<a href="/">back</a>
+</body>
+</html>
+
diff --git a/pyratelog.sh b/pyratelog.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+function initialise() {
+ cd /blog
+ input=$(find content/ -type f -name "*.md" | cut -f2 -d '/' | cut -f1 -d '.')
+ input_date=$(echo ${input} | cut -f1 -d '-' | date +%Y\ %m\ %d)
+ input_title=$(echo ${input} | cut -f2 -d '-' | sed 's/_/\ /g')
+ input_link="<li><a class="index" href='content/${input}.html'>${input_date} - ${input_title}</a></li>"
+
+ grep ${input} index.html >/dev/null && return
+
+ pandoc -s \
+ --template=./post_template.html \
+ --metadata title="${input_title}" \
+ -f markdown \
+ -t html \
+ -o content/${input}.html \
+ content/${input}.md
+
+ sed "/<ul>/a ${input_link}" index.html > index.html.bak
+
+ cat index.html.bak >index.html
+
+ rm -f content/${input}.md index.html.bak
+}
+
+while : ; do
+ [ -f /blog/content/*.md ] && initialise || sleep 30
+done
diff --git a/style.css b/style.css
@@ -0,0 +1,77 @@
+body {
+ font-family: monospace;
+ background-color: #171717;
+ color: #bbbbbb;
+}
+
+h1, h2, h3, h4, h5 {
+ color: #956c74;
+ text-transform: uppercase;
+ font-weight: normal;
+}
+
+h3.index {
+ color: #753747;
+}
+
+a {
+ color: #71bb94;
+ text-decoration: none;
+}
+
+a:active,a:hover,a:focus {
+ color: #55776e;
+ text-decoration: none;
+}
+
+a.index {
+ color: #956c74;
+}
+
+a.index:active,
+a.index:hover,
+a.index:focus {
+ color: #71bb94;
+}
+
+ul {
+ list-style: '- ';
+}
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+table tr th {
+ text-transform: uppercase;
+}
+
+table tr th,
+table tr td {
+ border: 1px solid #3d3a3b;
+ margin: 0;
+ padding: 4px 10px;
+}
+
+strong {
+ color: #deb14f;
+ font-weight: normal;
+}
+
+pre > code {
+ color: #d2d074;
+ background-color: #131313;
+ padding: 7.5px;
+ border: 1px solid #3d3a3b;
+ border-radius: 2px;
+ display: table
+}
+
+code {
+ color: #baba9e;
+ background-color: #454545;
+ font-size: 14px;
+ padding: 0px 4px 0px 4px;
+ border-radius: 2px;
+}