ampproject / ampproject/amp.dev

Skip jinja2 macros to build filter SSR expressions

Open
#3,657 5 comments 0 reactions 0 assignees View on GitHub
Category: Functionality P2: Medium Type: Update
Dominant language
HTML
Stars
600
Forks
675
PR merge metrics
No merged PRs in 30d

Description

Our custom Markdown tag `[filter]` currently relies on one unnecessary transpiling step. The flow is as follows:

We have `[filter *]` in our Markdown which get's rewritten to jinja2 calls like `{% call filter * %}` which then get evaluated to SSR statements like `[% if format.includes(... %]`.

Instead of relying on the template engine to build the SSR statements [our Markdown extension](https://github.com/ampproject/amp.dev/blob/future/pages/extensions/amp_dev/markdown_extras/block_filter.py) should directly emit them.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.