From ad478954cf77842364d03e1d5ee85e366e699ee7 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 7 Jan 2021 08:50:48 +0100 Subject: Improved general structure, resolve category name in metadata filter, added hideable nav items, added header for page layout --- assets/css/components/_hero.scss | 34 ++++++++++ assets/css/components/_page-header.scss | 34 ---------- assets/css/components/_page.scss | 14 +++++ assets/css/style.scss | 2 +- content/_personal/index.md | 4 ++ content/blog/index.md | 4 +- content/blog/test1.md | 2 - content/blog/test2/index.md | 2 - filters/common_actions.lua | 12 ++-- metadata/metadata.yaml | 4 ++ scripts/metadata_filter.lua | 108 ++++++++++++++++++-------------- templates/base.html | 27 ++------ templates/layouts/dated_list.html | 22 +++++++ templates/layouts/index.html | 44 +++++++++++++ templates/layouts/page.html | 12 ++++ templates/list.html | 20 ------ templates/page.html | 1 - templates/partials/pageHeader.html | 17 ----- templates/partials/pageHeaderSm.html | 10 --- 19 files changed, 209 insertions(+), 164 deletions(-) create mode 100644 assets/css/components/_hero.scss delete mode 100644 assets/css/components/_page-header.scss create mode 100644 content/_personal/index.md create mode 100644 templates/layouts/dated_list.html create mode 100644 templates/layouts/index.html create mode 100644 templates/layouts/page.html delete mode 100644 templates/list.html delete mode 100644 templates/page.html delete mode 100644 templates/partials/pageHeader.html delete mode 100644 templates/partials/pageHeaderSm.html diff --git a/assets/css/components/_hero.scss b/assets/css/components/_hero.scss new file mode 100644 index 0000000..7fa79e1 --- /dev/null +++ b/assets/css/components/_hero.scss @@ -0,0 +1,34 @@ +.c-hero { + margin-bottom: $line-height * 2em; + margin-left: -1 * $page--item-prefix--width; + padding-left: $page--item-prefix--width; + overflow: hidden; + + &::after { + content: str-repeat('░', 120); + display: block; + position: relative; + z-index: -10; + height: $line-height; + margin-top: px-to-em(2px); + margin-left: -1 * $page--item-prefix--width; + padding-top: px-to-em(2px); + border-top: 1px solid var(--fg-hi); + color: var(--fg-hi); + line-height: $code-block--line-height; + } + + &__pre { + margin-top: 0; + overflow: hidden; + } + + @media (max-width: map-get($breakpoints, 'sm')) { + margin-left: 0; + padding-left: 0; + + &::after { + margin-left: 0; + } + } +} diff --git a/assets/css/components/_page-header.scss b/assets/css/components/_page-header.scss deleted file mode 100644 index e97aaf7..0000000 --- a/assets/css/components/_page-header.scss +++ /dev/null @@ -1,34 +0,0 @@ -.c-page-header { - margin-bottom: $line-height * 2em; - margin-left: -1 * $page--item-prefix--width; - padding-left: $page--item-prefix--width; - overflow: hidden; - - &::after { - content: str-repeat('░', 120); - display: block; - position: relative; - z-index: -10; - height: $line-height; - margin-top: px-to-em(2px); - margin-left: -1 * $page--item-prefix--width; - padding-top: px-to-em(2px); - border-top: 1px solid var(--fg-hi); - color: var(--fg-hi); - line-height: $code-block--line-height; - } - - &__pre { - margin-top: 0; - overflow: hidden; - } - - @media (max-width: map-get($breakpoints, 'sm')) { - margin-left: 0; - padding-left: 0; - - &::after { - margin-left: 0; - } - } -} diff --git a/assets/css/components/_page.scss b/assets/css/components/_page.scss index bccf069..ce67f7e 100644 --- a/assets/css/components/_page.scss +++ b/assets/css/components/_page.scss @@ -1,4 +1,18 @@ .c-page { + &__header { + margin-bottom: $line-height * 1em; + + &__title { + margin-top: 0; + } + + &__meta { + margin-top: 0; + color: var(--fg-hi); + font-weight: normal; + } + } + &__content { padding-left: $page--item-prefix--width; diff --git a/assets/css/style.scss b/assets/css/style.scss index e89cbd6..9f3bb31 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -6,7 +6,7 @@ @import 'components/hlist'; @import 'components/nav'; @import 'components/page'; -@import 'components/page-header'; +@import 'components/hero'; @import 'layouts/container'; diff --git a/content/_personal/index.md b/content/_personal/index.md new file mode 100644 index 0000000..5e89459 --- /dev/null +++ b/content/_personal/index.md @@ -0,0 +1,4 @@ +--- +title: Personal Blog +layout: dated_list +--- diff --git a/content/blog/index.md b/content/blog/index.md index 1053dc2..6668eba 100644 --- a/content/blog/index.md +++ b/content/blog/index.md @@ -1,7 +1,5 @@ --- title: Blog - +layout: dated_list create_feed: true --- - -# Blog diff --git a/content/blog/test1.md b/content/blog/test1.md index 05c2b2d..943570c 100644 --- a/content/blog/test1.md +++ b/content/blog/test1.md @@ -3,5 +3,3 @@ date: 2020-12-25 title: Test Page 1 category: tes --- - -# Test Page 1 diff --git a/content/blog/test2/index.md b/content/blog/test2/index.md index 9d1ebd2..aee4641 100644 --- a/content/blog/test2/index.md +++ b/content/blog/test2/index.md @@ -4,8 +4,6 @@ title: Test Page 2 category: per --- -# Test Page 2 - ``` - /----\ - | | diff --git a/filters/common_actions.lua b/filters/common_actions.lua index 1d13e3a..a358b99 100644 --- a/filters/common_actions.lua +++ b/filters/common_actions.lua @@ -2,7 +2,10 @@ function CodeBlock(el) if next(el.classes) == nil then el.classes = el.classes .. {'c-page__prefixed', 'c-page__prefixed--pre'} else - local formatted = pandoc.pipe('pygmentize', {'-l', el.classes[1], '-f', 'html', '-O', 'cssclass=c-page__code s-code'}, el.text) + local formatted = pandoc.pipe('pygmentize', { + '-l', el.classes[1], '-f', 'html', '-O', + 'cssclass=c-page__code s-code' + }, el.text) el = pandoc.RawBlock('html', formatted) end @@ -21,9 +24,7 @@ function Header(el) end function Div(el) - if el.attributes.macro == nil then - return el - end + if el.attributes.macro == nil then return el end if el.attributes.macro == 'refs' and el.content[1].tag == 'BulletList' then local newchildren = pandoc.List() @@ -31,7 +32,8 @@ function Div(el) newchildren:insert(pandoc.RawBlock('html', '