fixes a few comments from lucidiot

- adds `htmlUrl` to opml entry items
- removes `title` from opml entity
- removes superfluous jq call, moves query to recsel

**NOTE:** mustache apparently has a quirk where when iterating over a
list, it will interpret a 0 and a 1 as false and true unless/until there
is also a 2. at which point it will start interpreting the numbers as
numbers. this commit does NOT fix this. i just manually changed the
`false` to `0` in the generated html. this problem will fix itself once
we have at least 3 webring members.
This commit is contained in:
dozens 2023-10-31 08:43:42 -06:00
parent c735cde7bc
commit ca665dbbf3
5 changed files with 8 additions and 10 deletions

View File

@ -12,6 +12,7 @@
%mandatory: id title name url
%sort: id
# FIELDS AND VALUES
# id: an incrementing integer
# created: timestamp
@ -27,4 +28,3 @@ created: Mon, 30 Oct 2023 13:38:40 -0600
name: dozens
title: tilde.town/~dozens
url: https://tilde.town/~dozens
feed:

View File

@ -47,9 +47,9 @@ body {
<script>
const members = [
{
"id": false,
"name": "dozens",
"url": "https://tilde.town/~dozens",
"id": 0,
"name": "dozens",
"url": "https://tilde.town/~dozens",
},
]
const last = members.length - 1

View File

@ -27,11 +27,10 @@ html:
# build opml
opml:
recsel db/members.rec \
recsel db/members.rec -e 'feed != ""' \
| rec2csv \
| csvjson \
| jq '. | {data: .}' \
| jq '{ data: [ .data[] | select(.feed != null) ] }' \
| mustache - src/example.opml webring.opml
# compile html and opml

View File

@ -51,8 +51,8 @@ body {
{{#data}}
{
"id": {{{id}}},
"name": "{{{name}}}",
"url": "{{{url}}}",
"name": "{{{name}}}",
"url": "{{{url}}}",
},
{{/data}}
]

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="2.0">
<head>
<title>tildepals webring</title>
<text>tildepals webring</text>
<ownerName>dozens</ownerName>
<ownerEmail>dozens@tilde.team</ownerEmail>
@ -9,7 +8,7 @@
<body>
<outline text="tildepals webring" title="tildepals webring">
{{#data}}
<outline text="{{{name}}}" title="{{{title}}}" type="rss" xmlUrl="{{{feed}}}" />
<outline text="{{{name}}}" title="{{{title}}}" type="rss" xmlUrl="{{{feed}}}" htmlUrl="{{{url}}}" />
{{/data}}
</outline>
</body>