Skip to content

Commit ab18af0

Browse files
committed
update remark notes plugin
ref: https://rishikc.com/projects/ Signed-off-by: rishichawda <rishichawda@users.noreply.github.com>
1 parent 603d3e4 commit ab18af0

File tree

3 files changed

+55
-47
lines changed

3 files changed

+55
-47
lines changed

astro.config.mjs

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import mdx from '@astrojs/mdx';
55
import { h, s } from 'hastscript'
66

77
import siteMetadata from './metadata';
8-
import { getEnv } from 'astro/env/runtime';
98
import remarkToc from 'remark-toc';
109
import rehypePresetMinify from 'rehype-preset-minify';
1110

1211
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs';
1312
import remarkNotes from 'remark-notes-plugin';
1413
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
1514
import rehypeSlug from 'rehype-slug';
16-
import { imageService } from "@unpic/astro/service";
1715

1816
import sitemap from '@astrojs/sitemap';
1917

@@ -53,33 +51,44 @@ const AnchorLinkIcon = h(
5351
)
5452

5553
export default defineConfig({
56-
integrations: [mdx({
57-
syntaxHighlight: 'shiki',
58-
shikiConfig: { theme: 'dracula' },
59-
remarkPlugins: [remarkToc, remarkReadingTime, remarkNotes],
60-
rehypePlugins: [rehypePresetMinify, rehypeSlug, [rehypeAutolinkHeadings, {
61-
behavior: 'append',
62-
content: AnchorLinkIcon,
63-
}]],
64-
remarkRehype: { footnoteLabel: 'Footnotes' },
65-
gfm: true,
66-
}), sitemap(), playformCompress({
67-
CSS: true,
68-
HTML: {
69-
"html-minifier-terser": {
70-
removeAttributeQuotes: false,
71-
collapseWhitespace: true,
72-
removeComments: true,
73-
minifyCSS: true,
74-
minifyJS: true,
54+
integrations: [
55+
mdx({
56+
syntaxHighlight: 'shiki',
57+
shikiConfig: { theme: 'dracula' },
58+
remarkPlugins: [
59+
remarkToc,
60+
remarkReadingTime,
61+
remarkNotes
62+
],
63+
rehypePlugins: [
64+
rehypePresetMinify,
65+
rehypeSlug,
66+
[rehypeAutolinkHeadings, {
67+
behavior: 'append',
68+
content: AnchorLinkIcon,
69+
}]
70+
],
71+
remarkRehype: { footnoteLabel: 'Footnotes' },
72+
gfm: true,
73+
}),
74+
sitemap(),
75+
playformCompress({
76+
CSS: true,
77+
HTML: {
78+
"html-minifier-terser": {
79+
removeAttributeQuotes: false,
80+
collapseWhitespace: true,
81+
removeComments: true,
82+
minifyCSS: true,
83+
minifyJS: true,
84+
},
7585
},
76-
},
77-
Image: true,
78-
JavaScript: true,
79-
SVG: true,
80-
Logger: 0,
81-
})],
82-
86+
Image: true,
87+
JavaScript: true,
88+
SVG: true,
89+
Logger: 0,
90+
})
91+
],
8392
site: siteMetadata.siteUrl,
8493
trailingSlash: 'always',
8594
compressHTML: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"rehype-highlight": "^7.0.2",
3939
"rehype-preset-minify": "^7.0.1",
4040
"rehype-slug": "^6.0.0",
41-
"remark-notes-plugin": "^1.0.2",
41+
"remark-notes-plugin": "^2.0.0",
4242
"remark-smartypants": "^3.0.2",
4343
"remark-toc": "^9.0.0",
4444
"tailwindcss": "^4.1.13"

yarn.lock

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,6 +2868,11 @@ hast-util-whitespace@^3.0.0:
28682868
dependencies:
28692869
"@types/hast" "^3.0.0"
28702870

2871+
hast@^1.0.0:
2872+
version "1.0.0"
2873+
resolved "https://registry.yarnpkg.com/hast/-/hast-1.0.0.tgz#50615e6b2b0583e5608bc76c47029722f1e00607"
2874+
integrity sha512-vFUqlRV5C+xqP76Wwq2SrM0kipnmpxJm7OfvVXpB35Fp+Fn4MV+ozr+JZr5qFvyR1q/U+Foim2x+3P+x9S1PLA==
2875+
28712876
hastscript@^9.0.0, hastscript@^9.0.1:
28722877
version "9.0.1"
28732878
resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-9.0.1.tgz#dbc84bef6051d40084342c229c451cd9dc567dff"
@@ -3421,7 +3426,7 @@ mdast-util-phrasing@^4.0.0:
34213426
"@types/mdast" "^4.0.0"
34223427
unist-util-is "^6.0.0"
34233428

3424-
mdast-util-to-hast@^13.0.0, mdast-util-to-hast@^13.2.0:
3429+
mdast-util-to-hast@^13.0.0:
34253430
version "13.2.0"
34263431
resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4"
34273432
integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==
@@ -4836,16 +4841,15 @@ remark-mdx@^3.0.0:
48364841
mdast-util-mdx "^3.0.0"
48374842
micromark-extension-mdxjs "^3.0.0"
48384843

4839-
remark-notes-plugin@^1.0.2:
4840-
version "1.0.2"
4841-
resolved "https://registry.yarnpkg.com/remark-notes-plugin/-/remark-notes-plugin-1.0.2.tgz#3d33d5eded1223be2badf69d363c04c5187a7f07"
4842-
integrity sha512-svtGFefVfLT221KK7nD9nOJlunOM/ghHmE/mEANZEs8759UbKLz/nu1kFPLMUHxEMmJhWhmhADuq4tMISxWt6A==
4844+
remark-notes-plugin@^2.0.0:
4845+
version "2.0.0"
4846+
resolved "https://registry.yarnpkg.com/remark-notes-plugin/-/remark-notes-plugin-2.0.0.tgz#284e2d08933a381453baf3a749ffbc193190771e"
4847+
integrity sha512-LXjbJxYPeaiSB+3RmU9bw8po++bvlpOK8Wy+Wej6lxKg5djRGtaDpWBvhsBAjPad3cDc6FZjpV3BlxNn6IatPA==
48434848
dependencies:
4844-
hast-util-to-html "^9.0.5"
4849+
hast "^1.0.0"
48454850
mdast "^3.0.0"
4846-
mdast-util-to-hast "^13.2.0"
4847-
remark "^15.0.1"
48484851
unified "^11.0.4"
4852+
unist "^0.0.1"
48494853
unist-util-visit "^5.0.0"
48504854

48514855
remark-parse@^11.0.0:
@@ -4896,16 +4900,6 @@ remark-toc@^9.0.0:
48964900
"@types/mdast" "^4.0.0"
48974901
mdast-util-toc "^7.0.0"
48984902

4899-
remark@^15.0.1:
4900-
version "15.0.1"
4901-
resolved "https://registry.yarnpkg.com/remark/-/remark-15.0.1.tgz#ac7e7563260513b66426bc47f850e7aa5862c37c"
4902-
integrity sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==
4903-
dependencies:
4904-
"@types/mdast" "^4.0.0"
4905-
remark-parse "^11.0.0"
4906-
remark-stringify "^11.0.0"
4907-
unified "^11.0.0"
4908-
49094903
restructure@^3.0.0:
49104904
version "3.0.2"
49114905
resolved "https://registry.yarnpkg.com/restructure/-/restructure-3.0.2.tgz#e6b2fad214f78edee21797fa8160fef50eb9b49a"
@@ -5554,6 +5548,11 @@ unist-util-visit@^5.0.0:
55545548
unist-util-is "^6.0.0"
55555549
unist-util-visit-parents "^6.0.0"
55565550

5551+
unist@^0.0.1:
5552+
version "0.0.1"
5553+
resolved "https://registry.yarnpkg.com/unist/-/unist-0.0.1.tgz#360b99428d032d37724c467e186247c44a1429b1"
5554+
integrity sha512-bnzuF8b6d47WubA4a5yLqFbuZz/v/NS6eRwUIdOaDmsqzwTlyv8yS1g3M7ISdtBQrigPD3qKK87Cu7zhEfCF3A==
5555+
55575556
unpic@^4.1.3:
55585557
version "4.1.3"
55595558
resolved "https://registry.yarnpkg.com/unpic/-/unpic-4.1.3.tgz#5345ec2a919e39c49ac2fbbd52dcba158bcdb661"

0 commit comments

Comments
 (0)