aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTianhao Wang <tianhao.wang2@mailbox.tu-dresden.de>2023-10-14 00:04:45 +0200
committerTianhao Wang <tianhao.wang2@mailbox.tu-dresden.de>2023-10-14 00:04:45 +0200
commit2580e02140f112e8797807620e36712489039754 (patch)
tree4956d918ecb3d79ff772c52576bfdee20e88a811 /examples
init
Diffstat (limited to 'examples')
-rw-r--r--examples/hugo_timeline_partial.html22
-rw-r--r--examples/syncblog.sh22
2 files changed, 44 insertions, 0 deletions
diff --git a/examples/hugo_timeline_partial.html b/examples/hugo_timeline_partial.html
new file mode 100644
index 0000000..251ccce
--- /dev/null
+++ b/examples/hugo_timeline_partial.html
@@ -0,0 +1,22 @@
+<style type="text/css">
+table.tidy, table.tidy * {
+ border: none;
+ padding-top:0;
+ padding-bottom:0.2em;
+ text-align: left;
+ vertical-align: top;
+}
+</style>
+
+<h1>Timeline</h1>
+<table class="tidy" align=left>
+ <tbody>
+ {{ $tl := site.Data.tl }}
+ {{ range $tl }}
+ <tr>
+ <td> @{{.account}}<a href={{.url}}>🔗</a><br> </td>
+ <td> [{{.created_at}}] {{ .content }}<br></td>
+ </tr>
+ {{ end }}
+ </tbody>
+</table>
diff --git a/examples/syncblog.sh b/examples/syncblog.sh
new file mode 100644
index 0000000..5661923
--- /dev/null
+++ b/examples/syncblog.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/bash
+
+# THIS IS AN EXAMPLE
+# DON'T RUN ME WITHOUT MODIFYING!
+
+# FOOLPROOF
+echo "do you know what you are doing?"
+exit()
+
+cd <PATH_TO_TIMELINE_BOT>
+echo "Fetching Timeline from fedi..."
+./timelinebot.py
+cp tl.json <PATH_TO_SITE_ROOT_DATA>
+
+cd <PATH_TO_SITE_ROOT>
+echo "Rendering blog..."
+hugo
+
+echo "Sync blog to remote server..."
+rsync -avh -og --chown=http:http --info=progress2 --info=name0 --update --delete-after \
+ <PATH_TO_SITE_ROOT_PUBLIC> \
+ user@remote_server:<PATH_TO_WEB_DOC_ROOT>