Skip to content

🐛 BUG: head contents placed in body when page has conditional head #2046

@IanVS

Description

@IanVS

What version of astro are you using?

0.21.4

What package manager are you using?

npm

What operating system are you using?

mac

Describe the Bug

I found that my utf-8 encoding was not being applied correctly, and I traced it down to my head contents being placed inside the body instead of in the head. It occurs due to my page looking like this:

{redirect 
  ? <head><meta http-equiv="refresh" content={`0; url=${redirect}`}></head>
  : <Layout>
      It’s a trap!
    </Layout>
}

If I change the redirect to a normal layout or something, it works. So I suppose I just need to make another component to do the redirect. But I wanted to at least let y'all know this is happening.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-v7dk72?file=src/pages/index.astro

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions