diff --git a/README.md b/README.md index 625dd0b..dc32f39 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This theme is based on Hugo theme [hugo-paper](https://github.com/nanxiaobei/hug - Dark mode - Social icons - Taxonomies support +- Table of Content - SEO Friendly - Comments using [Giscus](https://giscus.app/) - Mathematical notations using [KaTeX](https://katex.org/) diff --git a/static/main.css b/static/main.css index f13f15f..790b808 100644 --- a/static/main.css +++ b/static/main.css @@ -1232,6 +1232,10 @@ body { margin-top: 4rem; } +.mb-12 { + margin-bottom: 3rem; +} + .block { display: block; } @@ -1475,6 +1479,11 @@ body { padding-bottom: 1rem; } +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + .pb-1 { padding-bottom: 0.25rem; } @@ -1507,6 +1516,18 @@ body { padding-top: 8rem; } +.pl-2 { + padding-left: 0.5rem; +} + +.pl-6 { + padding-left: 1.5rem; +} + +.pl-4 { + padding-left: 1rem; +} + .text-center { text-align: center; } @@ -1731,6 +1752,10 @@ article { background-color: rgb(0 0 0 / 2%); } +.hover\:underline:hover { + text-decoration-line: underline; +} + .active\:scale-95:active { --tw-scale-x: .95; --tw-scale-y: .95; diff --git a/templates/page.html b/templates/page.html index 5c69e36..1b5eaf9 100644 --- a/templates/page.html +++ b/templates/page.html @@ -6,6 +6,38 @@ {% include "partials/page_info.html" %} + {% if page.toc %} +
+
+ + Table of Contents + +
+
    + {% for h1 in page.toc %} +
  • + {{ h1.title }} + {% if h1.children %} + + {% endif %} +
  • + {% endfor %} +
+
+
+
+ {% endif %} +
{{ page.content | safe }}