diff options
| -rw-r--r-- | .stylelintrc.json | 2 | ||||
| -rw-r--r-- | assets/css/components/_page-header.scss | 4 | ||||
| -rw-r--r-- | assets/css/scopes/_page.scss | 4 | ||||
| -rw-r--r-- | content/blog/test2/index.md | 8 | ||||
| -rwxr-xr-x | scripts/build_content.sh | 25 | ||||
| -rw-r--r-- | templates/base.html | 12 | ||||
| -rw-r--r-- | templates/pageHeader.html | 19 | ||||
| -rw-r--r-- | templates/pageHeaderSm.html | 11 | ||||
| -rw-r--r-- | templates/pagelistByYear.html | 12 |
9 files changed, 63 insertions, 34 deletions
diff --git a/.stylelintrc.json b/.stylelintrc.json index 559e349..49f4e7f 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | "number-leading-zero": "never", | 5 | "number-leading-zero": "never", |
| 6 | "max-nesting-depth": 3, | 6 | "max-nesting-depth": 3, |
| 7 | "selector-class-pattern": [ | 7 | "selector-class-pattern": [ |
| 8 | "^[closu](-[a-z]+)+(__[a-z]+(-[a-z]+)*)*(--[a-z]+(-[a-z]+)*)*(\\@[a-z]+(-[a-z]+)*)?$", | 8 | "^[closu](-[a-z0-9]+)+(__[a-z0-9]+(-[a-z0-9]+)*)*(--[a-z0-9]+(-[a-z0-9]+)*)*(\\@[a-z0-9]+(-[a-z0-9]+)*)?$", |
| 9 | { "resolveNestedSelectors": true } | 9 | { "resolveNestedSelectors": true } |
| 10 | ], | 10 | ], |
| 11 | "declaration-colon-space-after": null, | 11 | "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 @@ | |||
| 14 | color: var(--fg-minus); | 14 | color: var(--fg-minus); |
| 15 | line-height: $code-block--line-height; | 15 | line-height: $code-block--line-height; |
| 16 | } | 16 | } |
| 17 | |||
| 18 | > :first-child { | ||
| 19 | margin-top: 0; | ||
| 20 | } | ||
| 17 | } | 21 | } |
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 @@ | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | .c-refs__item::before { | 49 | .c-refs__item::before { |
| 50 | content: '|>'; | 50 | content: '->'; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | pre { | 53 | pre { |
| 54 | margin-top: $line-height * 1em; | ||
| 55 | |||
| 54 | &::before { | 56 | &::before { |
| 55 | content: str-repeat('``\A', 40); | 57 | content: str-repeat('``\A', 40); |
| 56 | height: 100%; | 58 | 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 @@ | |||
| 1 | --- | 1 | --- |
| 2 | date: 2020-12-27 | 2 | date: 2020-12-21 |
| 3 | title: Test Page 2 | 3 | title: Test Page 2 |
| 4 | --- | 4 | --- |
| 5 | 5 | ||
| 6 | # Test Page 2 | 6 | # Test Page 2 |
| 7 | |||
| 8 | ``` | ||
| 9 | - /----\ | ||
| 10 | - | | | ||
| 11 | - \----/ | ||
| 12 | ``` | ||
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 () { | |||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | target_url_abs () { | 27 | target_url_abs () { |
| 28 | url=$(target_url_rel "$CONTENT_DIR" "$1") | 28 | echo "/$(target_url_rel "$CONTENT_DIR" "$1")" |
| 29 | echo "/$url" | ||
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | get_section() { | 31 | get_section() { |
| @@ -69,7 +68,10 @@ get_subpages() { | |||
| 69 | if [ ${#child_pages[@]} -ne 0 ]; then | 68 | if [ ${#child_pages[@]} -ne 0 ]; then |
| 70 | #echo -e "\033[0;90m[////////]\033[0m Child pages:" | 69 | #echo -e "\033[0;90m[////////]\033[0m Child pages:" |
| 71 | 70 | ||
| 72 | collected_metadata="[]" | 71 | collected_metadata=$(echo "{ |
| 72 | \"all\": [], | ||
| 73 | \"by_year\": {} | ||
| 74 | }" | jq .) | ||
| 73 | 75 | ||
| 74 | for file in "${child_pages[@]}"; do | 76 | for file in "${child_pages[@]}"; do |
| 75 | #echo -e "\033[0;90m[////////]\033[0m - $file" | 77 | #echo -e "\033[0;90m[////////]\033[0m - $file" |
| @@ -84,10 +86,22 @@ get_subpages() { | |||
| 84 | 86 | ||
| 85 | metadata=$(echo "$metadata" | jq ". + { url_rel: \"$url_rel\", url_abs: \"$url_abs\" }") | 87 | metadata=$(echo "$metadata" | jq ". + { url_rel: \"$url_rel\", url_abs: \"$url_abs\" }") |
| 86 | 88 | ||
| 87 | collected_metadata=$(echo "$collected_metadata" | jq ". + [ $metadata ]") | 89 | collected_metadata=$(echo "$collected_metadata" | jq ".all += [ $metadata ]") |
| 90 | |||
| 91 | date=$(echo "$metadata" | jq -r .date) | ||
| 92 | |||
| 93 | if [ "$date" != "" ]; then | ||
| 94 | date_year=$(date -d "$date" +%Y) | ||
| 95 | #date_month=$(date -d "$date" +%m) | ||
| 96 | #date_day=$(date -d "$date" +%d) | ||
| 97 | |||
| 98 | collected_metadata=$(echo "$collected_metadata" | jq ".by_year.\"$date_year\" += [ $metadata ]") | ||
| 99 | fi | ||
| 88 | done | 100 | done |
| 89 | 101 | ||
| 90 | collected_metadata=$(echo "$collected_metadata" | jq "sort_by(.date) | reverse") | 102 | collected_metadata=$(echo "$collected_metadata" \ |
| 103 | | jq ".all |= (sort_by(.date) | reverse)" \ | ||
| 104 | | jq ".by_year[] |= (sort_by(.date) | reverse)") | ||
| 91 | 105 | ||
| 92 | echo "{ \"pages\": $collected_metadata }" | jq . | 106 | echo "{ \"pages\": $collected_metadata }" | jq . |
| 93 | fi | 107 | fi |
| @@ -110,6 +124,7 @@ handle () { | |||
| 110 | 124 | ||
| 111 | subpages_meta_file=$(mktemp) | 125 | subpages_meta_file=$(mktemp) |
| 112 | 126 | ||
| 127 | # echo "$(get_subpages "$1")" | ||
| 113 | echo "$(get_subpages "$1")" > "$subpages_meta_file" | 128 | echo "$(get_subpages "$1")" > "$subpages_meta_file" |
| 114 | 129 | ||
| 115 | pandoc "$1" \ | 130 | 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()} | |||
| 46 | </header> | 46 | </header> |
| 47 | $endif$ | 47 | $endif$ |
| 48 | 48 | ||
| 49 | $body$ | 49 | $body$ |
| 50 | 50 | ||
| 51 | $if(isblog)$ | 51 | $if(isblog)$ |
| 52 | $if(pages)$ | 52 | ${pagelistByYear()} |
| 53 | <ul class="c-refs"> | ||
| 54 | $for(pages)$ | ||
| 55 | <li class="c-refs__item"> | ||
| 56 | <a href="$it.url_rel$">$it.date$ - $it.title$</a> | ||
| 57 | </li> | ||
| 58 | $endfor$ | ||
| 59 | </ul> | ||
| 60 | $endif$ | ||
| 61 | $endif$ | 53 | $endif$ |
| 62 | </div> | 54 | </div> |
| 63 | </main> | 55 | </main> |
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 @@ | |||
| 1 | <!-- | 1 | $-- ' | ' ' ' ' ' | | | ' ' |
| 2 | ' | ' ' ' ' ' | | | ' ' | 2 | $-- | ' ' ' //\_ ' | ' . | ' ' |
| 3 | | ' ' ' //\_ ' | ' . | ' ' | 3 | $-- .| ' ____,...,______..,_~`` -`.., ' | ' | ' ' |
| 4 | .| ' ____,...,______..,_~`` -`.., ' | ' | ' ' | 4 | $-- | _,~´"' , . ,~--´ ' _| | . |~~.__ ' ' |
| 5 | | _,~´"' , . ,~--´ ' _| | . |~~.__ ' ' | 5 | $-- | | ,-" _.-|~/ |..,____,) ,/,,"' '_( | ' |) ) ' ' |
| 6 | | | ,-" _.-|~/ |..,____,) ,/,,"' '_( | ' |) ) ' ' | 6 | $-- '| \__,~"´ /:) / |:\ \ ,~( ) . | | ) `, ' _,--. |
| 7 | '| \__,~"´ /:) / |:\ \ ,~( ) . | | ) `, ' _,--. | 7 | $-- ___\___.___:____(:/\_-,______\:.\_-,____.__\_.\______.__:___\__.___)_.___,/_____ |
| 8 | ___\___.___:____(:/\_-,______\:.\_-,____.__\_.\______.__:___\__.___)_.___,/_____ | 8 | $-- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |
| 9 | ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 9 | |
| 10 | --> | ||
| 11 | <pre class="u-hidden@sm-down"> | 10 | <pre class="u-hidden@sm-down"> |
| 12 | ' | ' ' ' ' ' | | | ' ' | 11 | ' | ' ' ' ' ' | | | ' ' |
| 13 | | ' ' ' <strong>//\_</strong> ' | ' . | ' ' | 12 | | ' ' ' <strong>//\_</strong> ' | ' . | ' ' |
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 @@ | |||
| 1 | <!-- | 1 | $-- .| //\__ ' .' | . | ' . ' |
| 2 | .| //\__ ' .' | . | ' . ' | 2 | $-- | _.~-"""-----~`` ,-´ ' ' |' | ' ' |
| 3 | | _.~-"""-----~`` ,-´ ' ' |' | ' ' | 3 | $-- '| .´ ,~'\ ).,__,)/,," ' . ' | | | ' .' |
| 4 | '| .´ ,~'\ ).,__,)/,," ' . ' | | | ' .' | 4 | $-- |_ `~´ (/\\, (/\\, _' '_ _| ' |_ _' '_ |
| 5 | |_ `~´ (/\\, (/\\, _' '_ _| ' |_ _' '_ | 5 | |
| 6 | --> | ||
| 7 | <pre class="$if(ishome)$u-hidden@sm-up$endif$"> | 6 | <pre class="$if(ishome)$u-hidden@sm-up$endif$"> |
| 8 | .| <strong> //\__</strong> ' .' | . | ' . ' | 7 | .| <strong> //\__</strong> ' .' | . | ' . ' |
| 9 | | <strong> _.~-"""-----~`` ,-´</strong> ' ' |' | ' ' | 8 | | <strong> _.~-"""-----~`` ,-´</strong> ' ' |' | ' ' |
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 @@ | |||
| 1 | $for(pages)$ | ||
| 2 | $for(it.by_year/pairs)$ | ||
| 3 | <h2>$it.key$</h2> | ||
| 4 | <ul class="c-refs"> | ||
| 5 | $for(it.value)$ | ||
| 6 | <li class="c-refs__item"> | ||
| 7 | <a href="$it.url_rel$">$it.date$ - $it.title$</a> | ||
| 8 | </li> | ||
| 9 | $endfor$ | ||
| 10 | </ul> | ||
| 11 | $endfor$ | ||
| 12 | $endfor$ | ||
