From 2f7456dfd400edfba4090bf3adfcaf3769b4ec85 Mon Sep 17 00:00:00 2001 From: s-ol Date: Sat, 24 Nov 2018 18:11:26 +1100 Subject: show dates in blog --- mmm/mmmfs/conversion.moon | 10 +++++++++- root/blog/automating_my_rice/date: date$iso-8601 | 1 - root/blog/automating_my_rice/date: time$iso8601-date | 1 + root/blog/challenging_myself/date: date$iso-8601 | 1 - root/blog/challenging_myself/date: time$iso8601-date | 1 + root/blog/clocks_triggers_gates/date: date$iso-8601 | 1 - root/blog/clocks_triggers_gates/date: time$iso8601-date | 1 + root/blog/humane_filesystems/date: date$iso-8601 | 1 - root/blog/humane_filesystems/date: time$iso8601-date | 1 + root/blog/humane_filesystems/hidden: text$lua -> bool.lua | 1 + root/blog/love_lua_photoshop_and_games/date: date$iso-8601 | 1 - .../love_lua_photoshop_and_games/date: time$iso8601-date | 1 + root/blog/ludum_dare_33_postmortem/date: date$iso-8601 | 1 - root/blog/ludum_dare_33_postmortem/date: time$iso8601-date | 1 + root/blog/stencils_101/date: date$iso-8601 | 1 - root/blog/stencils_101/date: time$iso8601-date | 1 + root/blog/stretching_gates/date: date$iso-8601 | 1 - root/blog/stretching_gates/date: time$iso8601-date | 1 + root/blog/text$moonscript -> fn -> mmm$dom.moon | 12 +++++++++--- root/blog/video_synth_research/date: date$iso-8601 | 1 - root/blog/video_synth_research/date: time$iso8601-date | 1 + 21 files changed, 28 insertions(+), 13 deletions(-) delete mode 100644 root/blog/automating_my_rice/date: date$iso-8601 create mode 100644 root/blog/automating_my_rice/date: time$iso8601-date delete mode 100644 root/blog/challenging_myself/date: date$iso-8601 create mode 100644 root/blog/challenging_myself/date: time$iso8601-date delete mode 100644 root/blog/clocks_triggers_gates/date: date$iso-8601 create mode 100644 root/blog/clocks_triggers_gates/date: time$iso8601-date delete mode 100644 root/blog/humane_filesystems/date: date$iso-8601 create mode 100644 root/blog/humane_filesystems/date: time$iso8601-date create mode 100644 root/blog/humane_filesystems/hidden: text$lua -> bool.lua delete mode 100644 root/blog/love_lua_photoshop_and_games/date: date$iso-8601 create mode 100644 root/blog/love_lua_photoshop_and_games/date: time$iso8601-date delete mode 100644 root/blog/ludum_dare_33_postmortem/date: date$iso-8601 create mode 100644 root/blog/ludum_dare_33_postmortem/date: time$iso8601-date delete mode 100644 root/blog/stencils_101/date: date$iso-8601 create mode 100644 root/blog/stencils_101/date: time$iso8601-date delete mode 100644 root/blog/stretching_gates/date: date$iso-8601 create mode 100644 root/blog/stretching_gates/date: time$iso8601-date delete mode 100644 root/blog/video_synth_research/date: date$iso-8601 create mode 100644 root/blog/video_synth_research/date: time$iso8601-date diff --git a/mmm/mmmfs/conversion.moon b/mmm/mmmfs/conversion.moon index 4f0eb0c..4df3497 100644 --- a/mmm/mmmfs/conversion.moon +++ b/mmm/mmmfs/conversion.moon @@ -65,13 +65,21 @@ converts = { out: '%1', transform: (source, fileder) -> source\gsub '{{(.-)}}', (expr) -> - path, facet = expr\match '^([%w-_/]*)%+(.*)' + path, facet = expr\match '^([%w%-_%./]*)%+(.*)' assert path, "couldn't match TPL expression '#{expr}'" target = fileder\walk "#{fileder.path}/#{path}" assert target, "couldn't resolve rpath '#{path}' relative to #{fileder}" target\gett facet + }, + { + inp: 'time/iso8601-date', + out: 'time/unix', + transform: (val) -> + year, _, month, day = val\match '^%s*(%d%d%d%d)(%-?)([01]%d)%2([0-3]%d)%s*$' + assert year, "failed to parse ISO 8601 date: '#{val}'" + os.time :year, :month, :day } } diff --git a/root/blog/automating_my_rice/date: date$iso-8601 b/root/blog/automating_my_rice/date: date$iso-8601 deleted file mode 100644 index 0f2e9ac..0000000 --- a/root/blog/automating_my_rice/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2015-08-08 06:00:00 \ No newline at end of file diff --git a/root/blog/automating_my_rice/date: time$iso8601-date b/root/blog/automating_my_rice/date: time$iso8601-date new file mode 100644 index 0000000..f54d08b --- /dev/null +++ b/root/blog/automating_my_rice/date: time$iso8601-date @@ -0,0 +1 @@ +2015-08-08 diff --git a/root/blog/challenging_myself/date: date$iso-8601 b/root/blog/challenging_myself/date: date$iso-8601 deleted file mode 100644 index 7e482c1..0000000 --- a/root/blog/challenging_myself/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2015-06-27 21:00:00 \ No newline at end of file diff --git a/root/blog/challenging_myself/date: time$iso8601-date b/root/blog/challenging_myself/date: time$iso8601-date new file mode 100644 index 0000000..6472c5d --- /dev/null +++ b/root/blog/challenging_myself/date: time$iso8601-date @@ -0,0 +1 @@ +2015-06-27 diff --git a/root/blog/clocks_triggers_gates/date: date$iso-8601 b/root/blog/clocks_triggers_gates/date: date$iso-8601 deleted file mode 100644 index 6b79603..0000000 --- a/root/blog/clocks_triggers_gates/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2017-06-28 06:00:00 \ No newline at end of file diff --git a/root/blog/clocks_triggers_gates/date: time$iso8601-date b/root/blog/clocks_triggers_gates/date: time$iso8601-date new file mode 100644 index 0000000..19880e9 --- /dev/null +++ b/root/blog/clocks_triggers_gates/date: time$iso8601-date @@ -0,0 +1 @@ +2017-06-28 diff --git a/root/blog/humane_filesystems/date: date$iso-8601 b/root/blog/humane_filesystems/date: date$iso-8601 deleted file mode 100644 index 567e17d..0000000 --- a/root/blog/humane_filesystems/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2018-02-28 06:00:00 \ No newline at end of file diff --git a/root/blog/humane_filesystems/date: time$iso8601-date b/root/blog/humane_filesystems/date: time$iso8601-date new file mode 100644 index 0000000..1c1707a --- /dev/null +++ b/root/blog/humane_filesystems/date: time$iso8601-date @@ -0,0 +1 @@ +2018-02-28 diff --git a/root/blog/humane_filesystems/hidden: text$lua -> bool.lua b/root/blog/humane_filesystems/hidden: text$lua -> bool.lua new file mode 100644 index 0000000..b30e187 --- /dev/null +++ b/root/blog/humane_filesystems/hidden: text$lua -> bool.lua @@ -0,0 +1 @@ +return true diff --git a/root/blog/love_lua_photoshop_and_games/date: date$iso-8601 b/root/blog/love_lua_photoshop_and_games/date: date$iso-8601 deleted file mode 100644 index 9b13af5..0000000 --- a/root/blog/love_lua_photoshop_and_games/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2016-05-29 06:00:00 \ No newline at end of file diff --git a/root/blog/love_lua_photoshop_and_games/date: time$iso8601-date b/root/blog/love_lua_photoshop_and_games/date: time$iso8601-date new file mode 100644 index 0000000..de2136d --- /dev/null +++ b/root/blog/love_lua_photoshop_and_games/date: time$iso8601-date @@ -0,0 +1 @@ +2016-05-29 diff --git a/root/blog/ludum_dare_33_postmortem/date: date$iso-8601 b/root/blog/ludum_dare_33_postmortem/date: date$iso-8601 deleted file mode 100644 index c6b5f3d..0000000 --- a/root/blog/ludum_dare_33_postmortem/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2015-08-25 06:00:00 \ No newline at end of file diff --git a/root/blog/ludum_dare_33_postmortem/date: time$iso8601-date b/root/blog/ludum_dare_33_postmortem/date: time$iso8601-date new file mode 100644 index 0000000..9e7bf47 --- /dev/null +++ b/root/blog/ludum_dare_33_postmortem/date: time$iso8601-date @@ -0,0 +1 @@ +2015-08-25 diff --git a/root/blog/stencils_101/date: date$iso-8601 b/root/blog/stencils_101/date: date$iso-8601 deleted file mode 100644 index 8fb1e1b..0000000 --- a/root/blog/stencils_101/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2015-06-29 06:00:00 \ No newline at end of file diff --git a/root/blog/stencils_101/date: time$iso8601-date b/root/blog/stencils_101/date: time$iso8601-date new file mode 100644 index 0000000..0202ff1 --- /dev/null +++ b/root/blog/stencils_101/date: time$iso8601-date @@ -0,0 +1 @@ +2015-06-29 diff --git a/root/blog/stretching_gates/date: date$iso-8601 b/root/blog/stretching_gates/date: date$iso-8601 deleted file mode 100644 index ce5acc7..0000000 --- a/root/blog/stretching_gates/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2017-07-04 06:00:00 \ No newline at end of file diff --git a/root/blog/stretching_gates/date: time$iso8601-date b/root/blog/stretching_gates/date: time$iso8601-date new file mode 100644 index 0000000..1f26b82 --- /dev/null +++ b/root/blog/stretching_gates/date: time$iso8601-date @@ -0,0 +1 @@ +2017-07-04 diff --git a/root/blog/text$moonscript -> fn -> mmm$dom.moon b/root/blog/text$moonscript -> fn -> mmm$dom.moon index 6657529..100a9b7 100644 --- a/root/blog/text$moonscript -> fn -> mmm$dom.moon +++ b/root/blog/text$moonscript -> fn -> mmm$dom.moon @@ -1,10 +1,16 @@ import div, h3, ul, li from require 'mmm.dom' +import opairs from require 'mmm.ordered' import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom' => div { h3 link_to @ - ul for child in *@children - -- desc = child\gett 'description: mmm/dom' - li (link_to child), nil -- ': ', desc + ul do + posts = { (p\gett 'date: time/unix'), p for p in *@children } + + posts = for date, post in opairs posts + continue if post\get 'hidden: bool' + li (link_to post, os.date '%F', date), ' - ', post\gett 'title: mmm/dom' + + posts } diff --git a/root/blog/video_synth_research/date: date$iso-8601 b/root/blog/video_synth_research/date: date$iso-8601 deleted file mode 100644 index b5f80a1..0000000 --- a/root/blog/video_synth_research/date: date$iso-8601 +++ /dev/null @@ -1 +0,0 @@ -2017-06-26 06:00:00 \ No newline at end of file diff --git a/root/blog/video_synth_research/date: time$iso8601-date b/root/blog/video_synth_research/date: time$iso8601-date new file mode 100644 index 0000000..c3cf071 --- /dev/null +++ b/root/blog/video_synth_research/date: time$iso8601-date @@ -0,0 +1 @@ +2017-06-26 -- cgit v1.2.3