From 02943c8e2d96ec0534b243386f4048df3cddd24d Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 6 Feb 2020 02:06:34 -0300 Subject: Assert pastebins have lang frontmatter --- scripts/assert-content.sh | 5 +++++ site.json | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index 3c3f0ba..94bf1b3 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -81,6 +81,11 @@ for page in $(jq -r '.pages[] | @base64' "${JSON}"); do set -e done +echo Linting pastebins... >&2 +for pastebin in $(jq -r '.pastebins[] | @base64' "${JSON}"); do + assert-frontmatter "$pastebin" +done + echo Asserting unique refs... >&2 KNOWN_IDS=() for page in $(jq -r '.pages[] | @base64' "${JSON}"); do diff --git a/site.json b/site.json index 30a7260..411a02b 100644 --- a/site.json +++ b/site.json @@ -23,5 +23,17 @@ "content": {{ page.content | strip_html | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} + ], + "pastebins": [ + {% for pastebin in site.pastebins %} + { + "title": "{{ pastebin.title | smartify }}", + "date": "{{ post.date }}", + "url": "{{ pastebin.url }}", + "lang": "{{ pastebin.lang }}", + "ref": "placeholder-ref", + "content": {{ pastebin.content | strip_html | jsonify }} + }{% unless forloop.last %},{% endunless %} + {% endfor %} ] } -- cgit v1.2.3