{"id":13696129,"url":"https://github.com/pelican-plugins/more-categories","last_synced_at":"2025-06-20T06:34:04.577Z","repository":{"id":52542707,"uuid":"216350114","full_name":"pelican-plugins/more-categories","owner":"pelican-plugins","description":"Enables nested categories and multiple categories per article","archived":false,"fork":false,"pushed_at":"2024-07-07T16:50:18.000Z","size":51,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-16T06:49:25.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pelican-plugins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"justinmayer","liberapay":"pelican"}},"created_at":"2019-10-20T11:21:45.000Z","updated_at":"2025-02-07T03:33:45.000Z","dependencies_parsed_at":"2024-04-13T00:40:52.180Z","dependency_job_id":"0181e44b-4d1c-4b3e-9fc9-a3c7400ff22b","html_url":"https://github.com/pelican-plugins/more-categories","commit_stats":{"total_commits":32,"total_committers":5,"mean_commits":6.4,"dds":0.53125,"last_synced_commit":"29e68fcf97caa5838f2c8bc27c9771c151bdb959"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pelican-plugins/more-categories","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Fmore-categories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Fmore-categories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Fmore-categories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Fmore-categories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pelican-plugins","download_url":"https://codeload.github.com/pelican-plugins/more-categories/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelican-plugins%2Fmore-categories/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260896049,"owners_count":23078935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:00:36.519Z","updated_at":"2025-06-20T06:33:59.563Z","avatar_url":"https://github.com/pelican-plugins.png","language":"Python","funding_links":["https://github.com/sponsors/justinmayer","https://liberapay.com/pelican"],"categories":["Plugins"],"sub_categories":["Migrated to new architecture"],"readme":"# More Categories: A Plugin for Pelican\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/more-categories/main.yml?branch=main)](https://github.com/pelican-plugins/more-categories/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pelican-more-categories)](https://pypi.org/project/pelican-more-categories/)\n![License](https://img.shields.io/pypi/l/pelican-more-categories?color=blue)\n\nThis Pelican plugin adds support for multiple categories per article and nested\ncategories. It requires Pelican 4.2.0 or newer.\n\nThe `example` directory contains a minimal Pelican web site that can be used for testing.\n\n## Installation\n\nThis plugin can be installed via:\n\n    python -m pip install pelican-more-categories\n\nAs long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `more_categories` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.\n\n## Multiple Categories\n\nTo indicate that an article belongs to multiple categories, use a\ncomma-separated string:\n\n    Category: foo, bar, bazz\n\nThis will add the article to the categories `foo`, `bar`, and `bazz`.\n\n### Templates\n\nExisting themes that use `article.category` will display only the first of\nthese categories, `foo`. This plugin adds `article.categories` that you can\nloop over instead. To accommodate this plugin in a theme whether it is present\nor not, use:\n\n```jinja2\n{% for cat in article.categories or [article.category] %}\n    \u003ca href=\"{{ SITEURL }}/{{ cat.url }}\"\u003e{{ cat }}\u003c/a\u003e{{ ', ' if not loop.last }}\n{% endfor %}\n```\n\n## Nested Categories\n\n(This is a re-implementation of the `subcategory` plugin.)\n\nTo indicate that a category is a child of another category, use a\nslash-separated string:\n\n    Category: foo/bar/bazz\n\nThis will add the article to the categories `foo/bar/bazz`, `foo/bar` and\n`foo`.\n\n### Templates\n\nExisting themes that use `article.category` will display the full path to the\nmost specific of these categories, `foo/bar/bazz`. For any category `cat`, this\nplugin adds `cat.shortname`, which in this case is `bazz`, `cat.parent`, which\nin this case is the category `foo/bar`, and `cat.ancestors`, which is a list of\nthe category’s ancestors, ending with the category itself. For instance, to\nalso include a link to each of the ancestor categories on an article page, in\ncase this plugin in present, use:\n\n```jinja2\n{% for cat in article.category.ancestors or [article.category] %}\n    \u003ca href=\"{{ SITEURL }}/{{ cat.url }}\"\u003e{{ cat.shortname or cat }}\u003c/a\u003e{{ '/' if not loop.last }}\n{% endfor %}\n```\n\nLikewise, `category.shortname`, `category.parent`, and `category.ancestors` can\nalso be used on the category template.\n\nAdditionally, this plugin adds `category.children`: a `list` of categories\nthat have `category` as a parent.\n\n```jinja2\n{% for child in category.children %}\n    \u003ca href=\"{{ SITEURL }}/{{child.url}}\"\u003e{{child.shortname|capitalize}}\u003c/a\u003e\n{% endfor %}\n```\n\nIf you need all descendent children and not just the immediate children, you can use the `list` of descendent children: `category.descendents`\n\n### Slug\n\nThe slug of a category is generated recursively by slugifying the short name of\nthe category and its ancestors (preserving slashes):\n\n    slug-of-(foo/bar/baz) := slug-of-foo/slug-of-bar/slug-of-baz\n\n### Category Folders\n\nTo specify categories using the directory structure, you can configure\n`PATH_METADATA` to extract the article path into the `category` metadata. The\nfollowing settings would use the entire structure:\n\n```python\n    PATH_METADATA = \"(?P\u003ccategory\u003e.*)/.*\"\n```\n\nIf you store all articles in a single `articles/` folder that you want to\nignore for this purpose, use:\n\n```python\n    PATH_METADATA = \"articles/(?P\u003ccategory\u003e.*)/.*\"\n```\n\n### Categories in Templates\n\nThe list `categories` of all pairs of categories with their corresponding\narticles, which is available in the context and can be used in templates (e.g.\nto make a menu of available categories), is ordered lexicographically, so\ncategories always follow their parent:\n\n    aba\n    aba/dat\n    abaala\n\n## Contributing\n\nContributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[existing issues]: https://github.com/pelican-plugins/more-categories/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n\n## License\n\nThis project is licensed under the AGPL-3.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelican-plugins%2Fmore-categories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpelican-plugins%2Fmore-categories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelican-plugins%2Fmore-categories/lists"}