Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using nginx SSI-directives in <head> of page #8478

Closed
akaSybe opened this issue Aug 22, 2019 · 5 comments
Closed

Using nginx SSI-directives in <head> of page #8478

akaSybe opened this issue Aug 22, 2019 · 5 comments

Comments

@akaSybe
Copy link

akaSybe commented Aug 22, 2019

Hi! We are widely using nginx SSI-directives to include some common content of page head, for example some meta tags and scripts.

Typical SSI-directive looks like this in page markup:

<!--# include virtual="/ssi/directive.html"-->

I'm trying to find a possibility to include it in page head but seems like it's impossible right now.

I was able to include SSI-directive in page body using additional div
<div dangerouslySetInnerHTML={{ __html: "<!--# include virtual=\"/ssi/directive.html\"-->" }} />
but I can't use it in page head this way

@Timer
Copy link
Member

Timer commented Aug 23, 2019

You should create a Custom <Document> component which will let you add these fixed values directly to the <Head> component as children.

@Timer Timer closed this as completed Aug 23, 2019
@akaSybe
Copy link
Author

akaSybe commented Aug 23, 2019

I've created custom document, but it's impossible to insert SSI directive using React JSX syntax

@Timer
Copy link
Member

Timer commented Aug 23, 2019

What about doing it for <Head> itself?

<Head dangerouslySetInnerHTML={{ __html: `<!--# include virtual="/ssi/directive.html"-->` }}>

@akaSybe
Copy link
Author

akaSybe commented Apr 1, 2020

Related issue #3904, need to try described in that comment: #3904 (comment)

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants