0

I'm generating static page templates using Vue/Nuxt and I can't figure out if there's any way to add a really specific tag into the of each page that is generated. It isn't a meta, script, style or link - and it seems the only default ways in nuxt.config.js are for scripts, links or meta tags. These are the tags that need to be injected in:

<v65:metaTags></v65:metaTags>
<v65:customFile file="/v65html/_headassets.htm"></v65:customFile>

Those tags are generated from the CMS system and unfortunately need to be on every page. Thanks.

user1710395
  • 47
  • 1
  • 7
  • Does this answer your question? [How to add a 3rd party script code into Nuxt?](https://stackoverflow.com/questions/67534304/how-to-add-a-3rd-party-script-code-into-nuxt) – kissu Sep 28 '21 at 18:52
  • What is this kind of tag tho? – kissu Sep 28 '21 at 18:52

1 Answers1

2

In nuxt you can overwrite the default .nuxt/views/app.template.html.

You need to create app.html file in the root of the project. Then put the below code inside this file:

app.html

<!DOCTYPE html>
<html lang="en" {{ HTML_ATTRS }}>
  <head {{ HEAD_ATTRS }}>
    {{ HEAD }}
  </head>
  <body {{ BODY_ATTRS }}>
    {{ APP }}
  </body>
</html>

Then you can put any tag you want in head tag.

<!DOCTYPE html>
<html lang="en" {{ HTML_ATTRS }}>
  <head {{ HEAD_ATTRS }}>
    {{ HEAD }}
    <v65:metaTags></v65:metaTags>
    <v65:customFile file="/v65html/_headassets.htm"></v65:customFile>
  </head>
  <body {{ BODY_ATTRS }}>
    {{ APP }}
  </body>
</html>
Nima Ebrazeh
  • 1,286
  • 3
  • 8