Using / in the paths of my PATTERN_LIBRARY.SECTIONS results in a PatternLibraryEmpty exception
Steps to Reproduce
My library settings are like so:
PATTERN_LIBRARY = {
# Groups of templates for the pattern library navigation. The keys
# are the group titles and the values are lists of template name prefixes that will
# be searched to populate the groups.
"SECTIONS": (
(
"Components",
[
"patterns/components",
],
),
("Forms", ["patterns/forms"]),
),
# Configure which files to detect as templates.
"TEMPLATE_SUFFIX": ".html",
# Set which template components should be rendered inside of,
# so they may use page-level component dependencies like CSS.
"PATTERN_BASE_TEMPLATE_NAME": r"patterns\base.html",
}
However, when I try to view a pattern, I get the following error: No templates found matching: '(('Components', ['patterns/components']), ('Forms', ['patterns/forms']))'.
To rectify, I have to change my sections to backslashes:
Issue Summary
Using
/
in the paths of myPATTERN_LIBRARY.SECTIONS
results in aPatternLibraryEmpty
exceptionSteps to Reproduce
My library settings are like so:
However, when I try to view a pattern, I get the following error:
No templates found matching: '(('Components', ['patterns/components']), ('Forms', ['patterns/forms']))'
.To rectify, I have to change my sections to backslashes:
This is on Windows 11, with Django 4.2 & django-pattern-library v1.2.0.
Technical details
Something like this would resolve:
python --version
.pip show django | grep Version
.