about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-03-14 10:53:40 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-03-14 10:53:40 +0100
commit2fc8dfda51a15865a206696e5f5cb7ef2b4eaeeb (patch)
treed87ea572913b6b3ffec6d3d78f14faa584948ad4
parent42df6add57fbfda09a4856f7eaf3b452179840ed (diff)
downloadkronika-2fc8dfda51a15865a206696e5f5cb7ef2b4eaeeb.tar.gz
kronika-2fc8dfda51a15865a206696e5f5cb7ef2b4eaeeb.zip
Filter out frontmatter
-rwxr-xr-xgen2
-rw-r--r--shell.nix1
-rwxr-xr-xssg513
-rw-r--r--wpisy/_header.html2
4 files changed, 9 insertions, 9 deletions
diff --git a/gen b/gen
index b788c0a..0082afa 100755
--- a/gen
+++ b/gen
@@ -16,4 +16,4 @@ for f in `find wpisy/kronika/20* -name '*.md' | sort -r`; do
 done
 echo "</div>" >> wpisy/kronika.html
 
-./ssg5 wpisy dest "19pdh" "https://19.niedzwiedzinski.cyou"
+./ssg5 wpisy dest "19 PDH Puszcza" "https://19.niedzwiedzinski.cyou"
diff --git a/shell.nix b/shell.nix
index 49f5fd9..7a853f4 100644
--- a/shell.nix
+++ b/shell.nix
@@ -2,5 +2,6 @@
 pkgs.mkShell {
   buildInputs = with pkgs; [
     lowdown
+    httplz
   ];
 }
diff --git a/ssg5 b/ssg5
index bd58726..fa5bd4c 100755
--- a/ssg5
+++ b/ssg5
@@ -197,13 +197,12 @@ render_md_files_lowdown() {
       out="$2/${f%\.md}/index.html"
     fi
 
-    if [ "$(echo $f | cut -d'/' -f 2)" = "kronika" ]; then
-      echo "<article>" > $in && \
-      lowdown --html-no-skiphtml --html-no-escapehtml "$1/$f" >> $in && \
-      echo "</article>" >> $in
-    else
-      lowdown --html-no-skiphtml --html-no-escapehtml "$1/$f" > $in
-    fi
+    echo "" > $in
+    [ "$(echo $f | cut -d'/' -f 2)" = "kronika" ] && echo "<article>" > $in
+    # Filter out frontmatter
+    tail -n +$(($(sed -n '/---/,/---/p' $1/$f | wc -l)+2)) $1/$f | \
+      lowdown --html-no-skiphtml --html-no-escapehtml >> $in && \
+    [ "$(echo $f | cut -d'/' -f 2)" = "kronika" ] && echo "</article>" >> $in
 
     cat "$in" |
       render_html_file "$3" \
diff --git a/wpisy/_header.html b/wpisy/_header.html
index 075ce32..0bc7f8a 100644
--- a/wpisy/_header.html
+++ b/wpisy/_header.html
@@ -1,7 +1,7 @@
 <!doctype html>
 <html lang="en" prefix="og: http://ogp.me/ns#">
   <head>
-    <title>19 PDH Puszcza</title>
+    <title></title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width,initial-scale=1">
     <meta name="robots" content="all">