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: use frontmatter title and description, automatic lists #408

Merged
merged 3 commits into from
May 8, 2023

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented May 8, 2023

Required before #385.

For this I had to make a small change in spec-generator, which I released: ipfs/spec-generator#13.

It uses title and description in frontmatter for rendering. Also description included in meta tags.

Automatic listings thanks to the tags feature of Eleventy. Ordering within each tag is based on the date field. Couldn't find much information on how to sort by a different field, such as title. For that, we probably have to write our own code, and potentially hard code more things.

Also updated the template because it seems we did forget before.

@hacdias hacdias requested a review from lidel as a code owner May 8, 2023 11:55
@hacdias hacdias self-assigned this May 8, 2023
@hacdias hacdias mentioned this pull request May 8, 2023
8 tasks
@hacdias hacdias force-pushed the automatic-listing branch from bda8bcb to ec98e3d Compare May 8, 2023 12:00
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

I think automatic lists make sense for things like IPIPs, but for other specs we have we need a mechanism for adjusting the ordering.

Some specs are more meaningful than others. Some build on top of others, and there is certain order that makes sense.

For example, we want:

  • IPNS Record specs before we introduuce random routers like PubSub.
  • Path Gateway and Trustless Gateway before web ones, additions like _redirects at the very end.

Just to illustrate:

before (meaningful order) now (not the best)
2023-05-08_14-27 2023-05-08_14-27_1

@hacdias thoughts on potential fixes? my initial suggestion would be to do (B) below:

  • (A) use automated list for IPIPs only, other things remain manual (but we leverage title and description from front matter)
  • (B) add hierarchy value to the front matter, and then create filter to sortByHierarchy similar to this that adjust order based on the number if hierarchy field is present
    • (0 is the highest, 999 is the lowest, 999 is the implicit default if hierarchy is not present in frontmatter)
    • this will allow us to distinguish between top level specs like IPNS Record and Path Gateway, and always put the at the top

@hacdias
Copy link
Member Author

hacdias commented May 8, 2023

B seems the best solution.

@lidel
Copy link
Member

lidel commented May 8, 2023

@hacdias maybe call it order ? the nice side-effect will be we could put IPIP number there too, and we get deterministic ordering from latest to oldest ( | sortByOrder | reversed) :)

@hacdias
Copy link
Member Author

hacdias commented May 8, 2023

@lidel I added order. I just want to say that I do not like Liquid templating 😅 Spent way too much time trying for post in posts | sortByOrder and that simply did not call the filter. Had to create a variable before to make it work.

@hacdias hacdias requested a review from lidel May 8, 2023 13:39
disabling as spec-generator uses more advanced logic for fragments and
validation happens there.
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thanks!

@lidel lidel merged commit 7924dd6 into main May 8, 2023
@lidel lidel deleted the automatic-listing branch May 8, 2023 15:37
@lidel
Copy link
Member

lidel commented May 9, 2023

@hacdias mind updating first paragraph of https://specs.ipfs.tech/meta/spec-for-specs/#title-sections to say the title should be in front matter?

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

Successfully merging this pull request may close these issues.

2 participants