mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-20 03:14:06 -06:00
Disable ToC for encrypted notes
This commit is contained in:
parent
689b54a945
commit
78d4fb5faa
@ -25,7 +25,7 @@ export default ((opts?: Partial<Options>) => {
|
|||||||
displayClass,
|
displayClass,
|
||||||
cfg,
|
cfg,
|
||||||
}: QuartzComponentProps) => {
|
}: QuartzComponentProps) => {
|
||||||
if (!fileData.toc) {
|
if (!fileData.toc || fileData.encryptionResult) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,13 +54,14 @@ export default ((opts?: Partial<Options>) => {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<OverflowList class={fileData.collapseToc ? "collapsed toc-content" : "toc-content"}>
|
<OverflowList class={fileData.collapseToc ? "collapsed toc-content" : "toc-content"}>
|
||||||
{fileData.toc.map((tocEntry) => (
|
{!fileData.encryptionResult &&
|
||||||
<li key={tocEntry.slug} class={`depth-${tocEntry.depth}`}>
|
fileData.toc.map((tocEntry) => (
|
||||||
<a href={`#${tocEntry.slug}`} data-for={tocEntry.slug}>
|
<li key={tocEntry.slug} class={`depth-${tocEntry.depth}`}>
|
||||||
{tocEntry.text}
|
<a href={`#${tocEntry.slug}`} data-for={tocEntry.slug}>
|
||||||
</a>
|
{tocEntry.text}
|
||||||
</li>
|
</a>
|
||||||
))}
|
</li>
|
||||||
|
))}
|
||||||
</OverflowList>
|
</OverflowList>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user