Skip to content

Commit

Permalink
Small update to the docs for get_url (#2033)
Browse files Browse the repository at this point in the history
Small update to the doc linked to the discussion on #2026.
  • Loading branch information
magikstm authored and Keats committed Feb 16, 2023
1 parent d0b8065 commit ebdeda1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/content/documentation/templates/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,21 @@ It accepts an optional parameter `lang` in order to compute a *language-aware UR
{% set url = get_url(path="@/blog/_index.md", lang="en") %}
```

This can also be used to get the permalinks for static assets, for example if
we want to link to the file that is located at `static/css/app.css`:
This can also be used to get the permalink for a static file, for example if
you want to link to the file that is located at `static/css/app.css`:

```jinja2
{{/* get_url(path="css/app.css") */}}
```

By default, assets will not have a trailing slash. You can force one by passing `trailing_slash=true` to the `get_url` function.
By default, the link will not have a trailing slash. You can force one by passing `trailing_slash=true` to the `get_url` function.
An example is:

```jinja2
{{/* get_url(path="css/app.css", trailing_slash=true) */}}
```

In the case of non-internal links, you can also add a cachebust of the format `?h=<sha256>` at the end of a URL
In the case of a non-internal link, you can also add a cachebust of the format `?h=<sha256>` at the end of a URL
by passing `cachebust=true` to the `get_url` function. In this case, the path will need to resolve to an actual file.
See [File Searching Logic](@/documentation/templates/overview.md#file-searching-logic) for details.

Expand Down

0 comments on commit ebdeda1

Please sign in to comment.