How do I add a form at the end of each post? #250
-
|
I've organized my blog posts under I tried adding my own customized All I want is, for Hugo to append the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Option 1In {{- if (eq .Type "posts") -}}
{{ partial "form.html" . }}
{{/* or include HTML for the form here */}}
{{- end -}}Option 2Or, what I would recommend, is using a custom {{- if .Param "enableForm" -}}
{{ partial "form.html" . }}
{{/* or include HTML for the form here */}}
{{- end -}}Then you'd add the following to each page's front matter: enableForm: true |
Beta Was this translation helpful? Give feedback.
Option 1
In
single.html, you could try something like the following:{{- if (eq .Type "posts") -}} {{ partial "form.html" . }} {{/* or include HTML for the form here */}} {{- end -}}Option 2
Or, what I would recommend, is using a custom
paramto handle this:{{- if .Param "enableForm" -}} {{ partial "form.html" . }} {{/* or include HTML for the form here */}} {{- end -}}Then you'd add the following to each page's front matter: