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:
parent
c735cde7bc
commit
ca665dbbf3
|
@ -12,6 +12,7 @@
|
||||||
%mandatory: id title name url
|
%mandatory: id title name url
|
||||||
%sort: id
|
%sort: id
|
||||||
|
|
||||||
|
|
||||||
# FIELDS AND VALUES
|
# FIELDS AND VALUES
|
||||||
# id: an incrementing integer
|
# id: an incrementing integer
|
||||||
# created: timestamp
|
# created: timestamp
|
||||||
|
@ -27,4 +28,3 @@ created: Mon, 30 Oct 2023 13:38:40 -0600
|
||||||
name: dozens
|
name: dozens
|
||||||
title: tilde.town/~dozens
|
title: tilde.town/~dozens
|
||||||
url: https://tilde.town/~dozens
|
url: https://tilde.town/~dozens
|
||||||
feed:
|
|
||||||
|
|
|
@ -47,9 +47,9 @@ body {
|
||||||
<script>
|
<script>
|
||||||
const members = [
|
const members = [
|
||||||
{
|
{
|
||||||
"id": false,
|
"id": 0,
|
||||||
"name": "dozens",
|
"name": "dozens",
|
||||||
"url": "https://tilde.town/~dozens",
|
"url": "https://tilde.town/~dozens",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const last = members.length - 1
|
const last = members.length - 1
|
||||||
|
|
|
@ -27,11 +27,10 @@ html:
|
||||||
|
|
||||||
# build opml
|
# build opml
|
||||||
opml:
|
opml:
|
||||||
recsel db/members.rec \
|
recsel db/members.rec -e 'feed != ""' \
|
||||||
| rec2csv \
|
| rec2csv \
|
||||||
| csvjson \
|
| csvjson \
|
||||||
| jq '. | {data: .}' \
|
| jq '. | {data: .}' \
|
||||||
| jq '{ data: [ .data[] | select(.feed != null) ] }' \
|
|
||||||
| mustache - src/example.opml webring.opml
|
| mustache - src/example.opml webring.opml
|
||||||
|
|
||||||
# compile html and opml
|
# compile html and opml
|
||||||
|
|
|
@ -51,8 +51,8 @@ body {
|
||||||
{{#data}}
|
{{#data}}
|
||||||
{
|
{
|
||||||
"id": {{{id}}},
|
"id": {{{id}}},
|
||||||
"name": "{{{name}}}",
|
"name": "{{{name}}}",
|
||||||
"url": "{{{url}}}",
|
"url": "{{{url}}}",
|
||||||
},
|
},
|
||||||
{{/data}}
|
{{/data}}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<opml version="2.0">
|
<opml version="2.0">
|
||||||
<head>
|
<head>
|
||||||
<title>tildepals webring</title>
|
|
||||||
<text>tildepals webring</text>
|
<text>tildepals webring</text>
|
||||||
<ownerName>dozens</ownerName>
|
<ownerName>dozens</ownerName>
|
||||||
<ownerEmail>dozens@tilde.team</ownerEmail>
|
<ownerEmail>dozens@tilde.team</ownerEmail>
|
||||||
|
@ -9,7 +8,7 @@
|
||||||
<body>
|
<body>
|
||||||
<outline text="tildepals webring" title="tildepals webring">
|
<outline text="tildepals webring" title="tildepals webring">
|
||||||
{{#data}}
|
{{#data}}
|
||||||
<outline text="{{{name}}}" title="{{{title}}}" type="rss" xmlUrl="{{{feed}}}" />
|
<outline text="{{{name}}}" title="{{{title}}}" type="rss" xmlUrl="{{{feed}}}" htmlUrl="{{{url}}}" />
|
||||||
{{/data}}
|
{{/data}}
|
||||||
</outline>
|
</outline>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue