From 9ef79b2215d894d5252961e1cb2b7050647de4fe Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 21 Nov 2021 21:27:26 +0100 Subject: Remove automatic titlecase algorithm --- content/9thPK7O3xn/dreams/biological-experiments.md | 2 +- content/9thPK7O3xn/dreams/false-awakening.md | 2 +- content/9thPK7O3xn/dreams/infinite-skyscrapers.md | 2 +- scripts/metadata_filter.lua | 17 ----------------- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/content/9thPK7O3xn/dreams/biological-experiments.md b/content/9thPK7O3xn/dreams/biological-experiments.md index 156e300..94a7f63 100644 --- a/content/9thPK7O3xn/dreams/biological-experiments.md +++ b/content/9thPK7O3xn/dreams/biological-experiments.md @@ -1,6 +1,6 @@ --- date: 2012-01-01 -title: Biological experiments +title: Biological Experiments --- *I don't remember the real date of this dream, just that it happened in 2012.* diff --git a/content/9thPK7O3xn/dreams/false-awakening.md b/content/9thPK7O3xn/dreams/false-awakening.md index 7d6d8d4..4f2a0b2 100644 --- a/content/9thPK7O3xn/dreams/false-awakening.md +++ b/content/9thPK7O3xn/dreams/false-awakening.md @@ -1,6 +1,6 @@ --- date: 2015-07-29 -title: False awakening +title: False Awakening --- It was noon. I was tired and decided to lie down for a bit. I didn't want to fall asleep, though, so I tried to stay awake and kept checking the time since I had to go to the uni later. This went on for quite a while, resulting in a constant cycle of dozing → remembering to check the time → looking at my smartphone to check the time → going back to dozing → and so on. diff --git a/content/9thPK7O3xn/dreams/infinite-skyscrapers.md b/content/9thPK7O3xn/dreams/infinite-skyscrapers.md index 33718a1..1086379 100644 --- a/content/9thPK7O3xn/dreams/infinite-skyscrapers.md +++ b/content/9thPK7O3xn/dreams/infinite-skyscrapers.md @@ -1,6 +1,6 @@ --- date: 2021-01-09 -title: Infinite skyscrapers +title: Infinite Skyscrapers --- 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. diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index 26d2423..d5a2909 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -163,22 +163,6 @@ function process_pages(global, order, pages_by_id) return pages_data end -local titlecase_exceptions = pandoc.List({ - "a", "an", "and", "as", "at", "but", "by", "en", "for", "if", "in", "nor", "of", "on", "or", - "per", "the", "to", "v%.?", "vs%.?", "via", -}) - -function titlecase(str) - return str:gsub("(%S)(%S*)(%s*)", function(a, b, space) - local word = a .. b - local is_exception = word:match("%u") or - titlecase_exceptions:find_if( - function(exception) return word:match("^" .. exception .. "$") end) - if is_exception then return word .. space end - return string.upper(a) .. b .. space - end) -end - function find_depth(pages) local depth = 0 @@ -291,7 +275,6 @@ function process(global, meta) meta.url = meta.url and pandoc.utils.stringify(meta.url) meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out) meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or "" - if meta.titlecase ~= false then meta.title = titlecase(meta.title) end if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end if meta.position then meta.position = pandoc.utils.stringify(meta.position) end -- cgit v1.2.3-70-g09d2