RSS feed
This commit is contained in:
@ -12,7 +12,7 @@ disablePathToLower = true
|
||||
# author = 'Madison Scott-Clary'
|
||||
# home = 'https://makyo.ink'
|
||||
copyright = 'The Post-Self authors 2020 — 2024'
|
||||
customCSS = ['/css/toledot.css']
|
||||
customCSS = ['/css/post-self.css']
|
||||
headline = 'A science fiction setting focused on identity, memory, and individuation with uploaded consciousnesses'
|
||||
|
||||
[markup.goldmark.renderer]
|
||||
|
||||
@ -17,9 +17,15 @@ Alternately: "If I had a nickel for every time I accidentally wrote something wi
|
||||
|
||||
<p class="buy">
|
||||
<a href="https://wiki.post-self.ink/wiki/What_is_Post-Self%3F">What is Post-Self?</a>
|
||||
<a href="https://read.post-self.ink/post-self">Blog</a>
|
||||
<a href="/books">Books</a>
|
||||
<a href="/stories">Stories</a>
|
||||
<a href="https://wiki.post-self.ink">The Post-Self Wiki</a>
|
||||
<a href="https://wiki.post-self.ink/wiki/The_Post-Self_community">The Post-Self Community</a>
|
||||
</p>
|
||||
|
||||
<div id="feed">
|
||||
<h1>Updates</h1>
|
||||
</div>
|
||||
<script src="/js/rss.js"></script>
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ tbody tr td:first-child {
|
||||
<tbody id="vocab-list"></tbody>
|
||||
</table>
|
||||
|
||||
<script src="/sql.js"></script>
|
||||
<script src="/js/sql.js"></script>
|
||||
<script type="text/javascript">
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', '/extras/nanon/vocabulary.sqlite3', true);
|
||||
|
||||
@ -175,7 +175,31 @@ main.story .author, main.story .character, main.story h3 {
|
||||
content: "❓ Canon Note";
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
#feed article h2 {
|
||||
text-align: left;
|
||||
opacity: 0.9;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#feed article:after {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
content: '§';
|
||||
}
|
||||
|
||||
#feed article .pub-date {
|
||||
font-size: 90%;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
#feed article li {
|
||||
text-align: left;
|
||||
list-style-type: disc;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 960px) {
|
||||
.carousel nav {
|
||||
display: none;
|
||||
31
static/js/rss.js
Normal file
31
static/js/rss.js
Normal file
@ -0,0 +1,31 @@
|
||||
const RSS_URL = `https://read.post-self.ink/post-self/feed/`;
|
||||
|
||||
fetch(RSS_URL)
|
||||
.then(response => response.text())
|
||||
.then(str => new window.DOMParser().parseFromString(str, "text/xml"))
|
||||
.then(data => {
|
||||
const items = data.querySelectorAll("item");
|
||||
let html = ``;
|
||||
items.forEach(el => {
|
||||
const link = el.querySelector("link").innerHTML,
|
||||
title = el.querySelector("title").innerHTML,
|
||||
pubDate = new Date(el.querySelector("pubDate").innerHTML),
|
||||
content = el.querySelector("encoded").childNodes[0].nodeValue; // Get the CDATA value
|
||||
html += `
|
||||
<article>
|
||||
<h2>
|
||||
<a href="${link}" target="_blank">
|
||||
${title}
|
||||
</a>
|
||||
</h2>
|
||||
<p class="pub-date">${pubDate.toLocaleString()}</p>
|
||||
<section class="item-content">
|
||||
${content}
|
||||
</section>
|
||||
</article>
|
||||
`;
|
||||
});
|
||||
document.querySelector('#feed').insertAdjacentHTML('beforeend', html);
|
||||
});
|
||||
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
|
||||
|
||||
const RSS_URL = `https://cohost.org/post-self/rss/public.atom`;
|
||||
|
||||
fetch(RSS_URL)
|
||||
.then(response => response.text())
|
||||
.then(str => new window.DOMParser().parseFromString(str, "text/xml"))
|
||||
.then(data => {
|
||||
console.log(data);
|
||||
const items = data.querySelectorAll("item");
|
||||
let html = ``;
|
||||
items.forEach(el => {
|
||||
html += `
|
||||
<article>
|
||||
<img src="${el.querySelector("link").innerHTML}/image/large.png" alt="">
|
||||
<h2>
|
||||
<a href="${el.querySelector("link").innerHTML}" target="_blank" rel="noopener">
|
||||
${el.querySelector("title").innerHTML}
|
||||
</a>
|
||||
</h2>
|
||||
</article>
|
||||
`;
|
||||
});
|
||||
document.querySelector('#feed').html = html;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user