commit 5a5784a53b4544597855a78a9321a52e508aff90
parent c85d220ed80b3b35c5f64af98cfbc56c038e06aa
Author: parazyd <parazyd@dyne.org>
Date: Mon, 4 Jul 2016 09:59:36 +0200
handle page titles in markdown easier
Diffstat:
3 files changed, 4 insertions(+), 54 deletions(-)
diff --git a/example/markdown/index.html b/example/markdown/index.html
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta name="description" content="Who is parazyd, software developer, designer, crypto, bitcoin, linux administrator">
- <title>This is da real title</title>
- <link rel="stylesheet" type="text/css" href="../style.css">
-</head>
- <div id="header">
- <a href="/"><img alt="logo" src="../logo.svg"></a>
- <a id="headerLink" href="/">parazyd.cf</a> <span id="headerSubtitle">something something</span>
- </div>
-
- <div id="menu">
- <span class="left">
- <a class="thisSite" href="https://parazyd.cf">home</a>
- <a href="https://moo.parazyd.cf">moo</a>
- <a href="https://pub.parazyd.cf">pub</a>
- </span>
- </div>
-
- <div id="content">
- <div id="nav">
-
- <ul>
- <li><a href="/">main</a></li>
- <li><a href="https://git.parazyd.cf">code/</a></li>
- <li><a href="/blog/">blog/</a></li>
- <li><a href="/blog/musings/"> musings/</a></li>
- <li><a href="/projects/">projects/</a></li>
- <li><a href="/contact.html">contact</a></li>
- <li><a href="https://www.dyne.org">../dyne.org</a></li>
- </ul>
-
- </div>
-
- <div id="main">
-<h1>And this will be teh header</h1>
-<p>and more st00f</p> </div>
-
- </div>
-
- <div id="footer">
- <span class="right">
- copyleft 2016 parazyd, design heavily inspired by <a href="http://suckless.org">suckless.org</a> ♥
- </span>
- </div>
-</body>
-</html>
diff --git a/example/markdown/index.md b/example/markdown/index.md
@@ -1,5 +1,5 @@
-##+ This is da real title
+##+TITLE This is our title
-# And this will be teh header
+# And this is our page content
-and more st00f
+:)
diff --git a/mars.sh b/mars.sh
@@ -91,7 +91,7 @@ process-page() {
done }
local pagetitle=`grep '^##+TITLE ' $page | cut -c 10- -`
- sed -i -e 's/DEFAULT_TITLE/'$pagetitle'/' $name.html
+ sed -i -e 's/<title>.*<\/title>/<title>'$pagetitle'<\/title>/' $name.html
tmpage=`mktemp` && cp $page $tmpage
sed -i -e 's/##+TITLE .*//' $tmpage
@@ -120,7 +120,6 @@ skip-page() {
push() {
countdown "rsyncing" && \
rsync -P -e 'ssh' -avul --delete --stats \
- #-n \
--size-only \
--exclude-from 'rsync-exclude' \
. $WEBHOST:$WEBROOT