Skip to content

Commit

Permalink
Bump markdownlint-cli from 0.37.0 to 0.38.0
Browse files Browse the repository at this point in the history
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
dependabot[bot] authored and bcomnes committed Dec 11, 2023
1 parent fa8003f commit bf01461
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 8 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"gravatar-favicons": "^3.0.0",
"highlight.js": "^11.0.1",
"jsonfeed-to-atom": "^1.2.4",
"markdownlint-cli": "^0.37.0",
"markdownlint-cli": "^0.38.0",
"mine.css": "^9.0.1",
"npm-run-all2": "^6.0.0",
"p-map": "^7.0.0",
Expand All @@ -51,7 +51,8 @@
"top-bar.css": "^3.0.0",
"top-bun": "^7.0.0",
"typescript": "~5.2.2",
"uhtml-isomorphic": "^2.1.0"
"uhtml-isomorphic": "^2.1.0",
"xmlbuilder": "^15.1.1"
},
"engines": {
"node": ">=16.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/blog/2023/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

export const vars = {
title: '2023 Blog Posts',
layout: 'blog-auto-index'
layout: 'blog-auto-index',
noindex: true
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/blog/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { dirname, basename } from 'node:path'

export const vars = {
title: 'Recent Blog Posts',
layout: 'blog-index'
layout: 'blog-index',
noindex: true
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/jobs/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

export const vars = {
title: 'Jobs',
layout: 'blog-auto-index'
layout: 'blog-auto-index',
noindex: true
}

/**
Expand Down
22 changes: 20 additions & 2 deletions src/manifest.json.template.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
export default ({
siteName
/**
* @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: {
siteName
}
}) => {
return JSON.stringify({
manifest_version: 2,
Expand Down
3 changes: 2 additions & 1 deletion src/projects/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

export const vars = {
title: 'Projects',
layout: 'blog-auto-index'
layout: 'blog-auto-index',
noindex: true
}

/**
Expand Down
25 changes: 25 additions & 0 deletions src/robots.txt.template.js
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
`
36 changes: 36 additions & 0 deletions src/sitemap.xml.template.js
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 })
}

0 comments on commit bf01461

Please sign in to comment.