Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copy button for code blocks on MD files - branch #121

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,26 @@ import searchIndex from "./src/lib/search-index.js"
import sitemap from "@astrojs/sitemap"
import tailwind from "@astrojs/tailwind"
import widont from "rehype-widont"
import astroExpressiveCode from 'astro-expressive-code'

const frameCodeOptions = {
// Configures the plugin.
extractFileNameFromCode: false,
}

/** @type {import('astro-expressive-code').AstroExpressiveCodeOptions} */
const astroExpressiveCodeOptions = {
// Configures the plugin.
theme: 'nord',
frames: frameCodeOptions,
useThemedScrollbars: false,
}

// https://astro.build/config
export default defineConfig({
site: "https://ddev.com/",
integrations: [
astroExpressiveCode(astroExpressiveCodeOptions),
tailwind(),
react(),
astroImageTools,
Expand All @@ -39,11 +54,7 @@ export default defineConfig({
prefetch(),
],
markdown: {
syntaxHighlight: "shiki",
// https://github.com/shikijs/shiki/blob/main/docs/languages.md
shikiConfig: {
theme: "nord",
},
remarkPlugins: [remarkReadingTime],
rehypePlugins: [
widont,
Expand Down
81 changes: 81 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@types/react": "^18.2.23",
"@types/react-dom": "^18.2.8",
"astro": "^3.2.0",
"astro-expressive-code": "^0.26.2",
"astro-imagetools": "^0.9.0",
"astro-robots-txt": "^1.0.0",
"astro-seo": "^0.8.0",
Expand Down