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

Params to turn off next/previous page - and breadcrumb #137

Closed
wants to merge 0 commits into from

Conversation

willwade
Copy link
Contributor

I think this is all good!

re: #136

@willwade
Copy link
Contributor Author

tweaked to allow

disableBreadcrumb: true
disableNextPrev: true

In page params or site params

@willwade willwade changed the title Very quick attempt to turn off next/previous page - and breadcrumb Params to turn off next/previous page - and breadcrumb Mar 19, 2018
{{with ($.Scratch.Get "nextPage")}}
<a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
{{end}}
{{$showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev))}}
Copy link
Owner

Choose a reason for hiding this comment

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

I think this is equivalent to (or .Params.disableNextPrev .Site.Params.disableNextPrev). But I'm not sure this should be the condition to use.

Actually, I think page params should always override behaviour of site params when set. For example, we have a site and we choose to disable all nextprev for the site in the config.toml, but we want to enable it on a single page tough. It's not possible with this implementation.

<span class="links">
{{ template "breadcrumb" dict "page" . "value" .Title }}
{{$showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb))}}
Copy link
Owner

Choose a reason for hiding this comment

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

same thing

@matcornic
Copy link
Owner

matcornic commented Aug 10, 2018

Thanks for this PR.

Sorry, I'm super late.

See my comments :)

@matcornic
Copy link
Owner

And btw, could you update the documentation (English part, I will do the french one ^^) with your changes ?

Thanks again :)

Copy link
Contributor Author

@willwade willwade left a comment

Choose a reason for hiding this comment

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

Just need a moment to get my head around these.. Will try and get back to you asap!

@matalo33
Copy link
Contributor

Can we merge this in as a sitewide setting and add per-page override to the backlog? I've tried implementing this but can't solve without having a disableNextPrev and a enableNextPrev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants