From 1cc072bb0bca2e2a5e88ba05ee9b3ec39ea7eefc Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 21 Jan 2021 21:31:21 +0100 Subject: Replace blogs with notebooks (i.e. no dates, grouped by category) --- .vscode/settings.json | 5 +++- assets/css/_basics.scss | 4 ++++ content/blog/index.md | 5 ---- content/index.md | 4 ++++ content/notebook/index.md | 5 ++++ content/pers_notebook/index.md | 5 ++++ content/pers_notebook/infinite-skyscrapers.md | 28 ++++++++++++++++++++++ .../2021-01-09-infinite-skyscrapers.md | 28 ---------------------- content/personal_blog/index.md | 5 ---- metadata/metadata.yaml | 20 ++++++++-------- scripts/metadata_filter.lua | 25 +++++++++++++++---- templates/base.html | 2 ++ templates/layouts/categorized_list.html | 22 +++++++++++++++++ templates/layouts/page.html | 4 +--- 14 files changed, 106 insertions(+), 56 deletions(-) delete mode 100644 content/blog/index.md create mode 100644 content/notebook/index.md create mode 100644 content/pers_notebook/index.md create mode 100644 content/pers_notebook/infinite-skyscrapers.md delete mode 100644 content/personal_blog/2021-01-09-infinite-skyscrapers.md delete mode 100644 content/personal_blog/index.md create mode 100644 templates/layouts/categorized_list.html diff --git a/.vscode/settings.json b/.vscode/settings.json index 808b831..2fc142c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "git.enableCommitSigning": false + "git.enableCommitSigning": false, + "Lua.diagnostics.globals": [ + "pandoc" + ] } diff --git a/assets/css/_basics.scss b/assets/css/_basics.scss index 14c0391..9ce6b61 100644 --- a/assets/css/_basics.scss +++ b/assets/css/_basics.scss @@ -97,6 +97,10 @@ ol { } } +ul ul { + margin-top: 0; +} + dl { margin: ($line-height * 1em) 0 0; padding: 0; diff --git a/content/blog/index.md b/content/blog/index.md deleted file mode 100644 index 6668eba..0000000 --- a/content/blog/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Blog -layout: dated_list -create_feed: true ---- diff --git a/content/index.md b/content/index.md index 169a791..ebd3ff4 100644 --- a/content/index.md +++ b/content/index.md @@ -14,5 +14,9 @@ Here's a complete list of my profiles on other platforms: - **Email:** me@volpeon.ink - **Fediverse:** @volpeon@fedi.vulpes.one - **GitHub:** [volpeon](https://github.com/volpeon) +- **IRC - Furnet:** volpeon +- **IRC - Freenode:** volpeon +- **Steam:** [volpeon](https://steamcommunity.com/id/volpeon/) +- **XMPP:** <available> If you see someone with my username, you'll know it's me if their profile is listed here. I'll make sure to keep this list up-to-date. diff --git a/content/notebook/index.md b/content/notebook/index.md new file mode 100644 index 0000000..1175625 --- /dev/null +++ b/content/notebook/index.md @@ -0,0 +1,5 @@ +--- +title: Notebook +layout: categorized_list +create_feed: true +--- diff --git a/content/pers_notebook/index.md b/content/pers_notebook/index.md new file mode 100644 index 0000000..235ae57 --- /dev/null +++ b/content/pers_notebook/index.md @@ -0,0 +1,5 @@ +--- +title: Personal Notebook +layout: categorized_list +create_feed: true +--- diff --git a/content/pers_notebook/infinite-skyscrapers.md b/content/pers_notebook/infinite-skyscrapers.md new file mode 100644 index 0000000..909ecce --- /dev/null +++ b/content/pers_notebook/infinite-skyscrapers.md @@ -0,0 +1,28 @@ +--- +date: 2021-01-09 +title: Infinite Skyscrapers +category: dre +--- + +I'm in some strange world that consist of huge buildings, looking a lot like very simple skyscrapers, except they were all interconnected. I'm not even sure if there's a floor since I'm just floating, being able to fly around at will. +There is also something chasing me and I'm trying to get away from it. + +The buildings around me get denser and more chaotic, some look like glitches in a computer game. The creature chasing me seems to absorb buildings into its body, getting larger and more powerful. + +Then there's a cut and I'm presumable inside one of those buildings. I'm in a dark room with barely any lighting, looking somewhat like a large office. It's very cluttered, though. There's another similar room next to this one, being separated by a glass wall and a door. +There's another person with me who I seem to know, and that creature that chased me. It seems like it managed to capture us. + +It dares us to escape from this situation, and as soon as it said that, the room begins to get locked off. There are some red lights blinking and the door connecting our current room with the neighboring room is about to close permanently. Panicked, I quickly run through it, but the other person couldn't make it. + +I suddenly realize I'm a cat and the other person an even smaller critter, I don't know what. It was obvious that the creature was just playing with us, watching our futile efforts to escape for its amusement. + +The other person tries to get the door to open again by messing with its circuitry, and I do my best to block the creature's view from what was going on without looking suspicious. + +After a while, I start exploring the room and notice that there's a hallway in front of it, also separated by a glass wall and a door. However, the wall is broken in one place and has a hole large enough for me to jump through. So that's what I do. I land in a bunch of glass disks lying on the floor, breaking them, but I'm unharmed. + +Now being a human again, I take a glass shard with me and run through a door which leads to a staircase. It is huge, having the shape of a pill with stairs going along the edge. The center is empty so I can see all the floors coming before and after. It looks like the number of floors is endless. +I know the creature will come after me soon and so I run upwards as fast as I can. + +I made it about 5 floors when I hear a door burst open and I quickly enter the room next to me, hoping that the creature hasn't seen me. + +This floor was very large and open and brightly lit. The dream starts to make no sense anymore and that's it. diff --git a/content/personal_blog/2021-01-09-infinite-skyscrapers.md b/content/personal_blog/2021-01-09-infinite-skyscrapers.md deleted file mode 100644 index 909ecce..0000000 --- a/content/personal_blog/2021-01-09-infinite-skyscrapers.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -date: 2021-01-09 -title: Infinite Skyscrapers -category: dre ---- - -I'm in some strange world that consist of huge buildings, looking a lot like very simple skyscrapers, except they were all interconnected. I'm not even sure if there's a floor since I'm just floating, being able to fly around at will. -There is also something chasing me and I'm trying to get away from it. - -The buildings around me get denser and more chaotic, some look like glitches in a computer game. The creature chasing me seems to absorb buildings into its body, getting larger and more powerful. - -Then there's a cut and I'm presumable inside one of those buildings. I'm in a dark room with barely any lighting, looking somewhat like a large office. It's very cluttered, though. There's another similar room next to this one, being separated by a glass wall and a door. -There's another person with me who I seem to know, and that creature that chased me. It seems like it managed to capture us. - -It dares us to escape from this situation, and as soon as it said that, the room begins to get locked off. There are some red lights blinking and the door connecting our current room with the neighboring room is about to close permanently. Panicked, I quickly run through it, but the other person couldn't make it. - -I suddenly realize I'm a cat and the other person an even smaller critter, I don't know what. It was obvious that the creature was just playing with us, watching our futile efforts to escape for its amusement. - -The other person tries to get the door to open again by messing with its circuitry, and I do my best to block the creature's view from what was going on without looking suspicious. - -After a while, I start exploring the room and notice that there's a hallway in front of it, also separated by a glass wall and a door. However, the wall is broken in one place and has a hole large enough for me to jump through. So that's what I do. I land in a bunch of glass disks lying on the floor, breaking them, but I'm unharmed. - -Now being a human again, I take a glass shard with me and run through a door which leads to a staircase. It is huge, having the shape of a pill with stairs going along the edge. The center is empty so I can see all the floors coming before and after. It looks like the number of floors is endless. -I know the creature will come after me soon and so I run upwards as fast as I can. - -I made it about 5 floors when I hear a door burst open and I quickly enter the room next to me, hoping that the creature hasn't seen me. - -This floor was very large and open and brightly lit. The dream starts to make no sense anymore and that's it. diff --git a/content/personal_blog/index.md b/content/personal_blog/index.md deleted file mode 100644 index 8f4484b..0000000 --- a/content/personal_blog/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Personal Blog -layout: dated_list -create_feed: true ---- diff --git a/metadata/metadata.yaml b/metadata/metadata.yaml index 05150ea..522896d 100644 --- a/metadata/metadata.yaml +++ b/metadata/metadata.yaml @@ -11,25 +11,25 @@ menus: - id: index label: Home url: / - - id: blog - label: Blog - url: /blog/ + - id: notebook + label: Notebook + url: /notebook/ hidden: true - - id: personal_blog + - id: pers_notebook label: Personal - label_long: Personal Blog - url: /personal_blog/ + label_long: Personal Notebook + url: /pers_notebook/ hidden: true feeds: - - title: Blog - url: /blog/index.xml + - title: Notebook + url: /notebook/index.xml categories: - personal_blog: + pers_notebook: dre: Dream Journal rewrites: path: - - from: ^/personal_blog + - from: ^/pers_notebook to: /9thPK7O3xn diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index d7116dc..cd0c2f7 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -183,20 +183,28 @@ function organize_subpages(site_url, output_dir, ref_file, pages) pandoc.utils.stringify(page.file_out)) end - local grouped_pages = group_by(pages, function(p) return not p.date end) + local pages_grouped_date = + group_by(pages, function(p) return not p.date end) - local pages_undated = grouped_pages[true] or pandoc.MetaList({}) + local pages_undated = pages_grouped_date[true] or pandoc.MetaList({}) pages_undated:sort(function(p1, p2) return pandoc.utils.stringify(p1.title) < pandoc.utils.stringify(p2.title) end) - local pages_dated = grouped_pages[false] or pandoc.MetaList({}) + local pages_dated = pages_grouped_date[false] or pandoc.MetaList({}) pages_dated:sort(function(p1, p2) return pandoc.utils.stringify(p1.date.yyyy_mm_dd) > pandoc.utils.stringify(p2.date.yyyy_mm_dd) end) + local pages_categorized = pages:filter( + function(p) return p.category ~= nil end) + pages_categorized:sort(function(p1, p2) + return pandoc.utils.stringify(p1.title) > + pandoc.utils.stringify(p2.title) + end) + local pages_by_year = group_by(pages_dated, function(p) return pandoc.utils.stringify(p.date.yyyy) end) @@ -205,14 +213,23 @@ function organize_subpages(site_url, output_dir, ref_file, pages) return i1.key > i2.key end)) + local pages_by_category = group_by(pages_categorized, function(p) + return pandoc.utils.stringify(p.category.id) + end) + pages_by_category = pandoc.MetaList(table_to_list(pages_by_category, + function(i1, i2) + return i1.key > i2.key + end)) + local pages_data = pandoc.MetaMap({ all_dated = pages_dated, all_undated = pages_undated, by_year = pages_by_year, + by_category = pages_by_category, last_update = #pages_dated ~= 0 and pages_dated[1].last_update }) - local categories_data = group_by(pages_dated, function(p) + local categories_data = group_by(pages_categorized, function(p) return p.category and pandoc.utils.stringify(p.category.id) end, function(stats, _, p) if not stats then diff --git a/templates/base.html b/templates/base.html index 08c85bb..3afa0f0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -49,6 +49,8 @@ ${layouts/index()} $elseif(layout.is_dated_list)$ ${layouts/dated_list()} + $elseif(layout.is_categorized_list)$ +${layouts/categorized_list()} $else$ ${layouts/page()} $endif$ diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html new file mode 100644 index 0000000..d213bb8 --- /dev/null +++ b/templates/layouts/categorized_list.html @@ -0,0 +1,22 @@ +
+
+

$title$

+$body$ + + $for(pages.by_category)$ +

+ $for(it.value/first)$ + $it.category.name$ + $endfor$ +

+ + $endfor$ +
+
+ diff --git a/templates/layouts/page.html b/templates/layouts/page.html index 61bcacd..640df18 100644 --- a/templates/layouts/page.html +++ b/templates/layouts/page.html @@ -13,9 +13,7 @@ $endif$

$title$

- $if(date)$ -

$date.yyyy_mm_dd$$if(category)$ in $category.name$$endif$

- $elseif(category)$ + $if(category)$

in $category.name$

$endif$ -- cgit v1.2.3-54-g00ecf