Skip to content

Conversation

@kvncrw
Copy link

@kvncrw kvncrw commented Mar 5, 2018

this introduced the ability to add hidden: true to the frontmatter.

@parsiya parsiya force-pushed the master branch 3 times, most recently from 0e1fb9f to ab87a61 Compare March 11, 2018 06:53
@parsiya
Copy link
Owner

parsiya commented Mar 11, 2018

Pretty cool feature. Thanks for the pull request. For some reason the condition also hides pages with "hidden" set to "false."

Removing the condition from range and putting it inside and if inside the range works. Seems like the range condition needs to also check if the value is "nil" (which means it's not in the front matter).

{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $paginator.Pages }}
    {{ if (ne .Params.hidden true) }}
        <article>
           ...
        </article>
    {{ end }}
{{ end }}

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