Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for breadcrumbs param in front matter for showing/hiding breadcrumbs on specific pages #367

Merged
merged 6 commits into from
Jun 2, 2024

Conversation

ggwicz
Copy link
Contributor

@ggwicz ggwicz commented Apr 21, 2024

Hi there! Hextra is awesome and I wanted to propose a feature that I've found useful recently: the ability to hide breadcrumbs on specific pages.

This has been especially useful on "index" pages, for example, where even with a custom linkTitle there's just not much value added from the breadcrumb.

I've also included some documentation updates for breadcrumbs in general—and for this hideBreadcrumbs option specifically—as I wasn't finding that information elsewhere.

Example

Before

/docs /docs/processes/story-points
At my Docs index page (/docs), the title Documentation being repeated twice by the auto-generated breadcrumbs isn't really helpful. hextra-breadcrumbs-before-A But it is, of course, still helpful once we get into the actual sub-pages, like /docs/processes/story-points in this example: hextra-breadcrumbs-before-B

After

With this new hideBreadcrumbs param, you can have the best of both worlds.

I add it to the front matter of /content/docs/_index.md:

---
hideBreadcrumbs: true
title: Documentation
weight: 10
cascade:
  type: docs
  sidebar:
    open: true
---

And then no longer have it on the /docs page, but all the other breadcrumbs generation continues to work exactly the same.

/docs /docs/processes/story-points
hextra-breadcrumbs-after-A hextra-breadcrumbs-after-B

Copy link

netlify bot commented Apr 21, 2024

Deploy Preview for hugo-hextra ready!

Name Link
🔨 Latest commit 99fa164
🔍 Latest deploy log https://app.netlify.com/sites/hugo-hextra/deploys/6628140fcf474500080d9aa1
😎 Deploy Preview https://deploy-preview-367--hugo-hextra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Owner

@imfing imfing left a comment

Choose a reason for hiding this comment

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

Hi @ggwicz, thank you for the PR. I was also thinking about adding this recently.

I wonder if changing the flag name from hideBreadcrumbs to simply:

---
breadcrumbs: true # or false
---

would make more sense, similar to the toc flag.

@ggwicz
Copy link
Contributor Author

ggwicz commented Apr 22, 2024

Yeah good call @imfing! Fixed!

@ggwicz ggwicz changed the title feat: add hideBreadcrumbs functionality for hiding breadcrumbs atop specific pages feat: add support for breadcrumbs param in front matter for showing/hiding breadcrumbs on specific pages Apr 22, 2024
@ggwicz ggwicz requested a review from imfing April 22, 2024 04:51
Copy link
Owner

@imfing imfing left a comment

Choose a reason for hiding this comment

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

Great work, appreciate for adding the doc @ggwicz

@imfing imfing added this to the v0.8.0 milestone Apr 29, 2024
@imfing imfing merged commit 3cba6b9 into imfing:main Jun 2, 2024
4 checks passed
zagjason-sa-taylorfarms added a commit to tffi/hextra that referenced this pull request Aug 14, 2024
* refactor: extract card shortcode to partial (imfing#339)

* refactor: extract card shortcode to partial

* chore: update hugo stats

* feat: configurable cols for feature-grid shortcode (imfing#342)

* feat: configurable cols for feature-grid shortcode

* chore: update css files

* chore: add hextra prefix to cards css var

* chore: rebuild css

* chore: add quicklink script to head in doc site

* docs: add more projects to showcase

* feat: add styles for definition list (imfing#344)

* feat: dd styles for definition list

* chore: re-generate css

* feat: pdf shortcode (unstable) (imfing#345)

* chore: improve search bar shortcut display (imfing#346)

* chore: improve search bar shortcut display

* chore: remove focusout handler

* feat: support sort blog post list page (imfing#348)

* chore: bump hugo version to 0.124.1 in devcontainer

* chore: add homebrew to devcontainer

[skip ci]

* chore: revert adding homebrew to devcontainer

* bloat up the image size and increase the cold start time

[skip ci]

* docs(i18n): add zh-cn translation of RSS button (imfing#353)

I notice that RSS button is missed when switching language to Chinese in the documentation of Hextra. It's added now in this PR, hope it helps.

* fix: js scripts not in body element (imfing#356)

* chore(deps): bump npm package versions (imfing#361)

* chore(deps): bump npm package versions

* recompile css

* chore: recompile css

* chore: 2023 -> 2024

* chore(deps): add taskfile and bump assets lib versions (imfing#362)

* chore: add Taskfile for automating common tasks

* chore(deps): bump versions of third-party libraries in assets

* katex 0.16.8 -> 0.16.10
* mermaid -> 10.9.0

* ci: use actions/configure-pages and bump hugo version

* docs: update zh-cn translation (imfing#365)

* docs: fix deploy-site zh-cn lang filename

* docs: update zh-cn sidebar titles

* docs: fix deploy site title

* docs: fix deploy-site zh-cn lang filename (imfing#371)

* chore: add i18n links in README (imfing#374)

* docs: add i18n README links

* Update README.md

* Update README.fa.md

* Update README.zh-cn.md

---------

Co-authored-by: Xin <xin@imfing.com>

* docs: add showcase - HITSZ OpenAuto (imfing#373)

* docs: add showcase - HITSZ OpenAuto

* alter showcase image

* Update index.md

* Update index.zh-cn.md

---------

Co-authored-by: Xin <xin@imfing.com>

* i18n: add Dutch translation (imfing#383)

Added Dutch translation.

* docs(fix): correct a mistake in markdown guide (imfing#394)

Fix code mistake by making sure backticks are inserted at start and end of example text

* feat: add hextra hero-container shortcode (imfing#389)

* Implement hextra hero-container

* Fix width

* Fix width

* Fix width

* Set number of columns

* Fix display for mobile devices

* Trim image prefix

* Implement image card

* Fix width

* Fix css

* chore(showcase): add AXIVO docs (imfing#400)

* chore: update AXIVO docs image format (imfing#402)

* fix: use `hugo.IsMultilingual` to replace deprecated `.Site.IsMultiLingual` (imfing#404)

* i18n: add Ukrainian translation (imfing#403)

* i18n: add Hebrew translation (imfing#405)

* feat: add support for `breadcrumbs` param in front matter for showing/hiding breadcrumbs on specific pages (imfing#367)

* feat: add support for `hideBreadcrumbs` front-matter param

* docs(en): add some docs about breadcrumb nav, including new hideBreadcrumbs param

* fix: fix typo in hideBreadcrumbs param check in breadcrumbs.html partial

* docs(en): tidy up the Breadcrumb Navigation documentation

* fix: rework hideBreadcrumbs param to breadcrumbs; update docs accordingly

* fix: use relpermalink in breadcrumb

---------

Co-authored-by: Xin <xin@imfing.com>

* feat: add customize flexsearch tokenize feature instruction to docs (imfing#322)

* feat: add customize flexsearch tokenize feature instruction to docs

* Update configuration.md

* Update configuration.md

* Update configuration.zh-cn.md

---------

Co-authored-by: loenvom <loenvom@qq.com>
Co-authored-by: Xin <xin@imfing.com>

* docs: list code block copy button config (imfing#412)

* fix: list code block copy button config

* Mention copy button config in the guide

* fix: properly handle tabs overflow (imfing#422)

* fix: properly handle tabs overflow

* chore: rebuild css

* docs: fix typo in chinese doc (imfing#430)

* docs: add missing Markdown syntax examples (imfing#415)

* chore: bump npm package versions

* chore: bump hugo versions

* feat: add tag support for card shortcode (imfing#427)

* styles: accept tags on cards with default and custom colors

* styles: compile css

* chore: improve tags styling on card (imfing#431)

* chore: improve tags styling on card

* chore: npm run build:css

* fix: add integrity sha384 to js script on example site

---------

Co-authored-by: Xin <xin@imfing.com>
Co-authored-by: Xin <fuxin1997@gmail.com>
Co-authored-by: Kowyo <kowyo@outlook.com>
Co-authored-by: Robb Shecter <robb@public.law>
Co-authored-by: 纳兰音韵 <91950505+naranyinyun@users.noreply.github.com>
Co-authored-by: Kowyo <110339237+kowyo@users.noreply.github.com>
Co-authored-by: longlin li <gnulonglin@gmail.com>
Co-authored-by: Maxwell Jay <MaxwellJay@jaylab256.onmicrosoft.com>
Co-authored-by: Sebastian Broekhoven <2205121+sbroekhoven@users.noreply.github.com>
Co-authored-by: Lucas <100660343+lulunac27a@users.noreply.github.com>
Co-authored-by: Floren Munteanu <fmunteanu@users.noreply.github.com>
Co-authored-by: Andreas Deininger <andreas@deininger.net>
Co-authored-by: Serhii Pryimachuk <serg@pryimach.uk>
Co-authored-by: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com>
Co-authored-by: George Gecewicz <875201+ggwicz@users.noreply.github.com>
Co-authored-by: loenvom <59039948+loenvom@users.noreply.github.com>
Co-authored-by: loenvom <loenvom@qq.com>
Co-authored-by: yuri <1969yuri1969@gmail.com>
Co-authored-by: jinzhongjia <mail@nvimer.org>
Co-authored-by: Julia March <101819212+juliamrch@users.noreply.github.com>
Co-authored-by: Jason Thrsher <jthrasher@zagtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants