mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-20 18:01:36 -04:00
✨ Add Tables of Contents to articles
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<article class="max-w-prose">
|
||||
<header>
|
||||
<article>
|
||||
<header class="max-w-prose">
|
||||
{{ if .Site.Params.article.showBreadcrumbs | default false }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
{{ end }}
|
||||
@@ -11,10 +11,19 @@
|
||||
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
|
||||
</div>
|
||||
</header>
|
||||
<section class="markdown dark:markdown-invert">
|
||||
{{ .Content | emojify }}
|
||||
<section class="flex flex-col max-w-full mt-0 lg:flex-row markdown dark:markdown-invert">
|
||||
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in .TableOfContents "<ul") }}
|
||||
<div class="order-first px-0 lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8 lg:order-last">
|
||||
<div class="ltr:pl-5 rtl:pr-5 toc lg:sticky lg:top-10">
|
||||
{{ partial "toc.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="max-w-prose">
|
||||
{{ .Content | emojify }}
|
||||
</div>
|
||||
</section>
|
||||
<footer class="pt-8">
|
||||
<footer class="pt-8 max-w-prose">
|
||||
{{ partial "author.html" . }}
|
||||
{{ partial "sharing-links.html" . }}
|
||||
{{ partial "article-pagination.html" . }}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<details open class="mt-0 overflow-hidden rounded-lg rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 lg:mt-3">
|
||||
<summary
|
||||
class="block py-1 text-lg font-semibold rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 text-neutral-800 dark:text-neutral-100 lg:hidden bg-neutral-100 dark:bg-neutral-700"
|
||||
>
|
||||
{{ i18n "article.table_of_contents" }}
|
||||
</summary>
|
||||
<div
|
||||
class="py-2 border-dotted ltr:border-l rtl:border-r rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 border-neutral-300 dark:border-neutral-600"
|
||||
>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
</details>
|
||||
Reference in New Issue
Block a user