Insert week number in link markdown

I have a markdown card with a link. I would like to insert the current week number inside the link. Is that possible? Something like this:

type: markdown
content: >-
  <ha-icon icon="mdi:open-in-new"></ha-icon>  [open](https://www.xxx/{{now().strftime('%W')}} .pdf)

Why don’t you just try it?

It should work because the Markdown Card supports Jinja2 templates.

However, remove the space after }} because it will break the URL.

strftime('%W')}} .pdf)
                ^
                |

Ah that was why it didnt work! Thanks! Though it results in week 18 when it should be 19.

Try strftime(“%V”)

You can use this to get the ISO week number.

{{ now().isocalendar().week }}
1 Like