Skip to content

Lack of documentation around adding meta tags info in template.html #1561

Open
@lego-sharat

Description

@lego-sharat

My requirement was to add meta tags, so that when sharing links on twitter/fb/whatsapp a link preview should appear. I needed to add meta tags for this purpose. There is not a lot of documentation around that. Two things which are mentioned are preact-cli uses ejs and template.html has preact.title for dynamically showing title. Other than that, I couldn't find anything. I was able to figure out a solution by looking at the source code of the preact documentation site, where something like this is being used <%= htmlWebpackPlugin.options.CLI_DATA.preRenderData.description %>.
So my questions are :

  • Is this the recommended way to add meta tags in a prect-cli project?
  • If no then what is the recommended way?
  • If yes then, is there any other data is useful which is being exposed like this and where should I look for that(this is for my own learning)

Also, I am willing to add the necessary documentation for this if but advance warning I don't have a lot of knowledge on html-webpack-plugin.

PS:
Apologies if I have missed some obvious place which has the documentation
And thanks for making this really useful framework

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions