Quick and dirty OpenGraph image support
authorJoann Mõndresku <joann@cernodile.com>
Sat, 24 Jul 2021 09:12:15 +0000 (12:12 +0300)
committerJoann Mõndresku <joann@cernodile.com>
Sat, 24 Jul 2021 09:12:15 +0000 (12:12 +0300)
articles/pinetime-a-promising-open-smartwatch.md
blogit
templates/article_header.html

index 02b40934f3cac2adc3ad8e19cec74509e8b25c3a..58abf288941076a14d553e2b8d66fb5a585a099d 100644 (file)
@@ -49,3 +49,4 @@ Thanks for reading
 
 ;tags:pine64 smartwatch opensource review
 ;description:PineTime is a open-source smartwtch built by Pine64 and the community on the budget. Does it hold up to Cernodile's standards - is he satisifed, is it any good or a fail? Find out in this blog post!
+;og_image:<meta property="og:image" content="https://based.quest/img/pinetime_review_pic.jpg">
diff --git a/blogit b/blogit
index 4f590f4ad53d34b7bb22ad1920f07bae41d726e9..cfc7017ed149c84e21740ac5346b1f1e3607a196 100755 (executable)
--- a/blogit
+++ b/blogit
@@ -141,6 +141,8 @@ blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header ar
        export TAGS; \
        DESCRIPTION="$(shell grep -i '^; *description:' "$<" | cut -d: -f2-)"; \
        export DESCRIPTION; \
+       OG_IMAGE="$(shell grep -i '^; *og_image:' "$<" | cut -d: -f2-)"; \
+       export OG_IMAGE; \
        envsubst < templates/header.html > $@; \
        envsubst < templates/article_header.html >> $@; \
        sed -e 1d \
index 8f2c196745a0d97074f12c2d6cc31aadbdddeba7..4218d07da3bd0d2881b6c81ef3ba068dd11d9ca9 100644 (file)
@@ -1,5 +1,6 @@
 <meta property="og:title" content="based.quest - $TITLE">
 <meta property="og:description" content="$DESCRIPTION">
+$OG_IMAGE
 <a href="index.html"><-- Back</a>
 <div id="post">
 <h1>$TITLE</h1>