summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/css/components/_header.scss2
-rw-r--r--content/9thPK7O3xn/dreams/biological-experiments.md5
-rw-r--r--content/9thPK7O3xn/dreams/false-awakening.md5
-rw-r--r--content/9thPK7O3xn/dreams/index.md2
-rw-r--r--content/9thPK7O3xn/dreams/infinite-skyscrapers.md5
-rw-r--r--filters/common_actions.lua2
-rw-r--r--scripts/metadata_filter.lua57
-rw-r--r--templates/base.html4
-rw-r--r--templates/feed.xml6
-rw-r--r--templates/layouts/categorized_list.html54
-rw-r--r--templates/layouts/index.html8
-rw-r--r--templates/layouts/list.html50
-rw-r--r--templates/layouts/page.html2
13 files changed, 74 insertions, 128 deletions
diff --git a/assets/css/components/_header.scss b/assets/css/components/_header.scss
index 90ed827..1a10345 100644
--- a/assets/css/components/_header.scss
+++ b/assets/css/components/_header.scss
@@ -26,7 +26,7 @@
26 ), 'light'); 26 ), 'light');
27 27
28 @include component(namespace()) { 28 @include component(namespace()) {
29 height: prop(--dims --height); 29 height: prop(--dims --height);
30 30
31 @include element('nav') { 31 @include element('nav') {
32 display: inline-flex; 32 display: inline-flex;
diff --git a/content/9thPK7O3xn/dreams/biological-experiments.md b/content/9thPK7O3xn/dreams/biological-experiments.md
index acf2198..156e300 100644
--- a/content/9thPK7O3xn/dreams/biological-experiments.md
+++ b/content/9thPK7O3xn/dreams/biological-experiments.md
@@ -1,7 +1,6 @@
1--- 1---
2date: 2012-01-01 2date: 2012-01-01
3title: Biological experiments 3title: Biological experiments
4show_date: true
5--- 4---
6 5
7*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 6499b98..7d6d8d4 100644
--- a/content/9thPK7O3xn/dreams/false-awakening.md
+++ b/content/9thPK7O3xn/dreams/false-awakening.md
@@ -1,7 +1,6 @@
1--- 1---
2date: 2015-07-29 2date: 2015-07-29
3title: False awakening 3title: False awakening
4show_date: true
5--- 4---
6 5
7It 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/index.md b/content/9thPK7O3xn/dreams/index.md
index c230cef..8c72776 100644
--- a/content/9thPK7O3xn/dreams/index.md
+++ b/content/9thPK7O3xn/dreams/index.md
@@ -2,7 +2,7 @@
2title: Dream Journal 2title: Dream Journal
3position: 9 3position: 9
4layout: list 4layout: list
5show_dates: true 5list_order: date_desc
6show_read_indicators: true 6show_read_indicators: true
7create_feed: true 7create_feed: true
8--- 8---
diff --git a/content/9thPK7O3xn/dreams/infinite-skyscrapers.md b/content/9thPK7O3xn/dreams/infinite-skyscrapers.md
index d02f9f4..33718a1 100644
--- a/content/9thPK7O3xn/dreams/infinite-skyscrapers.md
+++ b/content/9thPK7O3xn/dreams/infinite-skyscrapers.md
@@ -1,7 +1,6 @@
1--- 1---
2date: 2021-01-09 2date: 2021-01-09
3title: Infinite skyscrapers 3title: Infinite skyscrapers
4show_date: true
5--- 4---
6 5
7I'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/filters/common_actions.lua b/filters/common_actions.lua
index 8383ada..cfe2d58 100644
--- a/filters/common_actions.lua
+++ b/filters/common_actions.lua
@@ -22,7 +22,7 @@ function Header(el)
22 if el.level <= 3 and el.identifier ~= '' then 22 if el.level <= 3 and el.identifier ~= '' then
23 el.content:insert(pandoc.Space()) 23 el.content:insert(pandoc.Space())
24 el.content:insert(pandoc.Link(pandoc.RawInline('html', 24 el.content:insert(pandoc.Link(pandoc.RawInline('html',
25 '<svg class="o-icon"><use href="/symbols.svg#icon-link"></use></svg>'), 25 '<svg class="o-icon" width="1em" height="1em"><use href="/symbols.svg#icon-link"></use></svg>'),
26 '#' .. el.identifier, nil, { class = 's-headlines__link' })) 26 '#' .. el.identifier, nil, { class = 's-headlines__link' }))
27 end 27 end
28 28
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua
index daad940..7039a2c 100644
--- a/scripts/metadata_filter.lua
+++ b/scripts/metadata_filter.lua
@@ -102,18 +102,16 @@ function prep_menu(active_id, main_menu)
102 return { items = items, active = active_item } 102 return { items = items, active = active_item }
103end 103end
104 104
105function process_pages(global, pages_by_id) 105function process_pages(global, order, pages_by_id)
106 if not pages_by_id then return nil end 106 if not pages_by_id then return nil end
107 107
108 local pages_all = pandoc.List() 108 local pages_all = pandoc.List()
109 local pages_asc_title = pandoc.List() 109 local pages_date_desc = pandoc.List()
110 local pages_desc_date = pandoc.List()
111 110
112 for _, page in pairs(pages_by_id) do 111 for _, page in pairs(pages_by_id) do
113 local p = process(global, page) 112 local p = process(global, page)
114 pages_all:insert(p) 113 pages_all:insert(p)
115 pages_asc_title:insert(p) 114 if p.date then pages_date_desc:insert(p) end
116 if p.date then pages_desc_date:insert(p) end
117 end 115 end
118 116
119 pages_all:sort(function(p1, p2) 117 pages_all:sort(function(p1, p2)
@@ -125,20 +123,22 @@ function process_pages(global, pages_by_id)
125 end 123 end
126 elseif p2.position then 124 elseif p2.position then
127 return false 125 return false
128 elseif p1.date then 126 elseif order == "date_desc" then
129 if p2.date then 127 if p1.date then
130 return p1.date.yyyy_mm_dd > p2.date.yyyy_mm_dd 128 if p2.date then
129 return p1.date.yyyy_mm_dd > p2.date.yyyy_mm_dd
130 else
131 return true
132 end
131 else 133 else
132 return true 134 return false
133 end 135 end
134 elseif p2.date then
135 return false
136 else 136 else
137 return p1.title < p2.title 137 return p1.title < p2.title
138 end 138 end
139 end) 139 end)
140 140
141 pages_desc_date:sort(function(p1, p2) 141 pages_date_desc:sort(function(p1, p2)
142 if p1.position then 142 if p1.position then
143 if p2.position then 143 if p2.position then
144 return tonumber(p1.position) < tonumber(p2.position) 144 return tonumber(p1.position) < tonumber(p2.position)
@@ -150,26 +150,7 @@ function process_pages(global, pages_by_id)
150 end 150 end
151 end) 151 end)
152 152
153 pages_asc_title:sort(function(p1, p2) 153 local pages_data = { all = pages_all, date_desc = pages_date_desc, by_id = pages_by_id }
154 if p1.position then
155 if p2.position then
156 return tonumber(p1.position) < tonumber(p2.position)
157 else
158 return true
159 end
160 elseif p2.position then
161 return false
162 else
163 return p1.title < p2.title
164 end
165 end)
166
167 local pages_data = {
168 all = pages_all,
169 desc_date = pages_desc_date,
170 asc_title = pages_asc_title,
171 by_id = pages_by_id,
172 }
173 154
174 return pages_data 155 return pages_data
175end 156end
@@ -196,7 +177,7 @@ function process(global, meta)
196 meta.layout = resolve_layout(meta.layout) 177 meta.layout = resolve_layout(meta.layout)
197 meta.url = resolve_url(global.site.url, global.file_out, meta.file_out) 178 meta.url = resolve_url(global.site.url, global.file_out, meta.file_out)
198 meta.title = (meta.title and titlecase(pandoc.utils.stringify(meta.title))) or "" 179 meta.title = (meta.title and titlecase(pandoc.utils.stringify(meta.title))) or ""
199 180 if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end
200 if meta.position then meta.position = pandoc.utils.stringify(meta.position) end 181 if meta.position then meta.position = pandoc.utils.stringify(meta.position) end
201 182
202 if meta.create_feed then 183 if meta.create_feed then
@@ -222,18 +203,18 @@ function process(global, meta)
222 meta.menus.main = prep_menu(meta.namespace.root.id, meta.menus.main) 203 meta.menus.main = prep_menu(meta.namespace.root.id, meta.menus.main)
223 end 204 end
224 205
225 meta.pages = process_pages(global, meta.pages) 206 meta.pages = process_pages(global, meta.list_order, meta.pages)
226 207
227 if meta.date then 208 if meta.date then
228 meta.date = format_date(meta.date) 209 meta.date = format_date(meta.date)
229 elseif meta.pages and #meta.pages.desc_date ~= 0 then 210 elseif meta.pages and #meta.pages.date_desc ~= 0 then
230 meta.date = meta.pages.desc_date[1].date 211 meta.date = meta.pages.date_desc[1].date
231 end 212 end
232 213
233 if meta.last_update then 214 if meta.last_update then
234 meta.last_update = format_date(meta.last_update) 215 meta.last_update = format_date(meta.last_update)
235 elseif meta.pages and #meta.pages.desc_date ~= 0 then 216 elseif meta.pages and #meta.pages.date_desc ~= 0 then
236 meta.last_update = meta.pages.desc_date[1].last_update 217 meta.last_update = meta.pages.date_desc[1].last_update
237 elseif meta.date then 218 elseif meta.date then
238 meta.last_update = meta.date 219 meta.last_update = meta.date
239 end 220 end
diff --git a/templates/base.html b/templates/base.html
index 6573dc5..6424447 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -23,7 +23,7 @@
23 <link href="$feed.url.rel$" type="application/atom+xml" rel="alternate" title="$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$" /> 23 <link href="$feed.url.rel$" type="application/atom+xml" rel="alternate" title="$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$" />
24 $endif$ 24 $endif$
25 $if(layout.is_categorized_list)$ 25 $if(layout.is_categorized_list)$
26 $for(pages.asc_title)$ 26 $for(pages.all)$
27 $if(it.feed)$ 27 $if(it.feed)$
28 <link href="$it.feed.url.rel$" type="application/atom+xml" rel="alternate" title="$it.title$ – $site.title$" /> 28 <link href="$it.feed.url.rel$" type="application/atom+xml" rel="alternate" title="$it.title$ – $site.title$" />
29 $endif$ 29 $endif$
@@ -47,7 +47,7 @@
47 <header class="c-header"> 47 <header class="c-header">
48 <nav class="c-header__nav"> 48 <nav class="c-header__nav">
49 <a class="c-header__item c-header__item--icon" href="/" title="$site.title$"> 49 <a class="c-header__item c-header__item--icon" href="/" title="$site.title$">
50 <svg class="c-header__icon"> 50 <svg class="c-header__icon" width="1em" height="1em">
51 <use href="/symbols.svg#logo"></use> 51 <use href="/symbols.svg#logo"></use>
52 </svg> 52 </svg>
53 </a> 53 </a>
diff --git a/templates/feed.xml b/templates/feed.xml
index 8a16804..22a86ac 100644
--- a/templates/feed.xml
+++ b/templates/feed.xml
@@ -15,13 +15,13 @@
15 $endfor$ 15 $endfor$
16 16
17 $if(layout.is_categorized_list)$ 17 $if(layout.is_categorized_list)$
18 $for(pages.desc_date)$ 18 $for(pages.date_desc)$
19 $for(it.pages.desc_date)$ 19 $for(it.pages.date_desc)$
20 $it:feed_entry()$ 20 $it:feed_entry()$
21 $endfor$ 21 $endfor$
22 $endfor$ 22 $endfor$
23 $else$ 23 $else$
24 $for(pages.desc_date)$ 24 $for(pages.date_desc)$
25 $it:feed_entry()$ 25 $it:feed_entry()$
26 $endfor$ 26 $endfor$
27 $endif$ 27 $endif$
diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html
index fa0f000..f8c3fab 100644
--- a/templates/layouts/categorized_list.html
+++ b/templates/layouts/categorized_list.html
@@ -6,26 +6,26 @@ $body$
6 </div> 6 </div>
7 7
8 <div class="c-card-list"> 8 <div class="c-card-list">
9 $for(pages.asc_title)$ 9 $for(pages.all)$
10 $if(it.pages)$ 10 $if(it.pages)$
11 <h2 class="c-card-list__category-header"> 11 <h2 class="c-card-list__category-header">
12 <a href="$it.url.rel$">$it.title$</a> 12 <a href="$it.url.rel$">$it.title$</a>
13 </h2> 13 </h2>
14 <div class="c-card-list__category-content$if(pages.asc_title.list_grid)$ c-card-list__category-content--grid$endif$"> 14 <div class="c-card-list__category-content$if(it.list_grid)$ c-card-list__category-content--grid$endif$">
15 $if(pages.asc_title.show_dates)$ 15 $for(it.pages.all)$
16 $for(it.pages.desc_date)$ 16 <a href="$it.url.rel$" class="c-card-list__card c-card">
17 <a href="$it.url.rel$" class="c-card-list__card c-card"> 17 $if(pages.all.show_read_indicators)$
18 $if(pages.asc_title.show_read_indicators)$ 18 <div class="c-card__block c-card__block--indicator"></div>
19 <div class="c-card__block c-card__block--indicator"></div> 19 $endif$
20 $endif$ 20 $if(pages.all.icon)$
21 $if(pages.asc_title.icon)$ 21 <svg class="c-card__block o-icon" width="1em" height="1em">
22 <svg class="c-card__block o-icon"> 22 <use href="/symbols.svg#icon-$pages.all.icon$"></use>
23 <use href="/symbols.svg#icon-$pages.asc_title.icon$"></use> 23 </svg>
24 </svg> 24 $endif$
25 $endif$ 25 <div class="c-card__block c-card__block--main">
26 <div class="c-card__block c-card__block--main"> 26 $it.title$
27 $it.title$ 27 </div>
28 </div> 28 $if(it.date)$
29 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> 29 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0">
30 <small class="u-dn@sm-hi"> 30 <small class="u-dn@sm-hi">
31 $it.date.short$ 31 $it.date.short$
@@ -34,25 +34,9 @@ $body$
34 $it.date.long$ 34 $it.date.long$
35 </small> 35 </small>
36 </time> 36 </time>
37 </a> 37 $endif$
38 $endfor$ 38 </a>
39 $else$ 39 $endfor$
40 $for(it.pages.asc_title)$
41 <a href="$it.url.rel$" class="c-card-list__card c-card">
42 $if(pages.asc_title.show_read_indicators)$
43 <div class="c-card__block c-card__block--indicator"></div>
44 $endif$
45 $if(pages.asc_title.icon)$
46 <svg class="c-card__block o-icon">
47 <use href="/symbols.svg#icon-$pages.asc_title.icon$"></use>
48 </svg>
49 $endif$
50 <div class="c-card__block c-card__block--main">
51 $it.title$
52 </div>
53 </a>
54 $endfor$
55 $endif$
56 </div> 40 </div>
57 $endif$ 41 $endif$
58 $endfor$ 42 $endfor$
diff --git a/templates/layouts/index.html b/templates/layouts/index.html
index 8822f6f..1eca10f 100644
--- a/templates/layouts/index.html
+++ b/templates/layouts/index.html
@@ -18,7 +18,7 @@ $body$
18 <div class="c-card-list__card c-card"> 18 <div class="c-card-list__card c-card">
19 $endif$ 19 $endif$
20 $if(it.icon)$ 20 $if(it.icon)$
21 <svg class="c-card__block o-icon"> 21 <svg class="c-card__block o-icon" width="1em" height="1em">
22 <use href="/symbols.svg#icon-$it.icon$"></use> 22 <use href="/symbols.svg#icon-$it.icon$"></use>
23 </svg> 23 </svg>
24 $endif$ 24 $endif$
@@ -27,7 +27,7 @@ $body$
27 <small class="u-db">$it.username$</small> 27 <small class="u-db">$it.username$</small>
28 </div> 28 </div>
29 $if(it.url)$ 29 $if(it.url)$
30 <svg class="c-card__block o-icon"> 30 <svg class="c-card__block o-icon" width="1em" height="1em">
31 <use href="/symbols.svg#icon-arrow-up-right"></use> 31 <use href="/symbols.svg#icon-arrow-up-right"></use>
32 </svg> 32 </svg>
33 $endif$ 33 $endif$
@@ -48,7 +48,7 @@ $body$
48 $for(it.pages.all)$ 48 $for(it.pages.all)$
49 <a href="$it.url.rel$" class="c-card-list__card c-card"> 49 <a href="$it.url.rel$" class="c-card-list__card c-card">
50 $if(pages.by_id.projects.pages.all.icon)$ 50 $if(pages.by_id.projects.pages.all.icon)$
51 <svg class="c-card__block o-icon"> 51 <svg class="c-card__block o-icon" width="1em" height="1em">
52 <use href="/symbols.svg#icon-$pages.by_id.projects.pages.all.icon$"></use> 52 <use href="/symbols.svg#icon-$pages.by_id.projects.pages.all.icon$"></use>
53 </svg> 53 </svg>
54 $endif$ 54 $endif$
@@ -56,7 +56,7 @@ $body$
56 <small class="u-db">$pages.by_id.projects.pages.all.title$</small> 56 <small class="u-db">$pages.by_id.projects.pages.all.title$</small>
57 <strong class="u-db">$it.title$</strong> 57 <strong class="u-db">$it.title$</strong>
58 </div> 58 </div>
59 <svg class="c-card__block o-icon"> 59 <svg class="c-card__block o-icon" width="1em" height="1em">
60 <use href="/symbols.svg#icon-arrow-right"></use> 60 <use href="/symbols.svg#icon-arrow-right"></use>
61 </svg> 61 </svg>
62 </a> 62 </a>
diff --git a/templates/layouts/list.html b/templates/layouts/list.html
index c0045c0..208b267 100644
--- a/templates/layouts/list.html
+++ b/templates/layouts/list.html
@@ -7,20 +7,20 @@ $body$
7 7
8 <div class="c-card-list"> 8 <div class="c-card-list">
9 <div class="c-card-list__category-content$if(list_grid)$ c-card-list__category-content--grid$endif$"> 9 <div class="c-card-list__category-content$if(list_grid)$ c-card-list__category-content--grid$endif$">
10 $if(show_dates)$ 10 $for(pages.all)$
11 $for(pages.desc_date)$ 11 <a href="$it.url.rel$" class="c-card-list__card c-card">
12 <a href="$it.url.rel$" class="c-card-list__card c-card"> 12 $if(show_read_indicators)$
13 $if(show_read_indicators)$ 13 <div class="c-card__block c-card__block--indicator"></div>
14 <div class="c-card__block c-card__block--indicator"></div> 14 $endif$
15 $endif$ 15 $if(icon)$
16 $if(icon)$ 16 <svg class="c-card__block o-icon">
17 <svg class="c-card__block o-icon"> 17 <use href="/symbols.svg#icon-$icon$"></use>
18 <use href="/symbols.svg#icon-$icon$"></use> 18 </svg>
19 </svg> 19 $endif$
20 $endif$ 20 <div class="c-card__block c-card__block--main">
21 <div class="c-card__block c-card__block--main"> 21 $it.title$
22 $it.title$ 22 </div>
23 </div> 23 $if(it.date)$
24 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0"> 24 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__block u-fs0">
25 <small class="u-dn@sm-hi"> 25 <small class="u-dn@sm-hi">
26 $it.date.short$ 26 $it.date.short$
@@ -29,25 +29,9 @@ $body$
29 $it.date.long$ 29 $it.date.long$
30 </small> 30 </small>
31 </time> 31 </time>
32 </a> 32 $endif$
33 $endfor$ 33 </a>
34 $else$ 34 $endfor$
35 $for(pages.asc_title)$
36 <a href="$it.url.rel$" class="c-card-list__card c-card">
37 $if(show_read_indicators)$
38 <div class="c-card__block c-card__block--indicator"></div>
39 $endif$
40 $if(icon)$
41 <svg class="c-card__block o-icon">
42 <use href="/symbols.svg#icon-$icon$"></use>
43 </svg>
44 $endif$
45 <div class="c-card__block c-card__block--main">
46 $it.title$
47 </div>
48 </a>
49 $endfor$
50 $endif$
51 </div> 35 </div>
52 </div> 36 </div>
53</section> 37</section>
diff --git a/templates/layouts/page.html b/templates/layouts/page.html
index e406d99..f1060ca 100644
--- a/templates/layouts/page.html
+++ b/templates/layouts/page.html
@@ -1,6 +1,6 @@
1<div class="s-body"> 1<div class="s-body">
2 <section class="l-container l-container--pad-x l-container--pad-y l-container--content s-colored-links s-headlines"> 2 <section class="l-container l-container--pad-x l-container--pad-y l-container--content s-colored-links s-headlines">
3 $if(show_date)$ 3 $if(date)$
4 <div class="s-body__meta"> 4 <div class="s-body__meta">
5 $date.long$ 5 $date.long$
6 </div> 6 </div>