aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanguy Andreani <tanguy.andreani@tuta.io>2021-05-14 02:14:08 +0200
committerTanguy Andreani <tanguy.andreani@tuta.io>2021-05-14 02:14:08 +0200
commitde9aac4b9648322782f83e9f5b6234f66b7b4cc3 (patch)
tree9a5ec0de284f5e2b497007f96d157aba2ccdfa85
downloadpandoc-blog-de9aac4b9648322782f83e9f5b6234f66b7b4cc3.tar.gz
first commit
-rw-r--r--2021-05-20-first-post.markdown24
-rwxr-xr-xbuild.sh22
-rw-r--r--footer.html1
-rw-r--r--header-index.html1
-rw-r--r--header.html3
-rwxr-xr-xindex.sh9
-rwxr-xr-xnewpost.sh12
-rw-r--r--pandoc.css37
-rw-r--r--typesafe.css1
9 files changed, 110 insertions, 0 deletions
diff --git a/2021-05-20-first-post.markdown b/2021-05-20-first-post.markdown
new file mode 100644
index 0000000..8d2bf09
--- /dev/null
+++ b/2021-05-20-first-post.markdown
@@ -0,0 +1,24 @@
+# First post
+
+<div class="dates">
+Date of first word: *2021-05-13*
+
+Date of publishing: *2021-05-13*
+</div>
+
+Welcome to this first entry!
+
+## Here is a title
+
+It will appear in the table of contents!
+
+## Some code!
+
+```css
+body
+{
+ background-image: url("/bg.png");
+}
+```
+
+&lt;3
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..e2d50ca
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+for f in $(find . -name '*.markdown' -type f); do
+ if [ ${f} != "./index.markdown" ]; then
+ toc="--toc"
+ header="-H header.html"
+ headline=$(head -1 $f | sed 's/^# //')
+ else
+ header="-H header-index.html"
+ headline="Index"
+ fi
+ echo "Processing ${f}"
+ pandoc \
+ -s \
+ ${toc} \
+ -c typesafe.css \
+ -c pandoc.css \
+ -A footer.html \
+ ${header} \
+ --metadata pagetitle="$headline - lmbdfn's music blog" \
+ "${f}" -o "${f/.markdown/.html}"
+done
diff --git a/footer.html b/footer.html
new file mode 100644
index 0000000..a864604
--- /dev/null
+++ b/footer.html
@@ -0,0 +1 @@
+<p><i>This is a website where I write about stuff I do.</i></p>
diff --git a/header-index.html b/header-index.html
new file mode 100644
index 0000000..1eb201e
--- /dev/null
+++ b/header-index.html
@@ -0,0 +1 @@
+<h1>My simple blog</h1>
diff --git a/header.html b/header.html
new file mode 100644
index 0000000..a0eff96
--- /dev/null
+++ b/header.html
@@ -0,0 +1,3 @@
+<p><a href="./index.html">Index</a> | <a href="#">Other link</a></p>
+
+<h3>Table of contents</h3>
diff --git a/index.sh b/index.sh
new file mode 100755
index 0000000..07e5d84
--- /dev/null
+++ b/index.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+rm -f index.markdown
+sorted=$(ls *.markdown)
+for f in ${sorted}; do
+ headline=$(head -1 $f | sed 's/^# //')
+ echo "- [${f:0:10} ${headline}](${f/.markdown/.html})" >> index.markdown
+done
+bash ./build.sh
diff --git a/newpost.sh b/newpost.sh
new file mode 100755
index 0000000..66cc846
--- /dev/null
+++ b/newpost.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -e
+today=$(date +'%Y-%m-%d')
+cat > ${today}-${1}.markdown <<EOFF
+# What I practiced this week
+
+<div class="dates">
+Date of first word: $today
+
+Date of publishing: FILLME
+</div>
+EOFF
diff --git a/pandoc.css b/pandoc.css
new file mode 100644
index 0000000..7566f6c
--- /dev/null
+++ b/pandoc.css
@@ -0,0 +1,37 @@
+body
+{
+ background: #fefefe;
+ color: #444;
+}
+
+a, a:visited, a:hover
+{
+ color: rgb(255, 0, 119);
+}
+
+html
+{
+ border-top: 4px solid #666;
+}
+
+body
+{
+ margin: 0;
+}
+
+body > *:first-child
+{
+ margin-top: 0;
+}
+
+.dates
+{
+ display: inline-block;
+ background: #eee;
+ padding: 1rem;
+}
+
+.dates > *
+{
+ margin: 0;
+}
diff --git a/typesafe.css b/typesafe.css
new file mode 100644
index 0000000..2842168
--- /dev/null
+++ b/typesafe.css
@@ -0,0 +1 @@
+*{box-sizing:border-box;}body{font:16px/1.5 "Georgia",serif;margin:0 auto;max-width:66ch;padding:1rem;}h1,h2,h3,h4,h5,h6{font-family:"Helvetica Neue","Helvetica","Arial",sans-serif;margin:2.5rem 0 1rem;}ul li, ol li{margin-top:0.5rem;}a,a:visited{color:black;}a:hover{color:dodgerblue;}img{height:auto;max-width:100%;}pre{border: 1px solid lightgrey;overflow:auto;}code{color:orangered;display:inline-block;}pre code{padding:1rem;}blockquote{border-left:5px solid lightgrey;font-size:120%;font-style:italic;margin:2rem 0;padding:1rem;}table{border-collapse:collapse;margin:2rem 0;text-align:left;width:100%;}tr{border-bottom:1px solid lightgrey;}th,td{padding:0.5rem;}hr{background:lightgrey;border:0;height:1px;margin:2rem 0;} \ No newline at end of file