Compare commits

..

No commits in common. "8c05ac2b3db4d20166f691e85bcb542ab5139f9b" and "801a09dc4c6c86a4e61d92e5dd00ce1cdabdea17" have entirely different histories.

11 changed files with 2800 additions and 2649 deletions

File diff suppressed because it is too large Load Diff

1422
dist/feed.xml vendored

File diff suppressed because it is too large Load Diff

2531
dist/index.html vendored

File diff suppressed because it is too large Load Diff

117
justfile
View File

@ -5,113 +5,47 @@ default:
just -l --unsorted
# how many games played
@played:
recsel -t Game -e "Role = 'Player'" -P Module -C {{database}}
played:
recsel -e "Role = 'Player'" -P Module {{database}}
# how many games ran
@ran:
recsel -t Game -e "Role = 'DM'" -P Module -C {{database}}
ran:
recsel -e "Role = 'DM'" -P Module {{database}}
# ongoing
@ongoing:
recsel -t Game -e 'Status = "Ongoing"' -p System,Module {{database}}
ongoing:
recsel -e 'Status = "Ongoing"' -p System,Module {{database}}
# show all in year
year x:
recsel -t Game -e 'Updated >> "{{x}}-01-01"' -P "Module,System,Updated" {{database}}
recsel -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
new:
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:
#!/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 ##
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
# rss feed
feed:
#!/usr/bin/env sh
feedtmpl='<item>
<title>{{{{Game_Module}} ({{{{Game_System}})</title>
<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>'
echo "<rss version=\"2.0\"><channel><title>gamelog</title>" > dist/feed.xml
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
recsel {{database}} | recfmt -f templates/feed.template >> dist/feed.xml
echo '</channel></rss>' >> dist/feed.xml
sed -i '' 's/&/and/g' dist/feed.xml
# copy to blog
@ -127,4 +61,3 @@ up: build export
# do everything
all: build up

View File

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

View File

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

View File

@ -0,0 +1,10 @@
<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

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

View File

@ -0,0 +1,12 @@
<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

@ -0,0 +1,9 @@
## {{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

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