mirror of
https://github.com/GuerillaStudio/vanillalist.git
synced 2024-12-21 00:21:57 +00:00
Add RSS Feed
This commit is contained in:
parent
a7060a8d54
commit
2fc34efafa
7 changed files with 1423 additions and 1226 deletions
14
.eleventy.js
14
.eleventy.js
|
@ -2,9 +2,18 @@ const glob = require("glob-promise")
|
||||||
const fs = require("fs/promises")
|
const fs = require("fs/promises")
|
||||||
const { URL } = require("url")
|
const { URL } = require("url")
|
||||||
const sharpPlugin = require("eleventy-plugin-sharp")
|
const sharpPlugin = require("eleventy-plugin-sharp")
|
||||||
|
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
||||||
|
|
||||||
module.exports = function (eleventyConfig) {
|
module.exports = function (eleventyConfig) {
|
||||||
|
|
||||||
|
eleventyConfig.addGlobalData('generated', () => {
|
||||||
|
let now = new Date();
|
||||||
|
return new Intl.DateTimeFormat(
|
||||||
|
'en-US', { dateStyle: 'full', timeStyle: 'long' }
|
||||||
|
).format(now);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
eleventyConfig.setBrowserSyncConfig({ port: 1312 })
|
eleventyConfig.setBrowserSyncConfig({ port: 1312 })
|
||||||
eleventyConfig.addPlugin(sharpPlugin(
|
eleventyConfig.addPlugin(sharpPlugin(
|
||||||
{
|
{
|
||||||
|
@ -43,13 +52,14 @@ module.exports = function (eleventyConfig) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// eleventyConfig.addPassthroughCopy("./src/js/")
|
|
||||||
eleventyConfig.addPassthroughCopy({ "./src/static/": "/"})
|
eleventyConfig.addPassthroughCopy({ "./src/static/": "/"})
|
||||||
|
|
||||||
eleventyConfig.addWatchTarget("./src/sass/")
|
eleventyConfig.addWatchTarget("./src/sass/")
|
||||||
// eleventyConfig.addWatchTarget("./src/js/")
|
|
||||||
eleventyConfig.addWatchTarget("./src/static/")
|
eleventyConfig.addWatchTarget("./src/static/")
|
||||||
|
|
||||||
|
// RSS
|
||||||
|
eleventyConfig.addPlugin(pluginRss);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dir: {
|
dir: {
|
||||||
input: "src",
|
input: "src",
|
||||||
|
|
2588
package-lock.json
generated
2588
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -14,7 +14,6 @@
|
||||||
"build": "npm-run-all build:sass build:eleventy"
|
"build": "npm-run-all build:sass build:eleventy"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@11ty/eleventy": "^1.0.0",
|
|
||||||
"@orchidjs/sifter": "^0.9.0",
|
"@orchidjs/sifter": "^0.9.0",
|
||||||
"autoprefixer": "^10.4.2",
|
"autoprefixer": "^10.4.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
@ -29,6 +28,8 @@
|
||||||
"not dead"
|
"not dead"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@11ty/eleventy": "^1.0.1",
|
||||||
|
"@11ty/eleventy-plugin-rss": "^1.1.2",
|
||||||
"@stanzilla/stylelint-config-rational-order": "^0.1.3",
|
"@stanzilla/stylelint-config-rational-order": "^0.1.3",
|
||||||
"glob": "^7.2.0",
|
"glob": "^7.2.0",
|
||||||
"glob-promise": "^4.2.2",
|
"glob-promise": "^4.2.2",
|
||||||
|
|
|
@ -9,5 +9,5 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer container">
|
<footer class="footer container">
|
||||||
Copyleft ∴ <a href="https://glitch.family">Glitch.Family</a> — This project is <a href="https://github.com/GlitchFamily/vanillalist" rel="noopener">open-source</a> but the plugin's visuals belong to their respective owners
|
Copyleft ∴ <a href="https://glitch.family">Glitch.Family</a> — This project is <a href="https://github.com/GlitchFamily/vanillalist" rel="noopener">open-source</a> but the plugin's visuals belong to their respective owners — <a href="{{ '/feed.xml' | url }}">RSS feed</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -10,10 +10,11 @@
|
||||||
pagination %}
|
pagination %}
|
||||||
</title>
|
</title>
|
||||||
<meta name="description" content="{{ description or site.description }}">
|
<meta name="description" content="{{ description or site.description }}">
|
||||||
<link rel="canonical" href="{% include 'canonical.njk' | url %}"/>
|
|
||||||
<meta name="generator" content="Eleventy">
|
<meta name="generator" content="Eleventy">
|
||||||
|
<link rel="canonical" href="{% include 'canonical.njk' | url %}"/>
|
||||||
{% include 'favicons.njk' %}
|
{% include 'favicons.njk' %}
|
||||||
<link rel="stylesheet" href="{{ '/css/style.css' | url }}"/>
|
<link rel="stylesheet" href="{{ '/css/style.css' | url }}"/>
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="{{ '/feed.xml' | url }}" title="{{ site.name }}" />
|
||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -8,7 +8,7 @@ class PluginSearch {
|
||||||
this.cardGenerator = window.vanillalistCard
|
this.cardGenerator = window.vanillalistCard
|
||||||
this.searchEntry = new URLSearchParams(document.location.search.substring(1)).get('s')
|
this.searchEntry = new URLSearchParams(document.location.search.substring(1)).get('s')
|
||||||
this.sifterOptions = {
|
this.sifterOptions = {
|
||||||
fields: ['title', 'description'],
|
fields: ['title', 'description', 'id'],
|
||||||
filter: true
|
filter: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
35
src/rss.njk
Normal file
35
src/rss.njk
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
---json
|
||||||
|
{
|
||||||
|
"permalink": "feed.xml",
|
||||||
|
"eleventyExcludeFromCollections": true
|
||||||
|
}
|
||||||
|
---
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<title>{{ site.name }}</title>
|
||||||
|
<subtitle>{{ site.description }}</subtitle>
|
||||||
|
<link href="{{ '/feed.xml' | absoluteUrl(site.baseUrl) }}" rel="self"/>
|
||||||
|
<link href="{{ '/' | absoluteUrl(site.baseUrl) }}"/>
|
||||||
|
<id>{{ '/' | absoluteUrl(site.baseUrl) }}</id>
|
||||||
|
{%- for plugin in collections.plugins %}
|
||||||
|
<entry>
|
||||||
|
<title>{{ plugin.title }}</title>
|
||||||
|
<link href="{{ '/search/' | absoluteUrl(site.baseUrl) }}?s={{ plugin.id }}"/>
|
||||||
|
<id>{{ '/search/' | absoluteUrl(site.baseUrl) }}?s={{ plugin.id }}</id>
|
||||||
|
<content type="html">
|
||||||
|
<p>{{ plugin.description }}</p>
|
||||||
|
<ul>
|
||||||
|
{% if plugin.url_demo %}
|
||||||
|
<li><a href="{{ plugin.url_demo }}">Demo link</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if plugin.url_github %}
|
||||||
|
<li><a href="{{ plugin.url_github }}">Github link</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if plugin.url_nom %}
|
||||||
|
<li><a href="{{ plugin.url_nom }}">npm link</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</content>
|
||||||
|
</entry>
|
||||||
|
{%- endfor %}
|
||||||
|
</feed>
|
Loading…
Reference in a new issue