diff --git a/dict/templates/404.html b/dict/templates/404.html index 3830f68..bc894b1 100644 --- a/dict/templates/404.html +++ b/dict/templates/404.html @@ -1,11 +1,7 @@ {{- define "title" }}404 Not Found - {{ template "sitetitle" . }}{{- end -}} {{- define "results" -}} -
-
-

404 Not Found

-

Looks like this page doesn't exist?

-
+{{- template "404" . }} {{- end -}} {{- template "index" . -}} \ No newline at end of file diff --git a/dict/templates/partials/404.html b/dict/templates/partials/404.html new file mode 100644 index 0000000..7a28671 --- /dev/null +++ b/dict/templates/partials/404.html @@ -0,0 +1,8 @@ +{{ define "404" }} +
+
+

404 Not Found

+ Reimu fumo can't find nothin +

Looks like this page doesn't exist?

+
+{{ end }} \ No newline at end of file diff --git a/dict/templates/word.html b/dict/templates/word.html index 245c10b..7c5fb1b 100644 --- a/dict/templates/word.html +++ b/dict/templates/word.html @@ -1,5 +1,9 @@ -{{- define "title" }}{{ .Entry.Kanji }} - {{ template "sitetitle" . }}{{- end -}} +{{- define "title" }}{{ if .Entry }}{{ .Entry.Kanji }}{{ else }}404 Not Found{{ end }} - {{ template "sitetitle" . }}{{- end -}} {{- define "results" -}} +{{- if .Entry -}} {{- template "entryfull" .Entry -}} +{{- else -}} +{{- template "404" . }} +{{- end -}} {{- end -}} {{- template "index" . -}} \ No newline at end of file