all repos — h3rald @ 94f37ff40c1aa48bf11ce003ebb7ede9bd697826

The sources of https://h3rald.com

Implemented /days.
h3rald h3rald@h3rald.com
Mon, 17 Feb 2025 09:52:35 +0100
commit

94f37ff40c1aa48bf11ce003ebb7ede9bd697826

parent

f8b303ada691d1f8aa19d4721365ebff0a83864f

3 files changed, 65 insertions(+), 22 deletions(-)

jump to
M assets/styles/style.cssassets/styles/style.css

@@ -727,10 +727,49 @@ list-style-type: "\203A";

margin-right: 1rem; } +/* Days */ + +.days h3 { + margin-bottom: 0; + background: var(--secondary-background); + padding: 0 1rem; + border: 1px solid var(--secondary-background); + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +.days figure { + border-radius: 0; + margin: 0; +} + +.days time { + text-align: inherit; + display: inherit; + font-size: inherit; +} + +.days figcaption { + margin: 0; + font-size: 0.9rem; + background: var(--secondary-background); + padding: 0 0.5rem; + margin-top: -0.6rem; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; +} + +.days img { + border: none; +} + /* Avoid links on new line overwriting the previous line (links must be inline-block otherwise arrow icon may go on a new line*/ -li a, footer a, -h2 a, h3 a, h4 a { - display: inline; +li a, +footer a, +h2 a, +h3 a, +h4 a { + display: inline; } /* Used only in Glyph Book */
M rules.minrules.min

@@ -114,7 +114,7 @@ ".html" "ext" dict.set

"DAYS" "title" dict.set "page" "content-type" dict.set DAYS dict.keys (<) sort - (DAYS swap dict.get) map + (DAYS stack.swap dict.get) map "days" dict.set projects-count "projects-count" dict.set articles-count "articles-count" dict.set

@@ -174,7 +174,7 @@ symbol copy-pdf-article-asset

(dict :asset ==>) ( asset "id" dict.get :id - id "^pdf/(.+)$" search 1 get :name + id "^pdf[/\\\](.+)$" search 1 get :name asset "output/articles/$1/$1" (name) => % "id" dict.set @asset asset output-cp )

@@ -376,26 +376,29 @@ (

symbol process-days-asset (dict :meta ==>) ( - meta.id "\..+$" "" replace :date - { - date :date - } :day - (DAYS date dict.has) + meta.id "\..+$" "" replace "^days[/\\\]" "" replace :date + {} + date "date" dict.set + date "-" "." replace "title" dict.set + :day + (DAYS date dict.has?) (DAYS date dict.get @day) when - (meta.id "\.txt$" match?) + (meta.ext ".txt" ==) ( - meta input-fread :day.text + day meta input-fread "text" dict.set @day ) ( - (meta.ext "\.(png|jpe?g|webp|gif)" match?) - (meta.id :day.image) + (meta.ext "\.(png|jpe?g|webp|gif)$" match?) + ( + day "/" meta.id "[/\\\]" split "/" join meta.ext suffix suffix "image" dict.set @day + ) when meta output-cp ) if DAYS dict.keys size @days-count - DAYS day date dict.set + DAYS day date dict.set @DAYS ) ) :: ;; Process days assets

@@ -412,9 +415,9 @@ ;; Process all assets.

assets ( stack.dup ( - (("id" dict.get "^pdf/" match?) (copy-pdf-article-asset)) + (("id" dict.get "^pdf[/\\\]" match?) (copy-pdf-article-asset)) (("ext" dict.get ".css" match?) (process-css-asset)) - (("id") dict.get "^days/" match? (process-days-asset)) + (("id" dict.get "^days[/\\\]" match?) (process-days-asset)) ((true) (output-cp)) ) case ) foreach

@@ -427,7 +430,6 @@ :content

(((content 'draft dict.has? not) (content 'content-type dict.has?)) &&) ( content "id" dict.get :id - id puts (content "content-type" dict.get "project" ==) (content PROJECTS append @PROJECTS) when (content "content-type" dict.get "spell" ==) (content SPELLS append @SPELLS) when (content "content-type" dict.get "article" ==) (articles-count 1 + @articles-count) when
M templates/days.mustachetemplates/days.mustache

@@ -9,14 +9,16 @@ <div class="col-xs-12 sidebar">

{{> _header}} </div> </div> - <div class="row main-content"> + <div class="row main-content days"> <article class="{{content-type}} box content"> {{> _page_header}} <div id="body-text" class="hyphenate"> - <p>This page is a daily media stream.</p> - <p>It contains <em>at most</em> one picture or video per day.</p> + <p>This page is my daily photo stream, inspired by + <a href="https://rabbits.srht.site/days/" target="_blank">Hundred Rabbits's /days page</a> + and <a href="https://img.corvid.cafe" target="_blank">img.corvid.cafe</a>.</p> + <p>It contains <em>at most</em> one image per day.</p> {{#days}} - <h3 id="{{date}}">{{date}}</h3> + <h3 id="{{date}}"><time datetime="{{date}}">{{title}}</time></h3> {{#image}} <figure> <img src="{{image}}" alt="{{date}}" loading="lazy" />