summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-11-21 21:27:26 +0100
committerVolpeon <git@volpeon.ink>2021-11-21 21:27:26 +0100
commit9ef79b2215d894d5252961e1cb2b7050647de4fe (patch)
treee54b16dfe1eafc2b2b9d0de901a3851bf753ce58
parentAdded IBM Plex italic variant (diff)
downloadvolpeon.ink-9ef79b2215d894d5252961e1cb2b7050647de4fe.tar.gz
volpeon.ink-9ef79b2215d894d5252961e1cb2b7050647de4fe.tar.bz2
volpeon.ink-9ef79b2215d894d5252961e1cb2b7050647de4fe.zip
Remove automatic titlecase algorithm
-rw-r--r--content/9thPK7O3xn/dreams/biological-experiments.md2
-rw-r--r--content/9thPK7O3xn/dreams/false-awakening.md2
-rw-r--r--content/9thPK7O3xn/dreams/infinite-skyscrapers.md2
-rw-r--r--scripts/metadata_filter.lua17
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 @@
1--- 1---
2date: 2012-01-01 2date: 2012-01-01
3title: Biological experiments 3title: Biological Experiments
4--- 4---
5 5
6*I don't remember the real date of this dream, just that it happened in 2012.* 6*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 @@
1--- 1---
2date: 2015-07-29 2date: 2015-07-29
3title: False awakening 3title: False Awakening
4--- 4---
5 5
6It 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. 6It 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 @@
1--- 1---
2date: 2021-01-09 2date: 2021-01-09
3title: Infinite skyscrapers 3title: Infinite Skyscrapers
4--- 4---
5 5
6I'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. 6I'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)
163 return pages_data 163 return pages_data
164end 164end
165 165
166local titlecase_exceptions = pandoc.List({
167 "a", "an", "and", "as", "at", "but", "by", "en", "for", "if", "in", "nor", "of", "on", "or",
168 "per", "the", "to", "v%.?", "vs%.?", "via",
169})
170
171function titlecase(str)
172 return str:gsub("(%S)(%S*)(%s*)", function(a, b, space)
173 local word = a .. b
174 local is_exception = word:match("%u") or
175 titlecase_exceptions:find_if(
176 function(exception) return word:match("^" .. exception .. "$") end)
177 if is_exception then return word .. space end
178 return string.upper(a) .. b .. space
179 end)
180end
181
182function find_depth(pages) 166function find_depth(pages)
183 local depth = 0 167 local depth = 0
184 168
@@ -291,7 +275,6 @@ function process(global, meta)
291 meta.url = meta.url and pandoc.utils.stringify(meta.url) 275 meta.url = meta.url and pandoc.utils.stringify(meta.url)
292 meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out) 276 meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out)
293 meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or "" 277 meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or ""
294 if meta.titlecase ~= false then meta.title = titlecase(meta.title) end
295 if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end 278 if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end
296 if meta.position then meta.position = pandoc.utils.stringify(meta.position) end 279 if meta.position then meta.position = pandoc.utils.stringify(meta.position) end
297 280