Skip to content

Commit

Permalink
Added sitemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Breck Yunits authored and Breck Yunits committed Apr 27, 2024
1 parent 5b0b66f commit 2bab4c8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ blog/planets.json
# Do not check in files built by Scroll
*.html
feed.xml
sitemap.txt

# Do not check in external assets copied by Scroll
blog/dataTables.dataTables.min.css
Expand Down
16 changes: 16 additions & 0 deletions grammar/sitemaps.grammar
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#text
printSiteMapParser
description Prints out a plain text sitemap for a folder.
extends abstractScrollParser
cruxFromId
cells keywordCell
example
baseUrl http://test.com
printSiteMap
javascript
compile() {
const file = this.root.file
const { baseUrl } = file
const files = file.allFiles.filter(file => file.shouldBuild && file.permalink.endsWith(".html") && file.permalink !== "404.html" || file.permalink.endsWith(".htm"))
return files.map(file => baseUrl + file.permalink).join("\n")
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll-cli",
"version": "79.0.1",
"version": "79.1.0",
"description": "Tools for thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
3 changes: 3 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ title Scroll Release Notes

startColumns

# 79.1.0 4/27/2024
- 🎉 added `printSiteMap` keyword for text sitemap generation.

# 79.0.1 4/27/2024
- 🏥 fix npm issue

Expand Down
3 changes: 3 additions & 0 deletions sitemap.scroll
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
baseUrl https://scroll.pub/
permalink sitemap.txt
printSiteMap

0 comments on commit 2bab4c8

Please sign in to comment.