Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:26:00+00:00 2026-06-15T01:26:00+00:00

I am a self confessed webtard so go easy. Using Jekyll I have a

  • 0

I am a self confessed webtard so go easy. Using Jekyll I have a site where the content is pumped through a liquid filter to generate a table of contents. The default.html file contains a little something like this . . .

<div id='content'>
    {{ content | toc }}
    {{ content }}
</div>

How can I use the yaml front matter (with something like do_toc: true) to make the table of contents appear only on specified pages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:26:02+00:00Added an answer on June 15, 2026 at 1:26 am

    You probably want to define a different layout for those pages that need the table of contents and those that don’t. It sounds like you are using default.html as the template for all your content. Instead, make a copy of default.html called something else, e.g. toc.html, and then edit that file (erg, that does mean you’ll have to edit in HTML) to have the div block you provide where you want it.

    Then in pages that need toc, in the yaml header, just use

    --- 
    layout: toc.html
    ---
    

    instead of

    --- 
    layout: default.html
    ---
    

    Note: There’s no need to copy default.html. Simply add create a file named toc.html to your _layouts directory with the following contents:

    ---
    layout: default.html
    ---
    <div id='content'>
     {{ content | toc }}
     {{ content }}
    </div>
    

    and then write your yaml headers for your pages as shown. No duplication of HTML at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Being a self-confessed newbie I'm looking for some advice and guidance :) I have
I'm looking at turning a few SVG images I have on my site in
I have got my self confused on how to construct arrays correctly in PHP
I am trying to self-learn developing Web applications using Python as backend. Since I
I am getting confused with use of self inside blocks, I go through some
I have a self-referencing entity, Department , which can have child Departments (n-level deep).
I'm confused with regards to my code using latest Entety Framework. I have 2
I'm confused about this scope behavior: class Bar: def __init__(self): for fn in [open,openW,remove,mkdir,exists,isdir,listdir]:
I get confused when I see examples of self invoked anonymous functions in Javascript
self.scrollView.frame=CGRectMake(CGRectGetMinX(self.bounds),CGRectGetMaxY(self.bounds),CGRectGetWidth(self.bounds),CGRectGetHeight(self.bounds)); [self.scrollView addSubview:self.hourView]; [self.scrollView addSubview:self.gridView]; Now after embedding some views in the gridview, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.