Inserting tag in articles

Hello,

I am trying to build my website using Hugo. How can I insert tag in my articles, what code should I put in my html files so that the tags appear when reading my articles?

Thank you.

I’m not sure if I understand correctly. but tags and categories are simply Taxonomies that are created by default by hugo.

Adding tags there for should be in the page Front Matter as shown in this example

Here is an example summary.html which hopefully you can pick apart to your requirements. I think I copied this across from another theme when I first started building my site, and can confirm it works (even though I am not actually using this code at the moment). As such I haven’t looked too closely as to whether this is the best way to achieve things.

{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }}

<div class="blog-post">
  <h3>
    <a href="{{ .Permalink }}">{{ .Title | markdownify | safeHTML }}</a>
  </h3>
  <div class="callout small">
    <small>
      <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
        {{ .Date.Format $dateFormat }}
      </time> by {{ .Params.author | default .Site.Params.author }}.
      {{ if (.Params.categories) }}Categories: {{ partial "meta-categories.html" . }}.{{ end }}
      {{ if (.Params.tags) }}Tags: {{ partial "meta-tags.html" . }}.{{ end }}
    </small>
  </div>
  <p>
    {{ .Params.description }}
  </p>
  <hr>
</div>

meta-categories.html:

{{ if .Params.categories }}
  {{ range $index, $category := .Params.categories }}
    {{ if gt $index 0 }}/
    {{ end }}
      <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">
        {{ . }}
      </a>
  {{ end }}
{{ end }}

meta-tags.html:

{{ if .Params.tags }}
  {{ range $index, $tag := .Params.tags }}
    {{ if gt $index 0 }},
    {{ end }}
      <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">
        {{ . }}
      </a>
  {{ end }}
{{ end }}

Thank you AlahmadiQ8 & Jonathan_Griffin.

What I mean is what should I put in my index.html file in order to have the tags appear?

Here is what I have now in my index.html:

<div class="post">
  <h1 class="post-title">
    <a href="{{ .Permalink }}">{{ .Title }}</a>
  </h1>
  <span class="post-date">{{ .Date.Format "Lun, 2 Jan, 2006" }}</span>
  {{ .Summary }}
  {{ if .Truncated }}
  <div class="read-more-link">
    <a href="{{ .RelPermalink }}">…</a>
  </div>
  {{ end }}
</div>
{{- end }}
</div>
{{- end }}