Skip to content

Navigation: omit hidden pages from section index page list by using new front matter variable#648

Merged
LisaFC merged 4 commits intogoogle:masterfrom
aimeeu:aimeeu-section-index
Aug 16, 2021
Merged

Navigation: omit hidden pages from section index page list by using new front matter variable#648
LisaFC merged 4 commits intogoogle:masterfrom
aimeeu:aimeeu-section-index

Conversation

@aimeeu
Copy link
Copy Markdown
Contributor

@aimeeu aimeeu commented Aug 2, 2021

Fix: #647

Update section-index.html to exclude pages with new front matter variable hide_summary: true.
This enables pages hidden from TOC to also be hidden from section summary. (see narranfrei's comment below)

Before:
image

With this code change:
image

Fix: #647

Update section-index.html to exclude pages with front matter
`toc_hide: true`. Pages hidden from TOC should not appear in
a section index's list of pages.
@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 2, 2021
@narrenfrei
Copy link
Copy Markdown
Contributor

I'm think, it's not a but it's a feature ;-)
We had already this discussion: #476

I think, many Docsy users use the parameter toc_hide: true really only to hide a page from the left sidebar menu.
If there is really a need to hide a page from the menu AND from the section index, you should try to set draft: true.

@aimeeu
Copy link
Copy Markdown
Contributor Author

aimeeu commented Aug 3, 2021

If there is really a need to hide a page from the menu AND from the section index, you should try to set draft: true.

In our case, the hidden pages are not drafts. The content is published and a direct link given to certain customers. Hiding a page by setting draft: true and then compiling our production site with the -D flag is not an option.

@narrenfrei
Copy link
Copy Markdown
Contributor

Then I would more prefer to define an additional parameter (e.g. hide_summary) to control that behavior.

section-index: exclude page if hide_summary: true
@aimeeu aimeeu changed the title Navigation: omit hidden pages from section index page list Navigation: omit hidden pages from section index page list by using new front matter variable Aug 4, 2021
@aimeeu
Copy link
Copy Markdown
Contributor Author

aimeeu commented Aug 10, 2021

Added hide_summary parameter and updated docs

Copy link
Copy Markdown
Collaborator

@LisaFC LisaFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this (and sorry for late review, I was on vacation!)

To hide a page or section from the menu, set `toc_hide: true` in front matter.
To hide a page or section from the menu, set `toc_hide: true` in the front matter.

To hide a page on the section summary, set `hide_summary: true` in the front matter. If you want to hide a page from both the TOC menu and the section summary list, you need to set both `toc_hide` and `hide_summery` to `true` in the front matter.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hide_summery -> hide_summary

Also should probably make it clearer what the section summary is - how about:

To hide a page from the section summary on a docs section landing page, set .....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

```

To hide a page or section from the menu, set `toc_hide: true` in front matter.
To hide a page or section from the menu, set `toc_hide: true` in the front matter.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the menu -> from the left navigation menu

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@aimeeu
Copy link
Copy Markdown
Contributor Author

aimeeu commented Aug 16, 2021

@LisaFC
Copy link
Copy Markdown
Collaborator

LisaFC commented Aug 16, 2021

Thanks, looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indicates the PR's author has signed the CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Section index: Page with "toc_hide: true" still appears in section index page list

3 participants