-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump markdownlint-cli from 0.37.0 to 0.38.0
Bumps [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) from 0.37.0 to 0.38.0. - [Release notes](https://github.com/igorshubovych/markdownlint-cli/releases) - [Commits](igorshubovych/markdownlint-cli@v0.37.0...v0.38.0) --- updated-dependencies: - dependency-name: markdownlint-cli dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Add sitemap
- Loading branch information
1 parent
fa8003f
commit bf01461
Showing
8 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @template T | ||
* @typedef {import('top-bun').TemplateFunction<T>} TemplateFunction | ||
*/ | ||
|
||
/** @type {TemplateFunction<{ | ||
* siteName: string, | ||
* siteDescription: string, | ||
* siteUrl: string, | ||
* authorName: string, | ||
* authorUrl: string, | ||
* authorImgUrl: string | ||
* layout: string, | ||
* publishDate: string | ||
* title: string | ||
* }>} */ | ||
export default async ({ | ||
vars: { | ||
siteUrl | ||
} | ||
}) => `User-agent: * | ||
Allow: / | ||
Sitemap: ${siteUrl}/sitemap.xml | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import builder from 'xmlbuilder' | ||
|
||
/** | ||
* @template T | ||
* @typedef {import('top-bun').TemplateFunction<T>} TemplateFunction | ||
*/ | ||
|
||
/** @type {TemplateFunction<{ | ||
* siteName: string, | ||
* siteDescription: string, | ||
* siteUrl: string, | ||
* authorName: string, | ||
* authorUrl: string, | ||
* authorImgUrl: string | ||
* layout: string, | ||
* publishDate: string | ||
* title: string, | ||
* noindex?: boolean | ||
* }>} */ | ||
export default async ({ | ||
vars: { | ||
siteUrl | ||
}, | ||
pages | ||
}) => { | ||
const sitemapObj = { | ||
urlset: { | ||
'@xmlns': 'http://www.sitemaps.org/schemas/sitemap/0.9', | ||
url: pages.filter(page => !page.vars.noindex).map(page => ({ | ||
loc: `${siteUrl}/${page.pageInfo.path}${page.pageInfo.path && !page.pageInfo.path.endsWith('.html') ? '/' : ''}` | ||
})) | ||
} | ||
} | ||
const feed = builder.create(sitemapObj, { encoding: 'utf-8' }) | ||
return feed.end({ pretty: true, allowEmpty: false }) | ||
} |