diff --git a/bin/feed.sh b/bin/feed.sh new file mode 100644 index 0000000..5dabe32 --- /dev/null +++ b/bin/feed.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh +database="db/games.rec" + +feedtmpl=' + {{Game_System}} - {{Game_Module}} + http://tilde.town/~dozens/gamelog/index.html + {{Created}} + + + + +' + + +exec > dist/feed.xml +cat< + + gamelog + http://tilde.town/~dozens/gamelog/index.html + all the games i play + +EOF + + +recsel -t Update -j Game $database | recfmt "$feedtmpl" +echo '' +sed -i '' 's/&/and/g' dist/feed.xml diff --git a/bin/html.sh b/bin/html.sh new file mode 100644 index 0000000..41e4dfc --- /dev/null +++ b/bin/html.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env sh +database="db/games.rec" + + +## BEGIN: TEMPLATES ## +gameheadertmpl='
+

{{Module}} ({{System}}) #

+

{{Module}} is a game of {{System}} that I started playing on {{Started}} as a {{Role}}. It is a {{Format}} {{Length}} and is currently {{Status}}.

+

Here is how it went!

+' + +updatetmpl='

{{Created}} #

+ +{{Text}} +' + +gamefootertmpl='
🎲🎲
+
' + +toctmpl='
  • {{Module}} ({{System}})
  • ' +## END: TEMPLATES ## + + + +exec > dist/index.html + + +## BEGIN: STYLE ## +cat< + +EOF +## END: STYLE ## + + + +## BEGIN: INTRO ## +cat<Gamelogs +

    All the roleplaying games I've played.

    +
  • src: https://git.tilde.town/dozens/gamelog
  • +
  • dozens webring: previous index next
  • +
  • rss
  • +EOF +## END: INTRO ## + + + +## BEGIN: TOC ## +echo '

    Contents

    ' +recsel $database -t Game | recfmt "$toctmpl" +## END: TOC ## + + + +## BEGIN: BODY ## +allgames=(`recsel $database -t Game -P Id -C | tr '\n' ' '`) +for idx in "${allgames[@]}" +do + recsel $database -t Game -e "Id = $idx" | recfmt "$gameheadertmpl" + recsel $database -t Update -e "Game = $idx" | recfmt "$updatetmpl" | markdown + echo $gamefootertmpl +done +## END: BODY ## diff --git a/justfile b/justfile index 81047dd..83939ea 100644 --- a/justfile +++ b/justfile @@ -34,113 +34,11 @@ cli: # build da html html: - #!/usr/bin/env sh - ## BEGIN: TEMPLATES ## - gameheadertmpl='
    -

    {{{{Module}} ({{{{System}}) #

    -

    {{{{Module}} is a game of {{{{System}} that I started playing on {{{{Started}} as a {{{{Role}}. It is a {{{{Format}} {{{{Length}} and is currently {{{{Status}}.

    -

    Here is how it went!

    - ' - - updatetmpl='

    {{{{Created}} #

    - - {{{{Text}} - ' - - gamefootertmpl='
    🎲🎲
    -
    ' - - toctmpl='
  • {{{{Module}} ({{{{System}})
  • ' - ## END: TEMPLATES ## - - exec > dist/index.html - - ## BEGIN: STYLE ## - cat< - - EOF - ## END: STYLE ## - - ## BEGIN: INTRO ## - cat<Gamelogs -

    All the roleplaying games I've played.

    -
  • src: https://git.tilde.town/dozens/gamelog
  • -
  • dozens webring: previous index next
  • -
  • rss
  • - EOF - ## END: INTRO ## - - ## BEGIN: TOC ## - echo '

    Contents

    ' - recsel {{database}} -t Game | recfmt "$toctmpl" - ## END: TOC ## - - ## BEGIN: BODY ## - allgames=(`recsel {{database}} -t Game -P Id -C | tr '\n' ' '`) - for idx in "${allgames[@]}" - do - recsel {{database}} -t Game -e "Id = $idx" | recfmt "$gameheadertmpl" - recsel {{database}} -t Update -e "Game = $idx" | recfmt "$updatetmpl" | markdown - echo $gamefootertmpl - done - ## END: BODY ## + sh bin/html.sh # rss feed feed: - #!/usr/bin/env sh - feedtmpl=' - {{{{Game_System}} - {{{{Game_Module}} - http://tilde.town/~dozens/gamelog/index.html - {{{{Created}} - - - - - ' - exec > dist/feed.xml - cat< - - gamelog - http://tilde.town/~dozens/gamelog/index.html - all the games i play - - EOF - recsel -t Update -j Game {{database}} | recfmt "$feedtmpl" - echo '' - sed -i '' 's/&/and/g' dist/feed.xml + sh bin/feed.sh # copy to blog export: