Skip to content

rniii/rinici.de

rinici.de

All Work and Derivative Works in Source or Object form are licensed per Apache-2.0. Unless stated otherwise, all text, media and other content is licensed under the CC BY-SA 4.0 license.

Development

generate

runhaskell src/Site.hs

regenerate

touch pages/* posts/*

meta

find posts/*.md \
  -exec yq '.url = ("/{}" | sub("/\d{4}-\d\d-\d\d-", "/") | sub("\.md$", ""))' -f extract '{}' ';'

generate-feed

maid -q meta | \
  yq ea -oxml '(
    { "+p_xml": "version=\"1.0\" encoding=\"utf-8\""
    , "feed":
      { "+@xmlns":  "http://www.w3.org/2005/Atom"
      , "title":    "rini blog"
      , "link":
        [ { "+@href": "http://rinici.de/" }
        , { "+@href": "http://rinici.de/posts/atom.xml"
          , "+@rel":  "self"
          }
        ]
      , "icon":     "/ico.png"
      , "rights":   "© 2024 rini"
      , "id":       "https://rinici.de/"
      , "updated":  now | tz("UTC")
      , "entry":
        [.] | sort_by(.date) | reverse[] |
        { "title":    .title
        , "author":
          ( .author |
            ( select(type == "!!seq").0 // . ) |
            { "name": .name, "uri": .url }
          )
        , "link":     { "+@href": .url }
        , "id":       "https://rinici.de" + .url
        , "updated":  .date | with_dtf("Jan. 2, 2006"; format_datetime("2006-01-02T15:04:05Z07:00"))
        , "content":  { "+@src": .url, "+@type": "html" }
        , "summary":  .subtitle
        }
      }
    })'

new-post

set -o noclobber
post=posts/$(yq -n 'now | format_datetime("2006-01-02")')-"$3".md
cat >$post <<EOF
---
title: ${3}
subtitle: Subtitle
$(yq "{\"author\":.$2}" authors.yml)
date: $(yq -n 'now | format_datetime("Jan 02, 2006")')
---
EOF
echo "Created $post"

watch

maid -w . generate &
live-server --middleware=$(realpath mw.js) --host=0.0.0.0 _site &
wait

publish

rsync -avz --delete _site "$(cabal list-bin server)" rinici.de:web

About

GuavaScript

Resources

License

Apache-2.0, CC-BY-SA-4.0 licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
CC-BY-SA-4.0
LICENSE-CC

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published