mirror of
https://github.com/alrayyes/wiki.git
synced 2025-06-09 15:03:40 +00:00
feat: add collapseByDefault option to TableOfContents (closes #566)
This commit is contained in:
parent
a62a97c7ab
commit
101e9946bd
4 changed files with 9 additions and 3 deletions
quartz/components
|
@ -20,7 +20,7 @@ function TableOfContents({ fileData, displayClass }: QuartzComponentProps) {
|
|||
|
||||
return (
|
||||
<div class={`toc ${displayClass ?? ""}`}>
|
||||
<button type="button" id="toc">
|
||||
<button type="button" id="toc" class={fileData.collapseToc ? "collapsed" : ""}>
|
||||
<h3>Table of Contents</h3>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
@ -60,7 +60,7 @@ function LegacyTableOfContents({ fileData }: QuartzComponentProps) {
|
|||
}
|
||||
|
||||
return (
|
||||
<details id="toc" open>
|
||||
<details id="toc" open={!fileData.collapseToc}>
|
||||
<summary>
|
||||
<h3>Table of Contents</h3>
|
||||
</summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue