Skip to content

Cannot use frontmatter variables (or any variables at all) in raw HTML #4205

Answered by brc-dd
lifehackerhansol asked this question in Q&A
Discussion options

You must be logged in to vote

It's vue. https://vuejs.org/guide/essentials/template-syntax.html#attribute-bindings

<meta http-equiv="refresh" :content="`0; URL=$frontmatter.redirect_to`">

but even then meta tags should be part of <head> to work. You can do something like:

---
head:
  - - meta
    - http-equiv: refresh
      content: '0; URL= https://github.com'
---

https://vitepress.dev/reference/frontmatter-config#head

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lifehackerhansol
Comment options

Answer selected by lifehackerhansol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants