11ty / 11ty/docs

Suggestion for pagination/"before" documentation: clarify that only js front matter is supported

Open Beginner friendly
#1,334 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nunjucks
Stars
547
Forks
726
Avg merge
2h 23m
Merged PRs (30d)
3

Description

In the documentation for the "before" callback for pagination, it might be worth making explicit that this will only work for "js" front matter:

https://github.com/11ty/11ty-website/blob/c3fd39ccf04083f7ecf8a183aa201af84b8da52b/src/docs/pagination.md?plain=1#L452-L473

It may not be obvious to a reader that the "before" value of the front-matter here is a literal javascript function (rather than, say, a string that gets evaluated as javascript), and that therefore no other front-matter format besides "js" will work. (At least, I assume such is the case, from experimenting a little.)

It's true that a reader can perhaps infer this from the fact that the other examples on the page don't use js and this one does, or work it out with some trial and error: but people often read documentation in a hurry, so I think it's worth making this explicit.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open src/docs/pagination.md at the linked lines and read the documentation for the “before” pagination callback alongside its front matter examples. Clarify that the value is a literal JavaScript function supported only with js front matter, then verify the wording remains consistent with the surrounding examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.