chore: remove deprecated files and update configuration for improved SEO and performance. Adjust font usage in styles, enhance sitemap handling, and refine search functionality.
This commit is contained in:
@@ -18,37 +18,56 @@ import rehypeDocument from 'rehype-document'
|
||||
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections'
|
||||
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'
|
||||
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import vercel from '@astrojs/vercel';
|
||||
|
||||
function rehypeDemoteH1AndStripTitle() {
|
||||
return (tree: any) => {
|
||||
const walk = (node: any, parent: any | null, indexInParent: number | null) => {
|
||||
if (!node) return
|
||||
const isElement = node.type === 'element'
|
||||
if (isElement) {
|
||||
if (node.tagName === 'title') {
|
||||
if (parent && Array.isArray(parent.children) && indexInParent !== null && indexInParent > -1) {
|
||||
parent.children.splice(indexInParent, 1)
|
||||
return
|
||||
}
|
||||
}
|
||||
if (node.tagName === 'h1') {
|
||||
node.tagName = 'h2'
|
||||
}
|
||||
}
|
||||
if (Array.isArray(node.children)) {
|
||||
for (let i = node.children.length - 1; i >= 0; i--) {
|
||||
walk(node.children[i], node, i)
|
||||
}
|
||||
}
|
||||
}
|
||||
walk(tree, null, null)
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
site: 'https://www.cojocarudavid.me',
|
||||
|
||||
integrations: [
|
||||
expressiveCode({
|
||||
themes: ['catppuccin-latte', 'ayu-dark'],
|
||||
plugins: [pluginCollapsibleSections(), pluginLineNumbers()],
|
||||
useDarkModeMediaQuery: true,
|
||||
defaultProps: {
|
||||
wrap: true,
|
||||
collapseStyle: 'collapsible-auto',
|
||||
overridesByLang: {
|
||||
'ansi,bat,bash,batch,cmd,console,powershell,ps,ps1,psd1,psm1,sh,shell,shellscript,shellsession,text,zsh':
|
||||
{
|
||||
showLineNumbers: true,
|
||||
},
|
||||
},
|
||||
integrations: [expressiveCode({
|
||||
themes: ['catppuccin-latte', 'ayu-dark'],
|
||||
plugins: [pluginCollapsibleSections(), pluginLineNumbers()],
|
||||
useDarkModeMediaQuery: true,
|
||||
defaultProps: {
|
||||
wrap: true,
|
||||
collapseStyle: 'collapsible-auto',
|
||||
overridesByLang: {
|
||||
'ansi,bat,bash,batch,cmd,console,powershell,ps,ps1,psd1,psm1,sh,shell,shellscript,shellsession,text,zsh':
|
||||
{
|
||||
showLineNumbers: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
mdx(),
|
||||
react(),
|
||||
sitemap(),
|
||||
icon(),
|
||||
],
|
||||
},
|
||||
}), mdx(), react(), sitemap(), icon()],
|
||||
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
plugins: [tailwindcss() as any],
|
||||
optimizeDeps: {
|
||||
exclude: ["satori", "satori-html"],
|
||||
include: [
|
||||
@@ -93,6 +112,7 @@ export default defineConfig({
|
||||
rel: ['nofollow', 'noreferrer', 'noopener'],
|
||||
},
|
||||
],
|
||||
rehypeDemoteH1AndStripTitle,
|
||||
rehypeHeadingIds,
|
||||
rehypeKatex,
|
||||
[
|
||||
@@ -109,4 +129,4 @@ export default defineConfig({
|
||||
},
|
||||
|
||||
adapter: vercel()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user