diff --git a/README.md b/README.md index ef3e4d6..81b3ce8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Forked from [Ezhil Theme](https://github.com/vividvilla/ezhil) - Auto Dark Mode(based on system theme) - Dark/Light Mode toggle - tl:dr; frontamatter +- Table of contents - Cache busting for CSS files - Disqus Comments @@ -42,6 +43,7 @@ date: tldr: (optional) draft: true/false (optional) tags: [tag names] (optional) +toc: true/false (optional) --- ``` diff --git a/assets/css/dark.css b/assets/css/dark.css index f93adf1..e5bdc85 100644 --- a/assets/css/dark.css +++ b/assets/css/dark.css @@ -67,6 +67,11 @@ h6::before { content: "###### "; } +.toc { + background-color: #272822; + color: white; +} + a { border-bottom: 3px solid var(--darkMaincolor); color: inherit; diff --git a/assets/css/main.css b/assets/css/main.css index 3a7d1cd..46573c3 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -161,6 +161,15 @@ h6::before { color: var(--maincolor); content: '###### '; } letter-spacing: -0.5px; } +.toc { + background-color: #ececec; + color: #232333; + padding: 10px; + padding-bottom: 0; + border-radius: 5px; + display: inline-block; +} + /* Footer */ footer { display: flex; diff --git a/exampleSite/content/posts/tg-gh.md b/exampleSite/content/posts/tg-gh.md index 4400148..bce22d5 100644 --- a/exampleSite/content/posts/tg-gh.md +++ b/exampleSite/content/posts/tg-gh.md @@ -3,6 +3,7 @@ title: Telegram Bot for GitHub Actions date: "2020-04-01" description: Make a Telegram bot with Node.js and use it with GitHub Actions for sending notifications to you about the repo. tldr: Making GitHub Actions with Js Code +toc: true --- ## Telegram [Telegram](https://telegram.org/) is a cloud-based mobile and desktop messaging app with a focus on security and speed. It is free to use and extensively hackable. It also has a good bot support system. The API is also easy to implement and has many wrappers for building bots with the API. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6a30c8f..99067bd 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -11,6 +11,12 @@ {{ .Params.tldr }} {{ end }} + {{ if isset .Params "toc" }} +
+ Table of contents: + {{ .TableOfContents }} +
{{ end }} +
{{ .Content }}