summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile15
-rw-r--r--content/linklog.md13
-rw-r--r--templates/macros.html12
-rw-r--r--templates/page.html5
-rw-r--r--templates/page_linklog.html6
-rw-r--r--templates/shortcodes/linklog.html1
-rwxr-xr-xupdate-linklog-json.sh3
8 files changed, 54 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 364fdec..a85c8b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
public/
+linklog.json
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f253604
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,15 @@
+.PHONY: all
+all:
+ @echo "Building project..."
+ ./update-linklog-json.sh
+ zola build
+
+dev:
+ @echo "Starting development server..."
+ ./update-linklog-json.sh
+ zola serve
+
+.PHONY: clean
+clean:
+ @echo "Cleaning project..."
+ rm -r public
diff --git a/content/linklog.md b/content/linklog.md
new file mode 100644
index 0000000..143a799
--- /dev/null
+++ b/content/linklog.md
@@ -0,0 +1,13 @@
+---
+title: Linklog
+weight: 0
+template: page_linklog.html
+---
+
+# Linklog
+
+My public bookmarks are stored in [Linkhut](https://ln.ht/~jant). This page contains a summary of the most recent updates. Updated sporadically.
+
+Follow my full Linkhut feed via [Atom/RSS](https://ln.ht/_/feed/~jant) ([Huh?](https://aboutfeeds.com/)).
+
+{{ linklog() }}
diff --git a/templates/macros.html b/templates/macros.html
index cb5efdc..b4cb6d0 100644
--- a/templates/macros.html
+++ b/templates/macros.html
@@ -14,3 +14,15 @@
</ul>
</nav>
{% endmacro %}
+
+{% macro linklog(page) %}
+{% set lh_data = load_data(path="linklog.json") %}
+<ul class="archive-list">
+{% for lh_post in lh_data.posts %}
+ <li class="archive-entry">
+ <a href="{{ lh_post.href }}">{{ lh_post.description }}</a>
+ <small>({{ lh_post.time | date(format='%Y-%m-%d') }})</small>
+ </li>
+{% endfor %}
+</ul>
+{% endmacro %}
diff --git a/templates/page.html b/templates/page.html
index 786b800..c6be731 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -1,5 +1,6 @@
-{% extends "base.html" %} {% import "macros.html" as macros %} {% block content
-%}
+{% extends "base.html" %}
+{% import "macros.html" as macros %}
+{% block content %}
<h1>
{{ page.title }}<br />
diff --git a/templates/page_linklog.html b/templates/page_linklog.html
new file mode 100644
index 0000000..e4fc945
--- /dev/null
+++ b/templates/page_linklog.html
@@ -0,0 +1,6 @@
+{% extends "base.html" %}
+{% import "macros.html" as macros %}
+
+{% block content %}
+{{ page.content | replace(from="<!-- linklog -->", to=macros::linklog(page=page)) | safe }}
+{% endblock %}
diff --git a/templates/shortcodes/linklog.html b/templates/shortcodes/linklog.html
new file mode 100644
index 0000000..6f46a2b
--- /dev/null
+++ b/templates/shortcodes/linklog.html
@@ -0,0 +1 @@
+<!-- linklog -->
diff --git a/update-linklog-json.sh b/update-linklog-json.sh
new file mode 100755
index 0000000..b4261cb
--- /dev/null
+++ b/update-linklog-json.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+curl -v -H Accept:'application/json' -H "Authorization: Bearer $LNHT_TOKEN" https://api.ln.ht/v1/posts/recent -o linklog.json