# See which template is used by Hugo

**URL:** <https://discourse.gohugo.io/t/see-which-template-is-used-by-hugo/9983>\
**Category:** tips & tricks\
**Created:** [January 12, 2018, 7:39pm UTC](https://discourse.gohugo.io/t/see-which-template-is-used-by-hugo/9983 "2018-01-12T19:39:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![it-gro](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/it-gro/32/4767_2.png) [@it-gro](https://discourse.gohugo.io/u/it-gro)\
**Post date:** [January 13, 2018, 4:02pm UTC](https://discourse.gohugo.io/t/see-which-template-is-used-by-hugo/9983/2 "2018-01-13T16:02:25Z")

</div>

Cool - Thx for sharing and your very good post!

I prefer to see the chosen templates and partials as **comments** in the html.  
Include e.g.  
{{ `<!-- _default/terms.html -->` | safeHTML }}

or

```
{{ `<!-- partials/head.meta.html -->` | safeHTML }}

```

in the templates and partials.

To keep track in the blocks:

```
{{- block "main" . }}
  {{ `<!-- block main _default/baseof.html -->` | safeHTML }}
  {{- partial "main.blog.date.html" . -}}
  {{- partial "main.toc.single.html" . -}}
  {{ `<!-- back in _default/baseof.html -->` | safeHTML }}
  {{- .Content -}}
{{- end }}

```

I had no chance to figure out the lookup order without tracing it via those comments…

working examples:  
[https://raw.githubusercontent.com/it-gro/hugo-theme-w3css-basic/master/layouts/\_default/terms.html](https://raw.githubusercontent.com/it-gro/hugo-theme-w3css-basic/master/layouts/_default/terms.html)  
[https://raw.githubusercontent.com/it-gro/hugo-theme-w3css-basic/master/layouts/partials/head.meta.html](https://raw.githubusercontent.com/it-gro/hugo-theme-w3css-basic/master/layouts/partials/head.meta.html)  
[https://raw.githubusercontent.com/it-gro/hugo-theme-w3css-basic/master/layouts/\_default/baseof.html](https://raw.githubusercontent.com/it-gro/hugo-theme-w3css-basic/master/layouts/_default/baseof.html)

---

_[View the full topic](https://discourse.gohugo.io/t/see-which-template-is-used-by-hugo/9983)._
