-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4460505
commit 463f769
Showing
8 changed files
with
1,032 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,88 @@ | ||
import { defineConfig, squooshImageService } from "astro/config"; | ||
import mdx from "@astrojs/mdx"; | ||
import sitemap from "@astrojs/sitemap"; | ||
import path, { dirname } from "path"; | ||
import { fileURLToPath } from "url"; | ||
import tailwind from "@astrojs/tailwind"; | ||
import { defineConfig, squooshImageService } from "astro/config"; | ||
import path, { dirname } from "path"; | ||
import { remarkShakuCodeAnnotate } from "remark-shaku-code-annotate"; | ||
import { fileURLToPath } from "url"; | ||
// import customImageResizerIntegration from "./processImages.mjs"; | ||
import rehypeAutolinkHeadings from "rehype-autolink-headings"; | ||
import { transformerTwoslash } from "shikiji-twoslash"; | ||
import react from "@astrojs/react"; | ||
import svelte from "@astrojs/svelte"; | ||
import bun from "astro-bun-adapter"; | ||
import icon from "astro-icon"; | ||
import react from "@astrojs/react"; | ||
import rehypeAutolinkHeadings from "rehype-autolink-headings"; | ||
import { transformerTwoslash } from "shikiji-twoslash"; | ||
import svgr from "vite-plugin-svgr"; | ||
import { remarkReadingTime } from "./src/plugins/remark-reading-time"; | ||
// import solid from "@astrojs/solid-js"; | ||
import cloudflare from "@astrojs/cloudflare"; | ||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
import svgr from "vite-plugin-svgr"; | ||
import { remarkReadingTime } from "./src/plugins/remark-reading-time" | ||
|
||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
output: "hybrid", | ||
output: "server", | ||
adapter: cloudflare(), | ||
site: "https://example.com", | ||
// prefetch: true, | ||
integrations: [ | ||
mdx({ | ||
}), | ||
sitemap(), | ||
tailwind({ | ||
applyBaseStyles: false, | ||
nesting: true, | ||
}), | ||
// customImageResizerIntegration, | ||
svelte(), | ||
icon(), | ||
// solid({ | ||
// include: ["**/solid/*"], | ||
// }), | ||
react({}), | ||
], | ||
integrations: [mdx({}), sitemap(), tailwind({ | ||
applyBaseStyles: false, | ||
nesting: true | ||
}), | ||
// customImageResizerIntegration, | ||
svelte(), icon(), | ||
// solid({ | ||
// include: ["**/solid/*"], | ||
// }), | ||
react({})], | ||
markdown: { | ||
remarkPlugins: [ | ||
remarkReadingTime, | ||
[ | ||
remarkShakuCodeAnnotate, | ||
{ | ||
fallbackToShiki: true, | ||
theme: "material-theme-darker", | ||
offset: "2", | ||
lang: ["tsx", "jsx", "typescript", "sh", "fish", "json"], | ||
}, | ||
], | ||
], | ||
rehypePlugins: [ | ||
[ | ||
rehypeAutolinkHeadings, | ||
{ | ||
behavior: "append", | ||
}, | ||
], | ||
], | ||
remarkPlugins: [remarkReadingTime, [remarkShakuCodeAnnotate, { | ||
fallbackToShiki: true, | ||
theme: "material-theme-darker", | ||
offset: "2", | ||
lang: ["tsx", "jsx", "typescript", "sh", "fish", "json"] | ||
}]], | ||
rehypePlugins: [[rehypeAutolinkHeadings, { | ||
behavior: "append" | ||
}]], | ||
shikiConfig: { | ||
theme: "material-theme-darker", | ||
transformers: [ | ||
(node) => { | ||
if (node.type === "element" && node.tagName === "pre") { | ||
const tabIndexNode = node.getAttributeNode("tabIndex"); | ||
node.removeAttributeNode(tabIndexNode); | ||
} | ||
return node; | ||
}, | ||
transformerTwoslash(), | ||
], | ||
transformers: [node => { | ||
if (node.type === "element" && node.tagName === "pre") { | ||
const tabIndexNode = node.getAttributeNode("tabIndex"); | ||
node.removeAttributeNode(tabIndexNode); | ||
} | ||
return node; | ||
}, transformerTwoslash()] | ||
}, | ||
extendDefaultPlugins: true, | ||
extendDefaultPlugins: true | ||
}, | ||
vite: { | ||
ssr: { | ||
noExternal: ["@radix-ui/react-tabs"], | ||
noExternal: ["@radix-ui/react-tabs"] | ||
}, | ||
resolve: { | ||
alias: { | ||
$: path.resolve(__dirname, "./src"), | ||
}, | ||
$: path.resolve(__dirname, "./src") | ||
} | ||
}, | ||
plugins: [ | ||
svgr({ | ||
include: "**/*.svg?react", | ||
svgrOptions: { | ||
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"], | ||
svgoConfig: { | ||
plugins: [ | ||
"preset-default", | ||
"removeTitle", | ||
"removeDesc", | ||
"removeDoctype", | ||
"cleanupIds", | ||
], | ||
}, | ||
}, | ||
}), | ||
], | ||
plugins: [svgr({ | ||
include: "**/*.svg?react", | ||
svgrOptions: { | ||
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"], | ||
svgoConfig: { | ||
plugins: ["preset-default", "removeTitle", "removeDesc", "removeDoctype", "cleanupIds"] | ||
} | ||
} | ||
})] | ||
}, | ||
image: { | ||
service: squooshImageService(), | ||
service: squooshImageService() | ||
}, | ||
redirects: { | ||
"/blog": { | ||
status: 308, | ||
destination: "/blog/1", | ||
}, | ||
}, | ||
}); | ||
destination: "/blog/1" | ||
} | ||
} | ||
}); |
Oops, something went wrong.