Compare commits

...

1 Commits

Author SHA1 Message Date
Dozens B. McCuzzins 8c05ac2b3d schema refactor 2024-02-01 12:07:55 -07:00
11 changed files with 2602 additions and 2903 deletions

File diff suppressed because it is too large Load Diff

1366
dist/feed.xml vendored

File diff suppressed because it is too large Load Diff

2629
dist/index.html vendored

File diff suppressed because it is too large Load Diff

117
justfile
View File

@ -5,47 +5,113 @@ default:
just -l --unsorted just -l --unsorted
# how many games played # how many games played
played: @played:
recsel -e "Role = 'Player'" -P Module {{database}} recsel -t Game -e "Role = 'Player'" -P Module -C {{database}}
# how many games ran # how many games ran
ran: @ran:
recsel -e "Role = 'DM'" -P Module {{database}} recsel -t Game -e "Role = 'DM'" -P Module -C {{database}}
# ongoing # ongoing
ongoing: @ongoing:
recsel -e 'Status = "Ongoing"' -p System,Module {{database}} recsel -t Game -e 'Status = "Ongoing"' -p System,Module {{database}}
# show all in year # show all in year
year x: year x:
recsel -e 'Updated >> "{{x}}-01-01"' -P "Module,System,Updated" {{database}} recsel -t Game -e 'Updated >> "{{x}}-01-01"' -P "Module,System,Updated" {{database}}
# export csv
csv:
rec2csv {{database}}
# get some json
json:
rec2csv {{database}} | csvjson | jq
# create a new entry # create a new entry
new: new:
node bin/cli.js node bin/cli.js
# featuring descending sort!
markdown:
recsel -S Updated {{database}} | rec2csv | csvjson | jq 'reverse | map(.Notes |= gsub("\n"; "\n\n"))' | in2csv -f json | csv2rec | recfmt -f templates/markdown.template
# html out
html: html:
just markdown | pandoc -t html --toc -s --metadata title="Games!" --metadata toc-title="Index" -B templates/before.html -A templates/after.html -H templates/header.html -o dist/index.html #!/usr/bin/env sh
## BEGIN: TEMPLATES ##
gameheadertmpl='<article>
<h2 id={{{{Id}}>{{{{Module}} ({{{{System}})</h2>
<p>{{{{Module}} is a game of {{{{System}} that I started playing on {{{{Started}} as a {{{{Role}}. It is a {{{{Format}} {{{{Length}} and is currently {{{{Status}}.</p>
<p>Here is how it went!</p>
'
updatetmpl='<h3>{{{{Created}}</h3>
{{{{Text}}
'
gamefootertmpl='<center>🎲🎲</center>
</article>'
toctmpl='<li><a href="#{{{{Id}}">{{{{Module}} ({{{{System}})</a></li>'
## END: TEMPLATES ##
exec > dist/index.html
## BEGIN: STYLE ##
cat<<EOF
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="dozens gamelog">
<style>
body {
max-width: 80ch;
margin: 0 auto;
}
h2 {
border-bottom: solid 1px black;
margin-top: 3rem;
}
</style>
EOF
## END: STYLE ##
## BEGIN: INTRO ##
cat<<EOF
<h1>Games!</h1>
<li>src: <a href='https://git.tilde.town/dozens/gamelog'>https://git.tilde.town/dozens/gamelog</a></li>
<li>dozens webring: <a href='https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&amp;dir=prev'>previous</a> <a href='https://tilde.town/%7Edozens/webring/dozens/index.html'>index</a> <a href='https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&amp;dir=next'>next</a></li>
<li><a href="feed.xml">rss</a></li>
EOF
## END: INTRO ##
## BEGIN: TOC ##
echo '<h2>Contents</h2>'
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 ##
# rss feed # rss feed
feed: feed:
echo "<rss version=\"2.0\"><channel><title>gamelog</title>" > dist/feed.xml #!/usr/bin/env sh
echo "<link>http://tilde.town/~dozens/gamelog/index.html</link><description>all the games i play</description><atom:link rel=\"self\" type=\"application/rss+xml\" href=\"http://tilde.town/~dozens/gamelog/feed.xml\"/>" >> dist/feed.xml feedtmpl='<item>
recsel {{database}} | recfmt -f templates/feed.template >> dist/feed.xml <title>{{{{Game_Module}} ({{{{Game_System}})</title>
echo '</channel></rss>' >> dist/feed.xml <link>http://tilde.town/~dozens/gamelog/index.html</link>
<pubDate>{{{{Created}}</pubDate>
<description>
<![CDATA[
{{{{Text}}
]]>
</description>
</item>
'
exec > dist/feed.xml
cat<<EOF
<?xml version="1.0" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link rel="self" type="application/rss+xml" href="http://tilde.town/~dozens/gamelog/feed.xml"/>
<title>gamelog</title>
<link>http://tilde.town/~dozens/gamelog/index.html</link>
<description>all the games i play</description>
EOF
recsel -t Update -j Game {{database}} | recfmt "$feedtmpl"
echo '</channel></rss>'
sed -i '' 's/&/and/g' dist/feed.xml sed -i '' 's/&/and/g' dist/feed.xml
# copy to blog # copy to blog
@ -61,3 +127,4 @@ up: build export
# do everything # do everything
all: build up all: build up

View File

@ -1,5 +0,0 @@
# Templates
this directory holds templates, includes, partials, etc.
Namely `.template` files for recfmt, and `.html` files for pandoc

View File

@ -1,4 +0,0 @@
<hr />
<p>
<center>✌️</center>
</p>

View File

@ -1,10 +0,0 @@
<p>In 2021 I started keeping track of all the <abbr title="tabletop role playing game">ttrpgs</abbr> I play in a recfile database.</p>
<p>Learn more at <a href="https://git.tilde.town/dozens/gamelog">https://git.tilde.town/dozens/gamelog</a></p>
<p>
This site is part of the dozensweb webring:
<a href="https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&dir=prev">previous</a>
<a href="https://tilde.town/%7Edozens/webring/dozens/index.html">index</a>
<a href="https://tilde.town/%7Edozens/webring/dozens/index.html?name=gamelog&dir=next">next</a>
</p>

View File

@ -1,10 +0,0 @@
<item>
<title>{{System}} - {{Module}}</title>
<link>http://tilde.town/~dozens/gamelog/index.html</link>
<pubDate>{{Updated}}</pubDate>
<description>
<![CDATA[
{{Notes}}
]]>
</description>
</item>

View File

@ -1,12 +0,0 @@
<link rel="alternate" type="application/rss+xml" href="/feed.xml" title="dozens gamelog">
<style>
body {
max-width: 68ch;
margin: 0 auto;
line-height: 1.2;
}
h2 {
border-bottom: solid 1px black;
margin-top: 3rem;
}
</style>

View File

@ -1,9 +0,0 @@
## {{Module}} ({{System}})
{{Module}} is a game of {{System}} that I started playing {{Started}} as a {{Role}}. It is a {{Format}} {{Length}} and is currently {{Status}}.
Here's how it went!
{{Notes}}
<p><center>🎲🎲</center></p>

View File

@ -1,6 +0,0 @@
function Meta(m)
if m.date == nil then
m.date = os.date("%B %e, %Y")
return m
end
end