# How add {{ .Title }} in javascript

**URL:** <https://discourse.gohugo.io/t/how-add-title-in-javascript/34902>\
**Category:** support\
**Created:** [September 27, 2021, 9:39pm UTC](https://discourse.gohugo.io/t/how-add-title-in-javascript/34902 "2021-09-27T21:39:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueBlueSky](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@BlueBlueSky](https://discourse.gohugo.io/u/BlueBlueSky)\
**Post date:** [September 27, 2021, 9:39pm UTC](https://discourse.gohugo.io/t/how-add-title-in-javascript/34902/1 "2021-09-27T21:39:47Z")

</div>

How I can add {{ .Title }} to the script?  
For example:

```auto
<script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "blablabla {{ .question1}} {{ .Title }}?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "blabla {{ .answer1 }} "
        }
      },
      {
        "@type": "Question",
        "name": "blablabla {{ .question2}} {{ .Title }} ?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "blabla {{ .answer2 }}"
        }
      }
    ]
  }
  </script>

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [September 28, 2021, 1:23am UTC](https://discourse.gohugo.io/t/how-add-title-in-javascript/34902/2 "2021-09-28T01:23:42Z")

</div>

We need more information. Please share a link to the public repository for your project.

---

<div class="post-metadata">

**Author:** ![Mehedi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mehedi/32/12392_2.png) [@Mehedi](https://discourse.gohugo.io/u/Mehedi)\
**Post date:** [September 28, 2021, 5:08am UTC](https://discourse.gohugo.io/t/how-add-title-in-javascript/34902/3 "2021-09-28T05:08:46Z")

</div>

You can use this same code, but you need to put that code on this page which page has access to this `{{ .question1}} {{ .Title }}` .

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [April 29, 2022, 11:08am UTC](https://discourse.gohugo.io/t/how-add-title-in-javascript/34902/4 "2022-04-29T11:08:39Z")

</div>

Closed on April 29, 2022, 11:08am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
