diff --git a/templates/layout/base.gohtml b/templates/layout/base.gohtml new file mode 100644 index 0000000..550232f --- /dev/null +++ b/templates/layout/base.gohtml @@ -0,0 +1,36 @@ +{{ define "layout/base"}} + + + + {{template "layout/head" .}} + {{block "head" .}} + {{end}} + + +
+ + + +
+ {{block "content" .}} + + {{end}} +
+ + +
+ + +{{ end }} \ No newline at end of file diff --git a/templates/layout/base.html b/templates/layout/base.html deleted file mode 100644 index 6ea3512..0000000 --- a/templates/layout/base.html +++ /dev/null @@ -1,36 +0,0 @@ -{{ define "layout/base"}} - - - - {{template "layout/head" .}} - {{block "head" .}} - {{end}} - - -
- - - -
- {{block "content" .}} - - {{end}} -
- - -
- - -{{ end }} \ No newline at end of file diff --git a/templates/layout/empty.gohtml b/templates/layout/empty.gohtml new file mode 100644 index 0000000..d431380 --- /dev/null +++ b/templates/layout/empty.gohtml @@ -0,0 +1,37 @@ +{{define "layout/empty"}} +
+
+ +
+ + +
+ +

{{if .search}} + 抱歉,没有符合您搜索条件的结果。请换其它关键词再试。 + {{else}} + 这儿似乎什么都没有,试试搜索? + {{end}} +

+ + +
+
+ +
+
+{{end}} \ No newline at end of file diff --git a/templates/layout/empty.html b/templates/layout/empty.html deleted file mode 100644 index d84c0db..0000000 --- a/templates/layout/empty.html +++ /dev/null @@ -1,37 +0,0 @@ -{{define "layout/empty"}} -
-
- -
- - -
- -

{{if .search}} - 抱歉,没有符合您搜索条件的结果。请换其它关键词再试。 - {{else}} - 这儿似乎什么都没有,试试搜索? - {{end}} -

- - -
-
- -
-
-{{end}} \ No newline at end of file diff --git a/templates/layout/footer.html b/templates/layout/footer.gohtml similarity index 100% rename from templates/layout/footer.html rename to templates/layout/footer.gohtml diff --git a/templates/layout/head.gohtml b/templates/layout/head.gohtml new file mode 100644 index 0000000..9b9750b --- /dev/null +++ b/templates/layout/head.gohtml @@ -0,0 +1,485 @@ +{{define "layout/head"}} + + + + {{ .title }} + + + + + + + + + + + + + + +{{end}} \ No newline at end of file diff --git a/templates/layout/head.html b/templates/layout/head.html deleted file mode 100644 index 0744828..0000000 --- a/templates/layout/head.html +++ /dev/null @@ -1,43 +0,0 @@ -{{define "layout/head"}} - - - -{{ .title }} - - - - - - - - - - - - - - -{{end}} \ No newline at end of file diff --git a/templates/layout/pagination.html b/templates/layout/pagination.gohtml similarity index 100% rename from templates/layout/pagination.html rename to templates/layout/pagination.gohtml diff --git a/templates/layout/sidebar.html b/templates/layout/sidebar.gohtml similarity index 100% rename from templates/layout/sidebar.html rename to templates/layout/sidebar.gohtml diff --git a/templates/posts/detail.html b/templates/posts/detail.gohtml similarity index 100% rename from templates/posts/detail.html rename to templates/posts/detail.gohtml diff --git a/templates/posts/index.gohtml b/templates/posts/index.gohtml new file mode 100644 index 0000000..9956ef2 --- /dev/null +++ b/templates/posts/index.gohtml @@ -0,0 +1,70 @@ +{{template "layout/base" .}} +{{define "content" }} + {{if .posts}} +
+
+ {{if .header}} + + {{end}} + {{ range $k,$v:=.posts}} + + {{end}} + + {{template "layout/page" .}} +
+
+ {{else }} + {{template "layout/empty" .}} + {{end}} + +{{end}} diff --git a/templates/posts/index.html b/templates/posts/index.html deleted file mode 100644 index a4f7af0..0000000 --- a/templates/posts/index.html +++ /dev/null @@ -1,70 +0,0 @@ -{{template "layout/base" .}} -{{define "content" }} -{{if .posts}} -
-
- {{if .header}} - - {{end}} - {{ range $k,$v:=.posts}} - - {{end}} - - {{template "layout/page" .}} -
-
-{{else }} -{{template "layout/empty" .}} -{{end}} - -{{end}}