How to use partials for only certain pages

Partials are commonly referenced from your layouts/_default/baseof.html. For example:

<!DOCTYPE html>
<html>
  {{- partial "head.html" . -}}
  <body>
    {{- partial "header.html" . -}}
    {{- block "main" . }}{{- end }}
    {{- partial "footer.html" . -}}
  </body>
</html>

Then, for example, in your layouts/index.html, you would define what goes into the main block:

{{- define "main" -}}
<!-- Some code here -->
{{- end -}}

Does that help?