kjaymiller / kjaymiller/render_engine_theme_kjaymiller

Look for template file instead of forcing a setting path

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Jinja2 template can be searched for using the [include with ignore missing](https://jinja.palletsprojects.com/en/3.0.x/templates/#include):

```jinja
{% include ['special_sidebar.html', 'sidebar.html'] ignore missing %}
```

Currently in `_footer.html` we look for a theme `footer_column2` setting.

We would handle this a clearer way by looking for a template file called `footer_column2.html`.

```jinja
{% include ['footer_column2.html'] ignore missing %}
```

Since the users templates would be searched as well, the existence would be checked and if not found we could even provide our own.

This works well so that if the user wants to provide their own `_footer.html` it would overwrite and then they wouldn't need the setting anyway.

We can also use this to provide modular defaults for the user to override.

When looking for content we can still use `template_vars` to check for attributes.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting _footer.html and trace how the footer_column2 theme setting is currently used. Check the template lookup behavior for user-provided templates, then update the footer handling to look for footer_column2.html with ignore missing while retaining template_vars for content attributes. Done means user templates can override or supply the column without requiring the setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.