on master help sign in
Merge branch 'master' into patch-2
291b6ceFundor333
scripts/opml.js+2−2
@@ -4,10 +4,10 @@ const outlines = sites.filter(site => site.rss).map(site => {
4
4
5const template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join('')}</body></opml>`
5const template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join('')}</body></opml>`
6
6
7−window.onload = function () {
7+window.addEventListener('DOMContentLoaded', () => {
8 const a = document.getElementById('opml')
8 const a = document.getElementById('opml')
9 if (a) {
9 if (a) {
10 a.setAttribute('href', 'data:text/plain;charset=utf-8,' + window.encodeURIComponent(template))
10 a.setAttribute('href', 'data:text/plain;charset=utf-8,' + window.encodeURIComponent(template))
11 a.setAttribute('download', 'webring.opml')
11 a.setAttribute('download', 'webring.opml')
12 }
12 }
13−}
13+})
scripts/sites.js+3−2
@@ -74,7 +74,7 @@ const sites = [
74 { url: 'https://patrikarvidsson.com' },
74 { url: 'https://patrikarvidsson.com' },
75 { url: 'https://sophieleetmaa.com' },
75 { url: 'https://sophieleetmaa.com' },
76 { url: 'https://xinniw.github.io' },
76 { url: 'https://xinniw.github.io' },
77− { url: 'https://mboxed.github.io/forida', title: 'Forida', type: 'wiki', author: 'm', contact: 'mboxxed@gmail.com', feed: 'https://mboxed.github.io/forida/tw.txt' },
77+ { url: 'https://mboxed.github.io/sodatsu', title: 'sodatsu', type: 'wiki', author: 'm', contact: 'mboxxed@gmail.com', feed: 'https://mboxed.github.io/sodatsu/tw.txt' },
78 { url: 'https://letters.vexingworkshop.com' },
78 { url: 'https://letters.vexingworkshop.com' },
79 { url: 'https://tom.org.nz', title: 'Tom Hackshaw', type: 'portfolio', author: 'tomupom', contact: 'tom@tomhackshaw.com', wiki: 'https://a.tom.org.nz/glossary.ndtl' },
79 { url: 'https://tom.org.nz', title: 'Tom Hackshaw', type: 'portfolio', author: 'tomupom', contact: 'tom@tomhackshaw.com', wiki: 'https://a.tom.org.nz/glossary.ndtl' },
80 { url: 'https://teknari.com' },
80 { url: 'https://teknari.com' },
@@ -96,5 +96,6 @@ const sites = [
96 { url: 'https://opinionatedguide.github.io/', title: 'OpGuides', author: 'vega', contact: 'vegac@protonmail.com', feed: 'https://opinionatedguide.github.io/twtxt.txt' },
96 { url: 'https://opinionatedguide.github.io/', title: 'OpGuides', author: 'vega', contact: 'vegac@protonmail.com', feed: 'https://opinionatedguide.github.io/twtxt.txt' },
97 { url: 'https://chrismaughan.com/', title: 'CMaughan', author: 'cmaughan', contact: 'mornymorny@gmail.com', feed: 'https://chrismaughan.com/twtxt.txt' },
97 { url: 'https://chrismaughan.com/', title: 'CMaughan', author: 'cmaughan', contact: 'mornymorny@gmail.com', feed: 'https://chrismaughan.com/twtxt.txt' },
98 { url: 'https://oddworlds.org/', title: 'oddworlds soliloquy', type: 'blog', author: 'RaelZero', contact: 'gaz.gong@gmail.com' },
98 { url: 'https://oddworlds.org/', title: 'oddworlds soliloquy', type: 'blog', author: 'RaelZero', contact: 'gaz.gong@gmail.com' },
99− { url: 'https://fundor333.com/', title: 'Fundor333', type: 'blog', author: 'Fundor 333', contact: 'blog@fundor333.com' , feed: "https://fundor333.com/twtxt.txt" }
99+ { url: 'https://fundor333.com/', title: 'Fundor333', type: 'blog', author: 'Fundor 333', contact: 'blog@fundor333.com' , feed: "https://fundor333.com/twtxt.txt" },
100+ { url: 'https://cass.si/', contact: 'm@cass.si' }
100]
101]
scripts/wiki.js+7−2
@@ -55,11 +55,16 @@ const Wiki = sites => {
55 return `${currentHtml}${newHtml}`
55 return `${currentHtml}${newHtml}`
56 }
56 }
57
57
58+ const formatLinks = text => text.replace(
59+ /\b((https?|dat):\/\/[^"\s]+)/g,
60+ '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>'
61+ )
62+
58 const formatEntry = (definitions, definition) => {
63 const formatEntry = (definitions, definition) => {
59− const formatEntryList = entryList => entryList.reduce((items, item) => `${items}<li>${item}</li>`, '')
64+ const formatEntryList = entryList => entryList.reduce((items, item) => `${items}<li>${formatLinks(item)}</li>`, '')
60
65
61 const newHtml = typeof definition.entry === 'string'
66 const newHtml = typeof definition.entry === 'string'
62− ? `<li>${definition.entry}
67+ ? `<li>${formatLinks(definition.entry)}
63 - <a class='author' target='_blank' href='${definition.url}'> @${definition.author}</a>
68 - <a class='author' target='_blank' href='${definition.url}'> @${definition.author}</a>
64 </li>`
69 </li>`
65 : `<li><ul>${formatEntryList(definition.entry)}
70 : `<li><ul>${formatEntryList(definition.entry)}
wiki.html+1
@@ -9,6 +9,7 @@
9 <script src="scripts/wiki.js"></script>
9 <script src="scripts/wiki.js"></script>
10 <script src="scripts/sites.js"></script>
10 <script src="scripts/sites.js"></script>
11 <script src="scripts/indental.js"></script>
11 <script src="scripts/indental.js"></script>
12+ <script src="scripts/opml.js"></script>
12 <title>Wiki</title>
13 <title>Wiki</title>
13</head>
14</head>
14<body>
15<body>