Skip to content

Commit 01791cd

Browse files
committed
fix(build): escape Jinja and Actions expressions from Liquid
The Pages build failed on a Jinja url_for sample that Liquid tried to parse, and the GitHub Actions snippets rendered blank because Liquid resolves an unknown expression inside a dollar-brace block to an empty string rather than erroring, silently corrupting the displayed YAML. Every Jinja sample and every fenced block carrying Actions expressions is now wrapped in raw tags, and a sweep over the whole site confirms no unescaped braces remain outside raw blocks.
1 parent 4627bd2 commit 01791cd

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

architecture/http_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dataset_bp = BaseBlueprint("dataset", __name__, template_folder="templates")
6767
`BaseBlueprint` resolves the feature's package directory and, if the feature has an `assets/` folder, automatically adds a route that serves files from it. That is what makes this work in a template:
6868

6969
```
70-
<script src="{{ url_for('dataset.assets', subfolder='js', filename='scripts.js') }}"></script>
70+
{% raw %}<script src="{{ url_for('dataset.assets', subfolder='js', filename='scripts.js') }}"></script>{% endraw %}
7171
```
7272

7373
Only the `js`, `css` and `dist` subfolders are served.

architecture/splent_framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ dataset_bp = BaseBlueprint("dataset", __name__, template_folder="templates")
149149
`BaseBlueprint` is a Flask `Blueprint` that resolves the feature's package directory from its import name. If the feature has an `assets/` folder, it registers an asset route for it automatically, which is what makes this work from a template:
150150

151151
```
152-
<script src="{{ url_for('dataset.assets', subfolder='js', filename='scripts.js') }}"></script>
152+
{% raw %}<script src="{{ url_for('dataset.assets', subfolder='js', filename='scripts.js') }}"></script>{% endraw %}
153153
```
154154

155155
If you pass no `template_folder`, it falls back to the feature's own `templates/` directory.

ci_cd/continuous_deployment/dockerhub_workflow.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,21 @@ The build needs the working copy, because the image is built from the repository
7070
7171
### 2. Log in to Docker Hub
7272
73+
{% raw %}
7374
```yaml
7475
- name: Log in to Docker Hub
7576
uses: docker/login-action@v3.6.0
7677
with:
7778
username: ${{ secrets.DOCKER_USER }}
7879
password: ${{ secrets.DOCKER_PASSWORD }}
7980
```
81+
{% endraw %}
8082
8183
Both credentials come from repository secrets. Use a Docker Hub access token as `DOCKER_PASSWORD` rather than your account password, so you can revoke it without changing your account.
8284

8385
### 3. Build and push
8486

87+
{% raw %}
8588
```yaml
8689
- name: Build and push Docker image
8790
run: |
@@ -94,6 +97,7 @@ Both credentials come from repository secrets. Use a Docker Hub access token as
9497
docker tag $IMAGE:$TAG $IMAGE:latest
9598
docker push $IMAGE:latest
9699
```
100+
{% endraw %}
97101

98102
Three things are worth noticing here.
99103

ci_cd/continuous_deployment/webhook_workflow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ If either condition fails, the job is skipped. A skipped job is not a failed job
7272

7373
## Step
7474

75+
{% raw %}
7576
```yaml
7677
- name: Trigger Deployment Webhook
7778
env:
@@ -82,6 +83,7 @@ If either condition fails, the job is skipped. A skipped job is not a failed job
8283
https://${{ secrets.WEBHOOK_DOMAIN }}/webhook/deploy \
8384
-H "Authorization: Bearer ${{ secrets.WEBHOOK_TOKEN }}"
8485
```
86+
{% endraw %}
8587

8688
GitHub does not have access to the server. It only sends a signed request and the server does the work.
8789

ci_cd/continuous_integration/testing_workflow.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The runner image is pinned to an explicit Ubuntu version rather than `ubuntu-lat
6868

6969
## Environment variables
7070

71-
The job declares the database configuration once at job level, and the service container reuses it through `${{ env.* }}`:
71+
The job declares the database configuration once at job level, and the service container reuses it through `{% raw %}${{ env.* }}{% endraw %}`:
7272

7373
| Variable | Value |
7474
|:---|:---|
@@ -87,6 +87,7 @@ The job declares the database configuration once at job level, and the service c
8787

8888
A MariaDB container is started alongside the job:
8989

90+
{% raw %}
9091
```yaml
9192
services:
9293
mariadb:
@@ -104,6 +105,7 @@ services:
104105
--health-timeout=5s
105106
--health-retries=3
106107
```
108+
{% endraw %}
107109
108110
The health check uses `mariadb-admin`, which is the MariaDB client binary. The job does not start running steps until the health check passes, so the database is ready before the first test connects.
109111

0 commit comments

Comments
 (0)