lpubsppop01's site
I moved this site from Vercel to Cloudflare Pages. It was already deployed to both before this work, so I only changed the custom domain settings.
I tried to fix dark mode issue on Safari, but it didn't work.
I changed the notation "blog" to "diary" because I feel that that it better reflects my intension.
I changed the type of the title element in the top bar to h1 and the heading levels in the diary to h2 and below.
For the latter, simply replaced the Markdown string with a regular expression.
It partially not working, so I will fix it later. (Fixed on Mar 11, 2023)
// Decrease heading levels by one
const modifiedLines = []
var isInCode = false
for (const line of matterResult.content.split('\n')) {
if (isInCode) {
if (line.startsWith('```')) {
isInCode = false
}
modifiedLines.push(line)
} else {
if (line.startsWith('```')) {
isInCode = true
modifiedLines.push(line)
} else {
const modifiedLine = line.replaceAll(/(^|\n)#/g, '$&#')
modifiedLines.push(modifiedLine)
}
}
}
const modifiedContent = modifiedLines.join('\n')