From ed3428e16479fdea7e15c7c3d32d76d988018504 Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Wed, 10 Jul 2024 10:44:05 -0600 Subject: [PATCH] Add QR code preview support QR codes can now be generated for all pages with the post processing script the HEAD of all the html now has an open graph image tage pointing to the QR code url --- layouts/partials/head.html | 3 ++- post-process.sh | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 post-process.sh diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b5f73cf..d45dddf 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -14,7 +14,8 @@ - + + {{ if isset .Params "tags" }} {{ end -}} diff --git a/post-process.sh b/post-process.sh new file mode 100755 index 0000000..b958075 --- /dev/null +++ b/post-process.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cd public/ + +find -name *.html | while read FILE; do + URL="$(grep -oP '(?<="og:url" content=")(.*)(?=")' $FILE)" + qrencode $URL -o $(dirname $FILE)/qr.png +done