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

Filter pages based on catalog parent-id and tags #80

Closed
wants to merge 1 commit into from
Closed

Filter pages based on catalog parent-id and tags #80

wants to merge 1 commit into from

Conversation

JavierCladellas
Copy link
Contributor

Added a filter to helpers/get-page-cards.js that:

  • Checks if the catalog tag is present in a page.
  • Gets the identifiers of the parents pages by looking at the parent-catalogs attribute.
  • Gets the actual identifier of the parent page, located as tags in the actual parent page attributes
  • If the parent page contains any of the tags present in the parent-catalogs, it will be nested inside that module.

[ Example usage]
The work still uses the toolboxes page layout, but searches for the catalog tag to not interfere with existing work.

The base of the catalog system should have the following attributes, assuming I want to set the id of the page to base-id:

:page-layout: toolboxes
:page-tags: catalog, base-id

Then for any direct child of the base-id page :

:page-layout: toolboxes
:page-tags: catalog, toolbox, my-page-1-id
:parent-catalogs: base-id

If I want to create a card that appears both on the base-id and the my-page-1-id pages I can do:

:page-layout: default
:page-tags: catalog, toolbox, my-leaf-page
:parent-catalogs: base-id, my-page-1-id

= My Leaf page content... 

[NOTES]

  • the page layout of all catalog pages that have children should be toolboxes
  • All pages inside the catalog must have the catalog tag and the toolbox tag (for cards to appear)
  • A page can have multiple parents.
  • The page-layout of the leaf pages is not important

Copy link

netlify bot commented Sep 21, 2024

Deploy Preview for antora-ui-peppy-froyo-6a3edb failed.

Name Link
🔨 Latest commit 6c15619
🔍 Latest deploy log https://app.netlify.com/sites/antora-ui-peppy-froyo-6a3edb/deploys/66eea0971ef012000834c4f5

@JavierCladellas
Copy link
Contributor Author

Done in #81 without fork.

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.

Allow arbitrary nesting of modules
1 participant