Skip to content

Read the values of frontmatter from .mdx files #1342

Discussion options

You must be logged in to vote

I used a custom sitemap generator like:

scripts/build-sitemap.js

const fs = require('fs')
const glob = require('fast-glob')
const prettier = require('prettier')
const { getAllPublishedEssays } = require('@/utils/essay/getAllEssayPreviews')
const { getAllPublishedTutorials } = require('@/utils/tutorial/getAllTutorialPreviews')

const posts = [...getAllPublishedEssays(), ...getAllPublishedTutorials()]

const config = {
	siteUrl: 'https://akshaykadam.com',
	changefreq: 'daily',
	priority: '0.7',
	lastmod: new Date().toISOString(),
}

const robotsTxt = `
User-agent: *
Allow: /
Host: ${config.siteUrl}
Sitemap: ${config.siteUrl}/sitemap.xml
`.trim()

const main = async () => {
	const prettierCo…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@deadcoder0904
Comment options

@wooorm
Comment options

@deadcoder0904
Comment options

@ChristianMurphy
Comment options

@deadcoder0904
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by deadcoder0904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants