From 4631bf9fee31289d30d211d59b77b579303d55f6 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 28 Dec 2020 09:57:02 +0100 Subject: Various small fixes, exclude raw ASCII fox from output --- .stylelintrc.json | 2 +- assets/css/components/_page-header.scss | 4 ++++ assets/css/scopes/_page.scss | 4 +++- content/blog/test2/index.md | 8 +++++++- scripts/build_content.sh | 25 ++++++++++++++++++++----- templates/base.html | 12 ++---------- templates/pageHeader.html | 19 +++++++++---------- templates/pageHeaderSm.html | 11 +++++------ templates/pagelistByYear.html | 12 ++++++++++++ 9 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 templates/pagelistByYear.html diff --git a/.stylelintrc.json b/.stylelintrc.json index 559e349..49f4e7f 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -5,7 +5,7 @@ "number-leading-zero": "never", "max-nesting-depth": 3, "selector-class-pattern": [ - "^[closu](-[a-z]+)+(__[a-z]+(-[a-z]+)*)*(--[a-z]+(-[a-z]+)*)*(\\@[a-z]+(-[a-z]+)*)?$", + "^[closu](-[a-z0-9]+)+(__[a-z0-9]+(-[a-z0-9]+)*)*(--[a-z0-9]+(-[a-z0-9]+)*)*(\\@[a-z0-9]+(-[a-z0-9]+)*)?$", { "resolveNestedSelectors": true } ], "declaration-colon-space-after": null, diff --git a/assets/css/components/_page-header.scss b/assets/css/components/_page-header.scss index 886b3e9..e15be1c 100644 --- a/assets/css/components/_page-header.scss +++ b/assets/css/components/_page-header.scss @@ -14,4 +14,8 @@ color: var(--fg-minus); line-height: $code-block--line-height; } + + > :first-child { + margin-top: 0; + } } diff --git a/assets/css/scopes/_page.scss b/assets/css/scopes/_page.scss index a27c1a2..ba61b5f 100644 --- a/assets/css/scopes/_page.scss +++ b/assets/css/scopes/_page.scss @@ -47,10 +47,12 @@ } .c-refs__item::before { - content: '|>'; + content: '->'; } pre { + margin-top: $line-height * 1em; + &::before { content: str-repeat('``\A', 40); height: 100%; diff --git a/content/blog/test2/index.md b/content/blog/test2/index.md index c23538b..70130d1 100644 --- a/content/blog/test2/index.md +++ b/content/blog/test2/index.md @@ -1,6 +1,12 @@ --- -date: 2020-12-27 +date: 2020-12-21 title: Test Page 2 --- # Test Page 2 + +``` + - /----\ +- | | + - \----/ +``` diff --git a/scripts/build_content.sh b/scripts/build_content.sh index 298291d..e3b97ea 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -25,8 +25,7 @@ target_url_rel () { } target_url_abs () { - url=$(target_url_rel "$CONTENT_DIR" "$1") - echo "/$url" + echo "/$(target_url_rel "$CONTENT_DIR" "$1")" } get_section() { @@ -69,7 +68,10 @@ get_subpages() { if [ ${#child_pages[@]} -ne 0 ]; then #echo -e "\033[0;90m[////////]\033[0m Child pages:" - collected_metadata="[]" + collected_metadata=$(echo "{ + \"all\": [], + \"by_year\": {} + }" | jq .) for file in "${child_pages[@]}"; do #echo -e "\033[0;90m[////////]\033[0m - $file" @@ -84,10 +86,22 @@ get_subpages() { metadata=$(echo "$metadata" | jq ". + { url_rel: \"$url_rel\", url_abs: \"$url_abs\" }") - collected_metadata=$(echo "$collected_metadata" | jq ". + [ $metadata ]") + collected_metadata=$(echo "$collected_metadata" | jq ".all += [ $metadata ]") + + date=$(echo "$metadata" | jq -r .date) + + if [ "$date" != "" ]; then + date_year=$(date -d "$date" +%Y) + #date_month=$(date -d "$date" +%m) + #date_day=$(date -d "$date" +%d) + + collected_metadata=$(echo "$collected_metadata" | jq ".by_year.\"$date_year\" += [ $metadata ]") + fi done - collected_metadata=$(echo "$collected_metadata" | jq "sort_by(.date) | reverse") + collected_metadata=$(echo "$collected_metadata" \ + | jq ".all |= (sort_by(.date) | reverse)" \ + | jq ".by_year[] |= (sort_by(.date) | reverse)") echo "{ \"pages\": $collected_metadata }" | jq . fi @@ -110,6 +124,7 @@ handle () { subpages_meta_file=$(mktemp) + # echo "$(get_subpages "$1")" echo "$(get_subpages "$1")" > "$subpages_meta_file" pandoc "$1" \ diff --git a/templates/base.html b/templates/base.html index 21ea9a4..8d10d13 100644 --- a/templates/base.html +++ b/templates/base.html @@ -46,18 +46,10 @@ ${pageHeader()} $endif$ - $body$ +$body$ $if(isblog)$ - $if(pages)$ - - $endif$ + ${pagelistByYear()} $endif$ diff --git a/templates/pageHeader.html b/templates/pageHeader.html index 0521c88..40ee251 100644 --- a/templates/pageHeader.html +++ b/templates/pageHeader.html @@ -1,13 +1,12 @@ - +$-- ' | ' ' ' ' ' | | | ' ' +$-- | ' ' ' //\_ ' | ' . | ' ' +$-- .| ' ____,...,______..,_~`` -`.., ' | ' | ' ' +$-- | _,~´"' , . ,~--´ ' _| | . |~~.__ ' ' +$-- | | ,-" _.-|~/ |..,____,) ,/,,"' '_( | ' |) ) ' ' +$-- '| \__,~"´ /:) / |:\ \ ,~( ) . | | ) `, ' _,--. +$-- ___\___.___:____(:/\_-,______\:.\_-,____.__\_.\______.__:___\__.___)_.___,/_____ +$-- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +
 ' |      '     '             '     '            '   | |    |           '     '  
   |      '     '             '       //\_       '   | ' .  |           '     '  
diff --git a/templates/pageHeaderSm.html b/templates/pageHeaderSm.html
index f9e31ce..c480773 100644
--- a/templates/pageHeaderSm.html
+++ b/templates/pageHeaderSm.html
@@ -1,9 +1,8 @@
-
+$-- .|                     //\__      '  .'      |  . |           ' . ' 
+$--  |      _.~-"""-----~``  ,-´      '   '      |'   |           '   ' 
+$-- '|   .´  ,~'\ ).,__,)/,,"         ' . '      |  | |           '  .' 
+$--  |_  `~´   (/\\,   (/\\,         _'   '_    _| '  |_         _'   '_
+
 
 .|                     //\__      '  .'      |  . |           ' . ' 
  |      _.~-"""-----~``  ,-´      '   '      |'   |           '   ' 
diff --git a/templates/pagelistByYear.html b/templates/pagelistByYear.html
new file mode 100644
index 0000000..8270530
--- /dev/null
+++ b/templates/pagelistByYear.html
@@ -0,0 +1,12 @@
+$for(pages)$
+    $for(it.by_year/pairs)$
+        

$it.key$

+ + $endfor$ +$endfor$ -- cgit v1.2.3-70-g09d2