diff --git a/build/Site.hs b/build/Site.hs index 0b42e04..b5e5447 100644 --- a/build/Site.hs +++ b/build/Site.hs @@ -404,7 +404,9 @@ rules = do let ts = fromMaybe [] (lookupStringList "tags" meta) return $ any (\t -> t == p || (p ++ "/") `isPrefixOf` t) ts - portalList name p = listField name essayCtx $ do + itemCtx = dateField "date-iso" "%Y-%m-%d" <> essayCtx + + portalList name p = listField name itemCtx $ do essays <- loadAll (allEssays .&&. hasNoVersion) posts <- loadAll ("content/blog/*.md" .&&. hasNoVersion) fiction <- loadAll ("content/fiction/*.md" .&&. hasNoVersion) diff --git a/static/css/library.css b/static/css/library.css index 07f84e9..7bd8471 100644 --- a/static/css/library.css +++ b/static/css/library.css @@ -5,9 +5,54 @@ font-size: var(--text-size-small); color: var(--text-muted); margin-top: 0.25rem; + margin-bottom: 1.25rem; +} + +/* ============================================================ + SORT CONTROLS + ============================================================ */ + +.library-controls { + display: flex; + align-items: center; + gap: 0.6rem; margin-bottom: 2.5rem; } +.library-controls-label { + font-family: var(--font-sans); + font-size: 0.75rem; + color: var(--text-faint); +} + +.library-controls-options { + display: flex; + gap: 0.3rem; +} + +.library-sort-btn { + font-family: var(--font-sans); + font-size: 0.75rem; + color: var(--text-muted); + background: none; + border: 1px solid var(--border); + border-radius: 2px; + padding: 0.15em 0.55em; + cursor: pointer; + transition: border-color 0.1s, color 0.1s; +} + +.library-sort-btn:hover { + border-color: var(--border-muted); + color: var(--text); +} + +.library-sort-btn.is-active { + border-color: var(--text-muted); + color: var(--text); + font-weight: 600; +} + /* ============================================================ PORTAL SECTIONS ============================================================ */ diff --git a/templates/library.html b/templates/library.html index cf13538..e9d9435 100644 --- a/templates/library.html +++ b/templates/library.html @@ -2,11 +2,20 @@

Library

Everything on this site, organized by portal.

+
+ Sort by +
+ + + +
+
+ $if(research-entries)$

Research