Skip to content

Instantly share code, notes, and snippets.

@JKirchartz
Last active August 22, 2018 03:49
Show Gist options
  • Save JKirchartz/51837825945a6d1509d3f11b487a3b09 to your computer and use it in GitHub Desktop.
Save JKirchartz/51837825945a6d1509d3f11b487a3b09 to your computer and use it in GitHub Desktop.
A simple publishing platform for tilde.town ~ clone this into a "drafts" or "src" directory in your home directory, write markdown files here, and run `make` to publish them to your tilde site.
<!DOCTYPE html>
<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
$for(author-meta)$
<meta name="author" content="$author-meta$">
$endfor$
$if(date-meta)$
<meta name="dcterms.date" content="$date-meta$">
$endif$
$if(keywords)$
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$">
$endif$
<title>kirch ~ $title$</title>
<link rel="stylesheet" href="style.css">
$if(quotes)$
<style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>
$endif$
$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$endif$
$for(css)$
<link rel="stylesheet" href="$css$">
$endfor$
$if(math)$
$math$
$endif$
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
$if(title)$
<header>
<h1 class="title">$title$</h1>
$if(subtitle)$
<h1 class="subtitle">$subtitle$</h1>
$endif$
$for(author)$
<h2 class="author">$author$</h2>
$endfor$
$if(date)$
<h3 class="date">$date$</h3>
$endif$
</header>
$endif$
$if(toc)$
<nav id="$idprefix$TOC">
$toc$
</nav>
$endif$
$body$
$for(include-after)$
$include-after$
$endfor$
</body>
</html>
SHELL = /bin/bash
sources := $(wildcard *.md)
objects := $(patsubst %.md,%.html,$(subst $(source),$(output),$(sources)))
all: $(objects)
%.html: %.md
pandoc --template layout.html5 --standalone --smart --to html5 -o $@ $<
mv *.html ../public_html/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment