I want to automatically index elements like figures and tables

This change adds page-based counters for figures and tables using
Hugo .Scratch.

Adds automatic counters for figures and tables
This commit is contained in:
Huy Tran 2018-07-24 09:51:40 +10:00
parent a03bb3f465
commit 7e03bb3c64
6 changed files with 8 additions and 2 deletions

View file

@ -3,7 +3,7 @@
{{- end -}} {{- end -}}
{{ define "content" -}} {{ define "content" -}}
{{ partial "page_list.html" . }} {{ partial "page-list.html" . }}
{{- end -}} {{- end -}}
{{ define "footer" -}} {{ define "footer" -}}

View file

@ -1,9 +1,10 @@
{{ define "header" -}} {{ define "header" -}}
{{ partial "page-variables-init.html" . }}
{{ partial "header.html" . }} {{ partial "header.html" . }}
{{- end -}} {{- end -}}
{{ define "content" -}} {{ define "content" -}}
{{ partial "page_single.html" . }} {{ partial "page-single.html" . }}
{{- end -}} {{- end -}}
{{ define "footer" -}} {{ define "footer" -}}
@ -12,4 +13,5 @@
{{- partial "commenting.html" . -}} {{- partial "commenting.html" . -}}
</div> </div>
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
{{ partial "page-variables-deinit.html" . }}
{{- end -}} {{- end -}}

View file

@ -0,0 +1,2 @@
{{ .Page.Scratch.Delete "fig" }}
{{ .Page.Scratch.Delete "table" }}

View file

@ -0,0 +1,2 @@
{{ .Page.Scratch.Set "fig" 1 }}
{{ .Page.Scratch.Set "table" 1 }}