Skip to content

Add legacy httk template handling#6

Merged
rartino merged 1 commit intomainfrom
develop
Mar 26, 2026
Merged

Add legacy httk template handling#6
rartino merged 1 commit intomainfrom
develop

Conversation

@rartino
Copy link
Copy Markdown
Member

@rartino rartino commented Mar 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 26, 2026 23:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in “compatibility mode” to support legacy httkweb template naming by preferring .httkweb.html templates when both legacy and modern template variants exist.

Changes:

  • Introduce compatibility_mode in SiteConfig and plumb it through create_asgi_app(), serve(), and publish().
  • Add HttkCompatTemplateEngine that reorders template suffix probing to prefer legacy .httkweb.html.
  • Add tests ensuring compatibility mode prefers legacy templates for both ASGI serving and static publishing.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_api.py Adds regression tests validating legacy template selection in compatibility mode.
src/httk/web/templating/jinja2_engine.py Makes template suffix probing configurable per engine instance.
src/httk/web/templating/httk_compat.py Adds a legacy-oriented template engine that prioritizes .httkweb.html.
src/httk/web/templating/base.py Introduces a TemplateEngine Protocol for typing the engine interface.
src/httk/web/templating/init.py Exports the new protocol and compatibility engine.
src/httk/web/model/config.py Adds compatibility_mode to SiteConfig and from_srcdir().
src/httk/web/engine/site_engine.py Selects template engine implementation based on compatibility_mode.
src/httk/web/api.py Exposes compatibility_mode at the public API layer for app creation and publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rartino rartino merged commit 046fd35 into main Mar 26, 2026
5 checks passed
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.

2 participants