Skip to content

Commit

Permalink
upgrade Lume, use the feed plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed May 6, 2023
1 parent 3b3864e commit e76998a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 64 deletions.
2 changes: 1 addition & 1 deletion demo/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"lume/": "https://deno.land/x/lume@v1.15.1/"
"lume/": "https://deno.land/x/lume@v1.17.0/"
},
"tasks": {
"lume": "echo \"import 'lume/cli.ts'\" | deno run --unstable -A -",
Expand Down
22 changes: 9 additions & 13 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"lume/": "https://deno.land/x/lume@v1.15.3/"
"lume/": "https://deno.land/x/lume@v1.17.0/"
},
"tasks": {
"lume": "echo \"import 'lume/cli.ts'\" | deno run --unstable -A -",
Expand All @@ -9,24 +9,20 @@
"changelog": "deno run --allow-read --allow-write https://deno.land/x/[email protected]/bin.ts"
},
"lint": {
"files": {
"exclude": [
"./_site",
"./_bin"
]
},
"exclude": [
"./_site",
"./_bin"
],
"rules": {
"tags": [
"recommended"
]
}
},
"fmt": {
"files": {
"exclude": [
"./_site",
"./_bin"
]
}
"exclude": [
"./_site",
"./_bin"
]
}
}
2 changes: 0 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export default function (options: Partial<Options> = {}) {
"404.md",
"archive_result.tmpl.js",
"archive.tmpl.js",
"feed.tmpl.js",
"feed.xml.njk",
"index.njk",
"styles.css",
"favicon.png",
Expand Down
12 changes: 12 additions & 0 deletions plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import resolveUrls from "lume/plugins/resolve_urls.ts";
import metas from "lume/plugins/metas.ts";
import pagefind from "lume/plugins/pagefind.ts";
import sitemap from "lume/plugins/sitemap.ts";
import feed from "lume/plugins/feed.ts";
import readingTime from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/reading_time/mod.ts";
import toc from "https://deno.land/x/[email protected]/toc.ts";
import image from "https://deno.land/x/[email protected]/image.ts";
Expand All @@ -34,6 +35,17 @@ export default function (options: Options = {}) {
.use(pagefind())
.use(terser())
.use(sitemap())
.use(feed({
output: ["/feed.xml", "/feed.json"],
query: "type=post",
info: {
title: "=metas.site",
description: "=metas.description",
},
items: {
title: "=title",
},
}))
.copy("fonts")
.copy("favicon.png")
.preprocess([".md"], (page: Page) => {
Expand Down
27 changes: 0 additions & 27 deletions src/feed.tmpl.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/feed.xml.njk

This file was deleted.

0 comments on commit e76998a

Please sign in to comment.