This commit is contained in:
parent
2e1d270837
commit
07923196fb
@ -1,6 +1,4 @@
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
import { Root } from "mdast"
|
||||
import { classNames } from "../util/lang"
|
||||
// @ts-ignore
|
||||
// import script from "./scripts/comments.inline"
|
||||
|
||||
@ -28,7 +26,7 @@ export default ((opts: Options) => {
|
||||
show_email_subscription: false,
|
||||
simple_view: false
|
||||
};
|
||||
`;
|
||||
`
|
||||
|
||||
const embedScript = `
|
||||
!function(e,n){
|
||||
@ -42,28 +40,17 @@ export default ((opts: Options) => {
|
||||
d.appendChild(r)
|
||||
}
|
||||
}(remark_config.components||["embed"], document);
|
||||
`;
|
||||
`
|
||||
|
||||
return {
|
||||
name: "TableOfContents",
|
||||
markdownPlugins() {
|
||||
return [
|
||||
() => {
|
||||
return async (tree: Root, file) => {
|
||||
// const display = file.data.frontmatter?.enableComments ?? true
|
||||
// if (display) {
|
||||
<>
|
||||
<div id="remark42" style="margin-top: 2rem"></div>
|
||||
<script dangerouslySetInnerHTML={{ __html: remarkConfig }}></script>
|
||||
<script dangerouslySetInnerHTML={{ __html: embedScript }}></script>
|
||||
</>
|
||||
// }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
return async (tree: Root, file) => {
|
||||
<>
|
||||
<hr />
|
||||
<div id="remark42" style="margin-top: 2rem"></div>
|
||||
<script dangerouslySetInnerHTML={{ __html: remarkConfig }}></script>
|
||||
<script dangerouslySetInnerHTML={{ __html: embedScript }}></script>
|
||||
</>
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Remark
|
||||
}) satisfies QuartzComponentConstructor<Options>;
|
||||
}) satisfies QuartzComponentConstructor<Options>
|
||||
|
@ -234,7 +234,6 @@ export function renderPage(
|
||||
</div>
|
||||
</div>
|
||||
<Content {...componentData} />
|
||||
<hr />
|
||||
<div class="page-footer">
|
||||
{afterBody.map((BodyComponent) => (
|
||||
<BodyComponent {...componentData} />
|
||||
|
Loading…
Reference in New Issue
Block a user