Renamed views directory to templates.
This commit is contained in:
parent
d0caa8119e
commit
299774c0c7
12 changed files with 1 additions and 1 deletions
3
templates/components/forms.gohtml
Normal file
3
templates/components/forms.gohtml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{{define "csrf"}}
|
||||
<input type="hidden" name="csrf" value="{{.CSRF}}"/>
|
||||
{{end}}
|
||||
20
templates/components/head.gohtml
Normal file
20
templates/components/head.gohtml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{define "metatags"}}
|
||||
<title>{{ .AppName }}{{ if .Title }} | {{ .Title }}{{ end }}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{{- if .Metatags.Description}}
|
||||
<meta name="description" content="{{.Metatags.Description}}">
|
||||
{{- end}}
|
||||
{{- if .Metatags.Keywords}}
|
||||
<meta name="keywords" content="{{.Metatags.Keywords | join ", "}}">
|
||||
{{- end}}
|
||||
{{end}}
|
||||
|
||||
{{define "css"}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
|
||||
{{end}}
|
||||
|
||||
{{define "js"}}
|
||||
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||
{{end}}
|
||||
20
templates/components/messages.gohtml
Normal file
20
templates/components/messages.gohtml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{define "messages"}}
|
||||
{{- range (.GetMessages "success")}}
|
||||
{{template "message" dict "Type" "success" "Text" .}}
|
||||
{{- end}}
|
||||
{{- range (.GetMessages "info")}}
|
||||
{{template "message" dict "Type" "info" "Text" .}}
|
||||
{{- end}}
|
||||
{{- range (.GetMessages "warning")}}
|
||||
{{template "message" dict "Type" "warning" "Text" .}}
|
||||
{{- end}}
|
||||
{{- range (.GetMessages "danger")}}
|
||||
{{template "message" dict "Type" "danger" "Text" .}}
|
||||
{{- end}}
|
||||
{{end}}
|
||||
|
||||
{{define "message"}}
|
||||
<article class="message is-{{.Type}}">
|
||||
<div class="message-body">{{.Text}}</div>
|
||||
</article>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue