new-window links in md and footer
This commit is contained in:
parent
ed91d1c76d
commit
699feac2f2
5 changed files with 21 additions and 3 deletions
|
@ -3,6 +3,7 @@ import path from "path";
|
|||
import md from "markdown-it";
|
||||
import mdAnchor from "markdown-it-anchor";
|
||||
import mdFootnote from "markdown-it-footnote";
|
||||
import mdLinkAttributes from "markdown-it-link-attributes";
|
||||
import prettier from "prettier";
|
||||
import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc.js";
|
||||
|
@ -27,7 +28,16 @@ export default (config) => {
|
|||
symbol: "",
|
||||
}),
|
||||
})
|
||||
.use(mdFootnote);
|
||||
.use(mdFootnote)
|
||||
.use(mdLinkAttributes, {
|
||||
matcher(href) {
|
||||
return href.match(/^https?:\/\//);
|
||||
},
|
||||
attrs: {
|
||||
target: "_blank",
|
||||
rel: "noopener",
|
||||
},
|
||||
});
|
||||
config.setLibrary("md", mdLib);
|
||||
config.addPassthroughCopy({
|
||||
assets: "/",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue