commit 938049d1cc0c335ef07bb992f0ccd31ceff77199 Author: Christopher P. Brown Date: Tue Mar 1 16:07:01 2022 -0700 initial commit i guess it's a pandoc blog now! diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..129dbd6 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +SRCS := $(shell find content pages -name '*.md') +HTML := $(SRCS:content/%.md=%.html) +HTML := $(HTML:pages/%.md=%.html) +vpath %.md content pages +vpath %.html dist + +%.html: %.md + pandoc -t html \ + --standalone \ + -B templates/nav.html \ + --css assets/styles/main.css \ + --toc \ + -o dist/$@ $< + +index.md: + ./bin/build-index.sh + +rssfeed: + ./bin/build-feed.sh + +build: $(HTML) index.md rssfeed + cp -R assets dist + pandoc -t html \ + --standalone \ + -H templates/header.html \ + -B templates/nav.html \ + -o dist/index.html \ + --css assets/styles/main.css \ + index.md app.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..8318d1a --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Pandoc Blog + +this is a static website that uses pandoc and pandoc templates to build a blog + +## Getting Started + +- add content to `/content`. The filename must be in `yyyy-mm-dd-file-name.md` format. This is how the blog posts are ordered, because the tool is not very smart. +- other "pages" go in `/pages` + +That's kind of it.. + +You'll need to edit a bunch of values in index.yml and build-feed.sh where it's hard coded. + +images and styles go in `/assets`. + +## Resources + +- +- diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..c692cc7 --- /dev/null +++ b/app.yaml @@ -0,0 +1,5 @@ +--- +title: welcome to my blog +subtitle: it is where i write stuff +author: dozens +--- diff --git a/assets/styles/main.css b/assets/styles/main.css new file mode 100644 index 0000000..baf479c --- /dev/null +++ b/assets/styles/main.css @@ -0,0 +1,141 @@ +* { + box-sizing: border-box; +} +html { + line-height: 1.5; + font-family: Georgia, serif; + font-size: 22px; + color: #1a1a1a; + background-color: #fdfdfd; +} +body { + margin: 0 auto; + max-width: 60ch; + padding-left: 50px; + padding-right: 50px; + padding-top: 50px; + padding-bottom: 50px; + hyphens: auto; + overflow-wrap: break-word; + text-rendering: optimizeLegibility; + font-kerning: normal; +} +@media (max-width: 600px) { + body { + font-size: 0.9em; + padding: 1em; + } +} +@media print { + body { + background-color: transparent; + color: black; + font-size: 12pt; + } + p, h2, h3 { + orphans: 3; + widows: 3; + } + h2, h3, h4 { + page-break-after: avoid; + } +} +p { + margin: 1em 0; +} +a { + color: #1a1a1a; +} +a:visited { + color: #1a1a1a; +} +img { + max-width: 100%; +} +h1, h2, h3, h4, h5, h6 { + margin-top: 1.4em; +} +h5, h6 { + font-size: 1em; + font-style: italic; +} +h6 { + font-weight: normal; +} +ol, ul { + padding-left: 1.7em; + margin-top: 1em; +} +li > ol, li > ul { + margin-top: 0; +} +blockquote { + margin: 1em 0 1em 1.7em; + padding-left: 1em; + border-left: 2px solid #e6e6e6; + color: #606060; +} +code { + font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace; + font-size: 85%; + margin: 0; +} +pre { + margin: 1em 0; + overflow: auto; +} +pre code { + padding: 0; + overflow: visible; + overflow-wrap: normal; +} +.sourceCode { + background-color: transparent; + overflow: visible; +} +hr { + background-color: #1a1a1a; + border: none; + height: 1px; + margin: 1em 0; +} +table { + margin: 1em 0; + border-collapse: collapse; + width: 100%; + overflow-x: auto; + display: block; + font-variant-numeric: lining-nums tabular-nums; +} +table caption { + margin-bottom: 0.75em; +} +tbody { + margin-top: 0.5em; + border-top: 1px solid #1a1a1a; + border-bottom: 1px solid #1a1a1a; +} +th { + border-top: 1px solid #1a1a1a; + padding: 0.25em 0.5em 0.25em 0.5em; +} +td { + padding: 0.125em 0.5em 0.25em 0.5em; +} +header { + margin-bottom: 4em; + text-align: center; +} +#TOC li { + list-style: none; +} +#TOC a:not(:hover) { + text-decoration: none; +} +code{white-space: pre-wrap;} +span.smallcaps{font-variant: small-caps;} +span.underline{text-decoration: underline;} +div.column{display: inline-block; vertical-align: top; width: 50%;} +div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} +ul.task-list{list-style: none;} +.display.math{display: block; text-align: center; margin: 0.5rem auto;} diff --git a/bin/build-feed.sh b/bin/build-feed.sh new file mode 100755 index 0000000..a30defc --- /dev/null +++ b/bin/build-feed.sh @@ -0,0 +1,19 @@ +#!/bin/zsh +title=blog +description="yrafn afuynta arr a ar" +baseurl="http://tilde.town/~dozens/gamelog" +link="$baseurl/index.html" +href="$baseurl/feed.xml" +outfile="dist/feed.xml" + +echo "$title" > $outfile +echo "$link$description" >> $outfile + +for file in $(ls -1 content/*.md | sort -r) +do + dest="${$(basename $file)/md/html}" + pandoc --template=templates/rss-feed-item.template --variable=url:"$baseurl/$dest" $file >> $outfile +done + +echo '' >> $outfile + diff --git a/bin/build-index.sh b/bin/build-index.sh new file mode 100755 index 0000000..78a3700 --- /dev/null +++ b/bin/build-index.sh @@ -0,0 +1,8 @@ +#!/bin/zsh +cat templates/index-before.html > index.md + +for file in $(ls -1 content/*.md | sort -r) +do + dest="${$(basename $file)/md/html}" + pandoc --template=templates/blog-list-item.template --variable=url:$dest $file >> index.md +done diff --git a/content/2022-01-01-hello-world.md b/content/2022-01-01-hello-world.md new file mode 100644 index 0000000..76dd52c --- /dev/null +++ b/content/2022-01-01-hello-world.md @@ -0,0 +1,9 @@ +--- +title: hello world! +subtitle: a whole new blog +date: 2022-01-01 +toc-title: Contents +--- +Hola, Wikipedia! + +I started a new blog! Isn't that just really special? diff --git a/content/2022-02-01-giraffes.md b/content/2022-02-01-giraffes.md new file mode 100644 index 0000000..86cd1f1 --- /dev/null +++ b/content/2022-02-01-giraffes.md @@ -0,0 +1,31 @@ +--- +title: giraffes +subtitle: a long necked hoax? +date: 2022-02-01 +updated: 2022-02-20 +toc-title: Contents +--- +## Intro +**Edit**: It has been brought to my attention that giraffes are actually real. I am willing to admit my mistakes, and stand corrected. You have to admit that they are *unlikely* though. + +--- + +I mean, have you ever even seen a giraffe? + +they look like aliens. + +## Too tall + +long legs + +## Too long + +all that neck, and still only 7 neckbones. same as a field mouse, same as any other mammal. what you trying to prove? + +## Black tongue + +maybe try washing that thing + +## horns? + +what you even got horns for dude? diff --git a/dist/.gitkeep b/dist/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/index.md b/index.md new file mode 100644 index 0000000..fba7d21 --- /dev/null +++ b/index.md @@ -0,0 +1,3 @@ +

These are all of my blog posts:

+- [giraffes](2022-02-01-giraffes.html): long neck hoax? --- 2022-02-20 +- [hello world!](2022-01-01-hello-world.html): a whole new blog --- 2022-01-01 diff --git a/justfile b/justfile new file mode 100644 index 0000000..91fab7b --- /dev/null +++ b/justfile @@ -0,0 +1,20 @@ +# show all recipes +default: + just --list + +# build +build: + make build + +# watch for changes +watch: + ls content/*.md | entr make build + +# upload +up: + echo "TODO" + +# clean dist +clean: + rm -rf dist/* + touch dist/.gitkeep diff --git a/pages/about.md b/pages/about.md new file mode 100644 index 0000000..4a70e64 --- /dev/null +++ b/pages/about.md @@ -0,0 +1,5 @@ +--- +title: about +subtitle: what is all this anyway +--- +honestly it's whatever you want it to be, dreamchild diff --git a/pages/contact.md b/pages/contact.md new file mode 100644 index 0000000..f9d5cdc --- /dev/null +++ b/pages/contact.md @@ -0,0 +1,6 @@ +--- +title: contact +subtitle: stay in touch! +--- +- dozens@tilde.team +- @dozens@tiny.tilde.website diff --git a/templates/blog-list-item.template b/templates/blog-list-item.template new file mode 100644 index 0000000..b2058c9 --- /dev/null +++ b/templates/blog-list-item.template @@ -0,0 +1 @@ +- [$title$]($url$): $subtitle$ --- $if(updated)$$updated$$else$$date$$endif$ diff --git a/templates/blog-post-after.html b/templates/blog-post-after.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/blog-post-before.html b/templates/blog-post-before.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..8c61c07 --- /dev/null +++ b/templates/header.html @@ -0,0 +1 @@ + diff --git a/templates/index-before.html b/templates/index-before.html new file mode 100644 index 0000000..973a690 --- /dev/null +++ b/templates/index-before.html @@ -0,0 +1 @@ +

These are all of my blog posts:

diff --git a/templates/nav.html b/templates/nav.html new file mode 100644 index 0000000..6c81c1a --- /dev/null +++ b/templates/nav.html @@ -0,0 +1,7 @@ + diff --git a/templates/rss-feed-item.template b/templates/rss-feed-item.template new file mode 100644 index 0000000..26908e6 --- /dev/null +++ b/templates/rss-feed-item.template @@ -0,0 +1,8 @@ + + $title$ + $url$ + $date$ + + $body$ + +