From 07d81ab1f46650b531f81ac3c45cef98bfa946d4 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 17 Apr 2023 16:01:13 -0400 Subject: [PATCH] automatically add toc for large pages --- content/blog/linux-graphics-stack.md | 2 -- content/downloads/index.md | 2 -- themes/red/layouts/_default/single.html | 11 ++++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/content/blog/linux-graphics-stack.md b/content/blog/linux-graphics-stack.md index 9564697..24730b6 100644 --- a/content/blog/linux-graphics-stack.md +++ b/content/blog/linux-graphics-stack.md @@ -21,8 +21,6 @@ The Linux graphics stack is a complex mechanism of many projects that function i _Graphics Dump_ is a new articles series I'm starting, geared towards tutorials and documentation for graphics-related things that are obscure but interesting. There are a thousand graphics tutorials covering how to start drawing in OpenGL, how to implement shadow mapping, and so on - but how many cover how stuff like how _Mesa_ works? I hope these fill someone's weird niche, like they do for me - so please enjoy! -{{}} - # Introduction Since other operating systems hide these processes away from you, it is fortunate that Linux exists to easily showcase how typical desktop graphics systems function! Of course other systems like Windows, macOS, and other operating systems function differently - but a lot of the same concepts apply (API call dispatch, userspace graphics drivers, and display planes as some good examples.) diff --git a/content/downloads/index.md b/content/downloads/index.md index f2529cf..eddface 100644 --- a/content/downloads/index.md +++ b/content/downloads/index.md @@ -6,8 +6,6 @@ title: "Downloads" I host downloads for things that I either want to archive, or worried we might lose. -{{< toc >}} - # Source Map Archive https://archive.ryne.moe/source diff --git a/themes/red/layouts/_default/single.html b/themes/red/layouts/_default/single.html index 77cbf7d..dc112e9 100644 --- a/themes/red/layouts/_default/single.html +++ b/themes/red/layouts/_default/single.html @@ -16,9 +16,14 @@
-
- {{ .Content }} -
+ {{ if or (gt .WordCount 400 ) (.Params.toc) }} +
+ Table of Contents + {{ .Page.TableOfContents }} +
+ {{ end }} + + {{ .Content }} {{ partial "related" . }}