vsoch/docsy-jekyll

Creating a TOC for a page/links to sub headings

pschloss opened this issue · 4 comments

I am extracting a wiki that I have been maintaining in mediawiki to create a GitHub-hosted site. I really like your docsy template! One thing that I like about mediawiki is that if a page has enough headers it creates a TOC for that page to speed up navigation. With this it also creates links to those headers. Is anything like this possible with the current version of the template or is something in the works?

Sorry, nearly as soon as I posted my issue, I see that if I hover a little to the right of the heading there is a paragraph sign for a link 👍

vsoch commented

No worries! Glad you found it. Another option is vsoch/docsy-jekyll that is based on docsy and also has the side navigation. Let me know if you have any other questions - closing issue since it’s resolved.

Can you tell me what triggers the TOC that I see on the right column for the news archive page? That's what I'd like to have pop up for longer wiki articles with multiple sub headings

vsoch commented

Sure! The TOC is generated based on finding the children of the first h1 tag. So for example if you look at this page https://vsoch.github.io/docsy-jekyll/docs/getting-started you see the long list of links on the right, that corresponds to a markdown page that looks like this: https://github.com/vsoch/docsy-jekyll/blob/master/_docs/getting-started.md

---
title: Getting Started
tags: 
 - jekyll
 - github
description: Getting started with Docsy Jekyll
---

# Getting Started

## Features

### User Interaction


On the right side of any page, you'll notice links to edit the page, or
open an issue. This ensures that any time you have a question or want to 
suggest or request a change, you can do so immediately and link directly
to the section of interest. The sections on the page also have permalinks so
you can link directly to them.
...

(take a look at the raw file to see those section headers with #). The single # corresponds to h1, and ## to h2, etc.

Apologies that I missed that you posted this on docsy jekyll (and I recommended the same library!) For some reason I misread when I clicked the email and thought it was for https://github.com/vsoch/mkdocs-jekyll/.