Skip to content

Commit

Permalink
feat: added support for code highlighting in blog
Browse files Browse the repository at this point in the history
  • Loading branch information
GioPan04 committed Mar 24, 2024
1 parent defe8c5 commit 1878a22
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
6 changes: 5 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { defineConfig } from 'astro/config';
import tailwind from "@astrojs/tailwind";
import sitemap from '@astrojs/sitemap';
import react from "@astrojs/react";
import rehypeHighlight from "rehype-highlight";

// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), react(), sitemap()],
site: "https://giopan.dev"
site: "https://giopan.dev",
markdown: {
rehypePlugins: [rehypeHighlight]
}
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"lucide-react": "^0.350.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rehype-highlight": "^7.0.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2"
}
Expand Down
50 changes: 50 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,13 @@ hast-util-from-parse5@^8.0.0:
vfile-location "^5.0.0"
web-namespaces "^2.0.0"

hast-util-is-element@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz#6e31a6532c217e5b533848c7e52c9d9369ca0932"
integrity sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==
dependencies:
"@types/hast" "^3.0.0"

hast-util-parse-selector@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz#352879fa86e25616036037dd8931fb5f34cb4a27"
Expand Down Expand Up @@ -1843,6 +1850,16 @@ hast-util-to-parse5@^8.0.0:
web-namespaces "^2.0.0"
zwitch "^2.0.0"

hast-util-to-text@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/hast-util-to-text/-/hast-util-to-text-4.0.0.tgz#7f33a45d0bf7981ead44e82d9d8d75f511b3642f"
integrity sha512-EWiE1FSArNBPUo1cKWtzqgnuRQwEeQbQtnFJRYV1hb1BWDgrAlBU0ExptvZMM/KSA82cDpm2sFGf3Dmc5Mza3w==
dependencies:
"@types/hast" "^3.0.0"
"@types/unist" "^3.0.0"
hast-util-is-element "^3.0.0"
unist-util-find-after "^5.0.0"

hast-util-whitespace@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621"
Expand All @@ -1861,6 +1878,11 @@ hastscript@^8.0.0:
property-information "^6.0.0"
space-separated-tokens "^2.0.0"

highlight.js@~11.9.0:
version "11.9.0"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.9.0.tgz#04ab9ee43b52a41a047432c8103e2158a1b8b5b0"
integrity sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==

html-escaper@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-3.0.3.tgz#4d336674652beb1dcbc29ef6b6ba7f6be6fdfed6"
Expand Down Expand Up @@ -2134,6 +2156,15 @@ loose-envify@^1.1.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

lowlight@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-3.1.0.tgz#aa394c5f3a7689fce35fa49a7c850ba3ead4f590"
integrity sha512-CEbNVoSikAxwDMDPjXlqlFYiZLkDJHwyGu/MfOsJnF3d7f3tds5J3z8s/l9TMXhzfsJCCJEAsD78842mwmg0PQ==
dependencies:
"@types/hast" "^3.0.0"
devlop "^1.0.0"
highlight.js "~11.9.0"

lru-cache@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
Expand Down Expand Up @@ -3096,6 +3127,17 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"

rehype-highlight@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/rehype-highlight/-/rehype-highlight-7.0.0.tgz#f2fd0eaebea7d4d4ce2fca2e8d9e3aea9441aefc"
integrity sha512-QtobgRgYoQaK6p1eSr2SD1i61f7bjF2kZHAQHxeCHAuJf7ZUDMvQ7owDq9YTkmar5m5TSUol+2D3bp3KfJf/oA==
dependencies:
"@types/hast" "^3.0.0"
hast-util-to-text "^4.0.0"
lowlight "^3.0.0"
unist-util-visit "^5.0.0"
vfile "^6.0.0"

rehype-parse@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-9.0.0.tgz#3949faeec6f466ec57774215661e0d75469195d9"
Expand Down Expand Up @@ -3732,6 +3774,14 @@ unified@^11.0.0, unified@^11.0.4:
trough "^2.0.0"
vfile "^6.0.0"

unist-util-find-after@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz#3fccc1b086b56f34c8b798e1ff90b5c54468e896"
integrity sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==
dependencies:
"@types/unist" "^3.0.0"
unist-util-is "^6.0.0"

unist-util-is@^5.0.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.2.1.tgz#b74960e145c18dcb6226bc57933597f5486deae9"
Expand Down

0 comments on commit 1878a22

Please sign in to comment.