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