summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--assets/css/_basics.scss5
-rw-r--r--assets/css/_vars.scss4
-rw-r--r--assets/css/components/_footer.scss2
-rw-r--r--assets/css/components/_post-list.scss5
-rw-r--r--content/9thPK7O3xn/dreams/index.md8
-rw-r--r--content/9thPK7O3xn/index.md2
-rw-r--r--content/9thPK7O3xn/misc/index.md6
-rw-r--r--content/9thPK7O3xn/posts/index.md6
-rw-r--r--scripts/metadata_filter.lua81
-rw-r--r--templates/base.html10
-rw-r--r--templates/feed.xml6
-rw-r--r--templates/feed_entry.xml58
-rw-r--r--templates/layouts/categorized_list.html28
-rw-r--r--templates/layouts/list.html41
-rw-r--r--templates/layouts/page.html2
16 files changed, 175 insertions, 91 deletions
diff --git a/Makefile b/Makefile
index b2fcd6c..651401a 100644
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,7 @@ out/%.css: assets/css/%.scss $(CSS_SRC) | out
125 125
126 sassc -t compressed "$<" | ./node_modules/.bin/postcss --use autoprefixer --no-map > "$@" 126 sassc -t compressed "$<" | ./node_modules/.bin/postcss --use autoprefixer --no-map > "$@"
127 127
128.cache/meta: .cache 128.cache/meta: | .cache
129 mkdir -p .cache/meta 129 mkdir -p .cache/meta
130 130
131.cache: 131.cache:
diff --git a/assets/css/_basics.scss b/assets/css/_basics.scss
index 9a6a53e..fd15836 100644
--- a/assets/css/_basics.scss
+++ b/assets/css/_basics.scss
@@ -39,6 +39,11 @@ body {
39 padding: 0; 39 padding: 0;
40} 40}
41 41
42main {
43 display: flex;
44 flex-direction: column;
45}
46
42pre, 47pre,
43code { 48code {
44 font-family: $font-fam--mono; 49 font-family: $font-fam--mono;
diff --git a/assets/css/_vars.scss b/assets/css/_vars.scss
index 4dc709b..bf2097e 100644
--- a/assets/css/_vars.scss
+++ b/assets/css/_vars.scss
@@ -39,7 +39,7 @@ $content--width: 42rem;
39 --outer: 4rem, 39 --outer: 4rem,
40 --indent: 2rem, 40 --indent: 2rem,
41 41
42 --obj-shadow: 0 .4em 3.5em, 42 --obj-shadow: 0 .4em 2.8em,
43 ), 43 ),
44 --colors: ( 44 --colors: (
45 --bg-hi: $gray0, // Darker background 45 --bg-hi: $gray0, // Darker background
@@ -76,7 +76,7 @@ $content--width: 42rem;
76 --idle: var(--colors--fg-lo), 76 --idle: var(--colors--fg-lo),
77 --colored: ( 77 --colored: (
78 --idle: hsl(220, 100%, 80%), //hsl(var(--colors--accent--h), 100%, 66%), // 78 --idle: hsl(220, 100%, 80%), //hsl(var(--colors--accent--h), 100%, 66%), //
79 --visited: hsl(290, 35%, 75%), //hsl(var(--colors--accent--h), 50%, 66%), // 79 --visited: hsl(290, 35%, 72%), //hsl(var(--colors--accent--h), 50%, 66%), //
80 ) 80 )
81 ), 81 ),
82 82
diff --git a/assets/css/components/_footer.scss b/assets/css/components/_footer.scss
index 3705b79..cc0e827 100644
--- a/assets/css/components/_footer.scss
+++ b/assets/css/components/_footer.scss
@@ -9,7 +9,9 @@
9 9
10 @include component(namespace()) { 10 @include component(namespace()) {
11 position: relative; 11 position: relative;
12 flex: 0 0 auto;
12 min-height: prop(--dims --outer, $global: true); 13 min-height: prop(--dims --outer, $global: true);
14 margin-top: auto;
13 overflow: hidden; 15 overflow: hidden;
14 background-color: prop(--colors --bg); 16 background-color: prop(--colors --bg);
15 color: prop(--colors --fg); 17 color: prop(--colors --fg);
diff --git a/assets/css/components/_post-list.scss b/assets/css/components/_post-list.scss
index 03b5e7a..ba4c5af 100644
--- a/assets/css/components/_post-list.scss
+++ b/assets/css/components/_post-list.scss
@@ -15,8 +15,11 @@
15 )); 15 ));
16 16
17 @include component(namespace()) { 17 @include component(namespace()) {
18 margin-top: $line-height * 2rem;
19
18 @include element('category-header') { 20 @include element('category-header') {
19 color: prop(--colors --cat --fg); 21 margin-top: $line-height * 2rem;
22 color: prop(--colors --cat --fg);
20 } 23 }
21 24
22 @include element('category-content') { 25 @include element('category-content') {
diff --git a/content/9thPK7O3xn/dreams/index.md b/content/9thPK7O3xn/dreams/index.md
index fbe9a45..db7be1c 100644
--- a/content/9thPK7O3xn/dreams/index.md
+++ b/content/9thPK7O3xn/dreams/index.md
@@ -1,5 +1,7 @@
1--- 1---
2title: Dream Journal 2title: Dream Journal
3show_dates: true 3show_dates: true
4position: 9 4position: 9
5layout: list
6create_feed: true
5--- 7---
diff --git a/content/9thPK7O3xn/index.md b/content/9thPK7O3xn/index.md
index 47e789b..0b14fcf 100644
--- a/content/9thPK7O3xn/index.md
+++ b/content/9thPK7O3xn/index.md
@@ -5,4 +5,4 @@ create_feed: true
5--- 5---
6 6
7Welcome to the personal section of my website! 7Welcome to the personal section of my website!
8Here you will find content that doesn't belong in the public sections of my website, such as test pages for development purposes or content that's too personal in nature. 8Here you will find content that doesn't belong in the public sections of my website, such as layout and design tests or pages about more personal topics.
diff --git a/content/9thPK7O3xn/misc/index.md b/content/9thPK7O3xn/misc/index.md
index 0fc9e44..0d79d44 100644
--- a/content/9thPK7O3xn/misc/index.md
+++ b/content/9thPK7O3xn/misc/index.md
@@ -1,4 +1,6 @@
1--- 1---
2title: Other stuff 2title: Other stuff
3position: 10 3position: 10
4layout: list
5create_feed: true
4--- 6---
diff --git a/content/9thPK7O3xn/posts/index.md b/content/9thPK7O3xn/posts/index.md
index 592e730..eb2fb08 100644
--- a/content/9thPK7O3xn/posts/index.md
+++ b/content/9thPK7O3xn/posts/index.md
@@ -1,4 +1,6 @@
1--- 1---
2title: Posts 2title: Posts
3position: 0 3position: 0
4layout: list
5create_feed: true
4--- 6---
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua
index 895139d..3bea687 100644
--- a/scripts/metadata_filter.lua
+++ b/scripts/metadata_filter.lua
@@ -106,11 +106,18 @@ end
106function process_pages(global, pages_by_id) 106function process_pages(global, pages_by_id)
107 if not pages_by_id then return nil end 107 if not pages_by_id then return nil end
108 108
109 local pages_list = pandoc.List() 109 local pages_all = pandoc.List()
110 110 local pages_asc_title = pandoc.List()
111 for _, page in pairs(pages_by_id) do pages_list:insert(process(global, page)) end 111 local pages_desc_date = pandoc.List()
112
113 for _, page in pairs(pages_by_id) do
114 local p = process(global, page)
115 pages_all:insert(p)
116 pages_asc_title:insert(p)
117 if p.date then pages_desc_date:insert(p) end
118 end
112 119
113 pages_list:sort(function(p1, p2) 120 pages_all:sort(function(p1, p2)
114 if p1.position then 121 if p1.position then
115 if p2.position then 122 if p2.position then
116 return tonumber(p1.position) < tonumber(p2.position) 123 return tonumber(p1.position) < tonumber(p2.position)
@@ -132,36 +139,40 @@ function process_pages(global, pages_by_id)
132 end 139 end
133 end) 140 end)
134 141
135 local pages_by_category = pages_list:filter(function(p) return p.category ~= nil end) 142 pages_desc_date:sort(function(p1, p2)
136 pages_by_category = group_by(pages_by_category, function(p) return p.category.id end, 143 if p1.position then
137 function(data, _, p) 144 if p2.position then
138 if not data then 145 return tonumber(p1.position) < tonumber(p2.position)
139 local l = pandoc.List()
140 l:insert(p)
141 return { name = pandoc.utils.stringify(p.category.name), pages = l }
142 else 146 else
143 data.pages:insert(p) 147 return true
144 end 148 end
145 end) 149 else
146 pages_by_category = table_to_list(pages_by_category, false, 150 return p1.date.yyyy_mm_dd > p2.date.yyyy_mm_dd
147 function(i1, i2) return i1.name < i2.name end) 151 end
148 152 end)
149 local pages_data = { all = pages_list, by_id = pages_by_id, by_category = pages_by_category }
150
151 return pages_data
152end
153
154function pages_last_update(all_pages)
155 local last_update = format_date("1990-01-01")
156 153
157 for i = 1, #all_pages do 154 pages_asc_title:sort(function(p1, p2)
158 local page = all_pages[i] 155 if p1.position then
159 if page.last_update and page.last_update.yyyy_mm_dd > last_update.yyyy_mm_dd then 156 if p2.position then
160 last_update = page.last_update 157 return tonumber(p1.position) < tonumber(p2.position)
158 else
159 return true
160 end
161 elseif p2.position then
162 return false
163 else
164 return p1.title < p2.title
161 end 165 end
162 end 166 end)
167
168 local pages_data = {
169 all = pages_all,
170 desc_date = pages_desc_date,
171 asc_title = pages_asc_title,
172 by_id = pages_by_id,
173 }
163 174
164 return last_update 175 return pages_data
165end 176end
166 177
167local titlecase_exceptions = pandoc.List({ 178local titlecase_exceptions = pandoc.List({
@@ -208,20 +219,24 @@ function process(global, meta)
208 meta.preview = resolve_url(global.site.url, global.file_out, meta.preview) 219 meta.preview = resolve_url(global.site.url, global.file_out, meta.preview)
209 end 220 end
210 221
211 if meta.date then meta.date = format_date(meta.date) end
212
213 if meta.menus and meta.menus.main then 222 if meta.menus and meta.menus.main then
214 meta.menus.main = prep_menu(meta.namespace.root.id, meta.menus.main) 223 meta.menus.main = prep_menu(meta.namespace.root.id, meta.menus.main)
215 end 224 end
216 225
217 meta.pages = process_pages(global, meta.pages) 226 meta.pages = process_pages(global, meta.pages)
218 227
228 if meta.date then
229 meta.date = format_date(meta.date)
230 elseif meta.pages and #meta.pages.desc_date ~= 0 then
231 meta.date = meta.pages.desc_date[1].date
232 end
233
219 if meta.last_update then 234 if meta.last_update then
220 meta.last_update = format_date(meta.last_update) 235 meta.last_update = format_date(meta.last_update)
236 elseif meta.pages and #meta.pages.desc_date ~= 0 then
237 meta.last_update = meta.pages.desc_date[1].last_update
221 elseif meta.date then 238 elseif meta.date then
222 meta.last_update = meta.date 239 meta.last_update = meta.date
223 elseif meta.pages then
224 meta.last_update = pages_last_update(meta.pages.all)
225 end 240 end
226 241
227 return meta 242 return meta
diff --git a/templates/base.html b/templates/base.html
index 6c0c4a9..5542401 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -22,6 +22,13 @@
22 $if(feed)$ 22 $if(feed)$
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)$
26 $for(pages.asc_title)$
27 $if(it.feed)$
28 <link href="$it.feed.url.rel$" type="application/atom+xml" rel="alternate" title="$it.title$ – $site.title$" />
29 $endif$
30 $endfor$
31 $endif$
25 32
26 <title>$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$</title> 33 <title>$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$</title>
27 34
@@ -64,11 +71,12 @@
64${layouts/index()} 71${layouts/index()}
65 $elseif(layout.is_categorized_list)$ 72 $elseif(layout.is_categorized_list)$
66${layouts/categorized_list()} 73${layouts/categorized_list()}
74 $elseif(layout.is_list)$
75${layouts/list()}
67 $else$ 76 $else$
68${layouts/page()} 77${layouts/page()}
69 $endif$ 78 $endif$
70 79
71
72 <footer class="c-footer"> 80 <footer class="c-footer">
73 <div class="l-container l-container--pad-y u-pb0"> 81 <div class="l-container l-container--pad-y u-pb0">
74 <pre class="c-footer__ascii u-dn@sm-lo">${layouts/ascii_fox()}</pre> 82 <pre class="c-footer__ascii u-dn@sm-lo">${layouts/ascii_fox()}</pre>
diff --git a/templates/feed.xml b/templates/feed.xml
index d03b73f..8a16804 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.all)$ 18 $for(pages.desc_date)$
19 $for(it.pages.all)$ 19 $for(it.pages.desc_date)$
20 $it:feed_entry()$ 20 $it:feed_entry()$
21 $endfor$ 21 $endfor$
22 $endfor$ 22 $endfor$
23 $else$ 23 $else$
24 $for(pages.all)$ 24 $for(pages.desc_date)$
25 $it:feed_entry()$ 25 $it:feed_entry()$
26 $endfor$ 26 $endfor$
27 $endif$ 27 $endif$
diff --git a/templates/feed_entry.xml b/templates/feed_entry.xml
index 410a257..f8108f6 100644
--- a/templates/feed_entry.xml
+++ b/templates/feed_entry.xml
@@ -1,31 +1,27 @@
1$if(it.last_update)$ 1<entry>
2 <entry> 2 <id>$it.url.full$</id>
3 <id>$it.url.full$</id> 3 <title><![CDATA[$it.title$]]></title>
4 <title><![CDATA[$it.title$]]></title> 4 <link href="$it.url.full$"/>
5 <link href="$it.url.full$"/> 5 <published>$it.date.rfc3339$</published>
6 $if(it.date)$ 6 <updated>$it.last_update.rfc3339$</updated>
7 <published>$it.date.rfc3339$</published> 7 $if(it.author)$
8 $endif$ 8 $for(it.author)$
9 <updated>$it.last_update.rfc3339$</updated> 9 <author>
10 $if(it.author)$ 10 <name>$it.name$</name>
11 $for(it.author)$ 11 $if(it.email)$
12 <author> 12 <email>$it.email$</email>
13 <name>$it.name$</name> 13 $endif$
14 $if(it.email)$ 14 </author>
15 <email>$it.email$</email> 15 $endfor$
16 $endif$ 16 $else$
17 </author> 17 $for(author)$
18 $endfor$ 18 <author>
19 $else$ 19 <name>$author.name$</name>
20 $for(author)$ 20 $if(author.email)$
21 <author> 21 <email>$author.email$</email>
22 <name>$author.name$</name> 22 $endif$
23 $if(author.email)$ 23 </author>
24 <email>$author.email$</email> 24 $endfor$
25 $endif$ 25 $endif$
26 </author> 26 <content type="html"><![CDATA[$it.content$]]></content>
27 $endfor$ 27</entry>
28 $endif$
29 <content type="html"><![CDATA[$it.content$]]></content>
30 </entry>
31$endif$
diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html
index 6e72194..89bea78 100644
--- a/templates/layouts/categorized_list.html
+++ b/templates/layouts/categorized_list.html
@@ -7,18 +7,18 @@ $body$
7 </div> 7 </div>
8 8
9 <div class="c-post-list"> 9 <div class="c-post-list">
10 $for(pages.all)$ 10 $for(pages.asc_title)$
11 $if(it.pages)$ 11 $if(it.pages)$
12 <h2 class="c-post-list__category-header"> 12 <h2 class="c-post-list__category-header">
13 $it.title$ 13 $it.title$
14 </h2> 14 </h2>
15 <div class="c-post-list__category-content"> 15 <div class="c-post-list__category-content">
16 $for(it.pages.all)$ 16 $if(pages.asc_title.show_dates)$
17 <a href="$it.url.rel$" class="c-post-list__post c-card"> 17 $for(it.pages.desc_date)$
18 <div class="c-card__content"> 18 <a href="$it.url.rel$" class="c-post-list__post c-card">
19 $it.title$ 19 <div class="c-card__content">
20 </div> 20 $it.title$
21 $if(pages.all.show_dates)$ 21 </div>
22 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__content u-fs0"> 22 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__content u-fs0">
23 <small class="u-dn@sm-hi"> 23 <small class="u-dn@sm-hi">
24 $it.date.short$ 24 $it.date.short$
@@ -27,9 +27,17 @@ $body$
27 $it.date.long$ 27 $it.date.long$
28 </small> 28 </small>
29 </time> 29 </time>
30 $endif$ 30 </a>
31 </a> 31 $endfor$
32 $endfor$ 32 $else$
33 $for(it.pages.asc_title)$
34 <a href="$it.url.rel$" class="c-post-list__post c-card">
35 <div class="c-card__content">
36 $it.title$
37 </div>
38 </a>
39 $endfor$
40 $endif$
33 </div> 41 </div>
34 $endif$ 42 $endif$
35 $endfor$ 43 $endfor$
diff --git a/templates/layouts/list.html b/templates/layouts/list.html
new file mode 100644
index 0000000..1c6398a
--- /dev/null
+++ b/templates/layouts/list.html
@@ -0,0 +1,41 @@
1<section class="l-section l-section--no-head">
2 <div class="l-container l-container--pad-x l-container--pad-y l-container--content">
3 <div class="s-headlines s-colored-links">
4 <h1 class="u-mt0"><span class="s-headlines__title-inner">$title$</span></h1>
5
6$body$
7 </div>
8
9 <div class="c-post-list">
10 <div class="c-post-list__category-content">
11 $if(show_dates)$
12 $for(pages.desc_date)$
13 <a href="$it.url.rel$" class="c-post-list__post c-card">
14 <div class="c-card__content">
15 $it.title$
16 </div>
17 <time datetime="$it.date.yyyy_mm_dd$" class="c-card__content u-fs0">
18 <small class="u-dn@sm-hi">
19 $it.date.short$
20 </small>
21 <small class="u-dn@sm-lo">
22 $it.date.long$
23 </small>
24 </time>
25 </a>
26 $endfor$
27 $else$
28 $for(pages.asc_title)$
29 <a href="$it.url.rel$" class="c-post-list__post c-card">
30 <div class="c-card__content">
31 $it.title$
32 </div>
33 </a>
34 $endfor$
35 $endif$
36 </div>
37 </div>
38 </div>
39</section>
40
41
diff --git a/templates/layouts/page.html b/templates/layouts/page.html
index 32ceb98..e5781a8 100644
--- a/templates/layouts/page.html
+++ b/templates/layouts/page.html
@@ -1,4 +1,4 @@
1<section class="l-section l-section--fullscreen l-section--no-head l-section--body"> 1<section class="l-section l-section--no-head l-section--body">
2 <div class="l-container l-container--pad-x l-container--pad-y l-container--content s-colored-links s-headlines s-headlines--body s-body"> 2 <div class="l-container l-container--pad-x l-container--pad-y l-container--content s-colored-links s-headlines s-headlines--body s-body">
3 $if(show_date)$ 3 $if(show_date)$
4 <div class="s-body__meta"> 4 <div class="s-body__meta">