diff --git a/api.go b/api.go
index fa12015..9926184 100644
--- a/api.go
+++ b/api.go
@@ -380,9 +380,9 @@ func responseNotice(c *gin.Context, typ, content, hl string) {
domain = domain[0:i]
}
if hl != "" {
- c.SetCookie("notice_highlight", hl, 86400, "/", domain, runmode.EnableHttps, false)
+ c.SetCookie("notice_highlight", hl, 86400, "/", domain, true, false)
}
- c.SetCookie("notice_type", typ, 86400, "/", domain, runmode.EnableHttps, false)
- c.SetCookie("notice", fmt.Sprintf("[\"%s\"]", content), 86400, "/", domain, runmode.EnableHttps, false)
+ c.SetCookie("notice_type", typ, 86400, "/", domain, true, false)
+ c.SetCookie("notice", fmt.Sprintf("[\"%s\"]", content), 86400, "/", domain, true, false)
c.Redirect(http.StatusFound, c.Request.Referer())
}
diff --git a/conf/tpl/feedTpl.xml b/conf/tpl/feedTpl.xml
index 3e9c410..0d81fd0 100644
--- a/conf/tpl/feedTpl.xml
+++ b/conf/tpl/feedTpl.xml
@@ -2,19 +2,19 @@
{{.Title}}
- {{if .EnableHttps}}https://{{else}}http://{{end}}{{.Domain}}
-
+ https://{{.Domain}}
+
{{.SubTitle}}
zh-CN
{{.BuildDate}}
{{range .Artcs}}
-
{{.Title}}
- {{if $.EnableHttps}}https://{{else}}http://{{end}}{{$.Domain}}/post/{{.Slug}}.html
- {{if $.EnableHttps}}https://{{else}}http://{{end}}{{$.Domain}}/post/{{.Slug}}.html#comments
- {{if $.EnableHttps}}https://{{else}}http://{{end}}{{$.Domain}}/post/{{.Slug}}.html
+ https://{{$.Domain}}/post/{{.Slug}}.html
+ https://{{$.Domain}}/post/{{.Slug}}.html#comments
+ https://{{$.Domain}}/post/{{.Slug}}.html
{{.Content}}]]>
{{end}}
-
\ No newline at end of file
+
diff --git a/conf/tpl/sitemapTpl.xml b/conf/tpl/sitemapTpl.xml
index 0724c8c..417dcce 100644
--- a/conf/tpl/sitemapTpl.xml
+++ b/conf/tpl/sitemapTpl.xml
@@ -2,9 +2,9 @@
{{range .Artcs}}
- {{if $.EnableHttps}}https{{else}}http{{end}}://{{$.Domain}}/post/{{.Slug}}.html
+ https://{{$.Domain}}/post/{{.Slug}}.html
{{dateformat .CreateTime "2006-01-02"}}
0.6
{{end}}
-
\ No newline at end of file
+
diff --git a/disqus.go b/disqus.go
index 27a85f3..a7fea84 100644
--- a/disqus.go
+++ b/disqus.go
@@ -27,10 +27,7 @@ func CommentsCount() {
return
}
baseUrl := setting.Conf.Disqus.URL + "?api_key=" + setting.Conf.Disqus.PublicKey + "&forum=" + setting.Conf.Disqus.ShortName + "&"
- domain := "http://" + runmode.Domain
- if runmode.EnableHttps {
- domain = "https://" + runmode.Domain
- }
+ domain := "https://" + runmode.Domain
var count, index int
for index < len(Ei.Articles) {
logd.Debugf("count=====%d, index=======%d, length=======%d, bool=========%t", count, index, len(Ei.Articles), index < len(Ei.Articles) && count < 10)
diff --git a/front.go b/front.go
index 47dec3a..03ee4b5 100644
--- a/front.go
+++ b/front.go
@@ -140,7 +140,6 @@ func HandleArticlePage(c *gin.Context) {
}
}
h["Article"] = artc
- h["EnableHttps"] = runmode.EnableHttps
c.HTML(http.StatusOK, "homeLayout.html", h)
}
diff --git a/router.go b/router.go
index a274f0b..fab2566 100644
--- a/router.go
+++ b/router.go
@@ -27,7 +27,7 @@ func init() {
store.Options(sessions.Options{
MaxAge: 86400 * 999,
Path: "/",
- Secure: runmode.EnableHttps,
+ Secure: true,
HttpOnly: true,
})
router.Use(sessions.Sessions("su", store))
diff --git a/views/about.html b/views/about.html
index 10ba79c..43b7abe 100644
--- a/views/about.html
+++ b/views/about.html
@@ -1 +1 @@
-{{define "about"}}
{{with .Article}}
{{.Title}}
{{str2html .Content}}
{{end}}
{{end}}
+{{define "about"}}{{with .Article}}
{{.Title}}
{{str2html .Content}}
{{end}}
{{end}}
diff --git a/views/admin/origin/articles.html b/views/admin/origin/articles.html
deleted file mode 100644
index 7c17a92..0000000
--- a/views/admin/origin/articles.html
+++ /dev/null
@@ -1,328 +0,0 @@
-
-
-
-
-
-
-
-
- 管理文章 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/backLayout.html b/views/admin/origin/backLayout.html
deleted file mode 100644
index 86bf597..0000000
--- a/views/admin/origin/backLayout.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
- {{.Title}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/home.html b/views/admin/origin/home.html
deleted file mode 100644
index c86c3f3..0000000
--- a/views/admin/origin/home.html
+++ /dev/null
@@ -1 +0,0 @@
-none
\ No newline at end of file
diff --git a/views/admin/origin/login.html b/views/admin/origin/login.html
deleted file mode 100644
index c157bf1..0000000
--- a/views/admin/origin/login.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
- Login | {{.BTitle}}
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/profile.html b/views/admin/origin/profile.html
deleted file mode 100644
index 2b7fcdc..0000000
--- a/views/admin/origin/profile.html
+++ /dev/null
@@ -1,393 +0,0 @@
-
-
-
-
-
-
-
-
- 个人设置 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
个人设置
-
-
-
-
-
-
-
admin
-
admin
-
目前有 2 篇日志, 并有 1 条关于你的评论在 11 个分类中.
-
最后登录: 2天前
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/reading.html b/views/admin/origin/reading.html
deleted file mode 100644
index 30cc11f..0000000
--- a/views/admin/origin/reading.html
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-
-
-
-
-
-
- 阅读设置 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/series.html b/views/admin/origin/series.html
deleted file mode 100644
index 26265bc..0000000
--- a/views/admin/origin/series.html
+++ /dev/null
@@ -1,480 +0,0 @@
-
-
-
-
-
-
-
-
- 管理分类 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/setting.html b/views/admin/origin/setting.html
deleted file mode 100644
index ac412a3..0000000
--- a/views/admin/origin/setting.html
+++ /dev/null
@@ -1,374 +0,0 @@
-
-
-
-
-
-
-
-
- 基本设置 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/tags.html b/views/admin/origin/tags.html
deleted file mode 100644
index f107c93..0000000
--- a/views/admin/origin/tags.html
+++ /dev/null
@@ -1,321 +0,0 @@
-
-
-
-
-
-
-
-
- 管理标签 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/admin/origin/write.html b/views/admin/origin/write.html
deleted file mode 100644
index 8d04fff..0000000
--- a/views/admin/origin/write.html
+++ /dev/null
@@ -1,1069 +0,0 @@
-
-
-
-
-
-
-
-
- 撰写新文章 - Hello World - Powered by Typecho
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/article.html b/views/article.html
index b421fb7..27ed080 100644
--- a/views/article.html
+++ b/views/article.html
@@ -1 +1 @@
-{{define "article"}}{{with .Article}}
{{.Title}}
{{str2html .Content}}
本文链接:https://{{$.Domain}}/post/{{.Slug}}.html,参与评论 »
--EOF--
发表于 {{dateformat .CreateTime "2006-01-02 15:04:05"}}{{if gt (.Tags|len) 0}},并被添加「{{range $index, $elem := .Tags}}{{if gt $index 0}}、{{end}}{{$elem}}{{end}}」标签{{end}}{{if .UpdateTime|isnotzero}},最后修改于 {{dateformat .UpdateTime "2006-01-02 15:04:05"}}{{end}}。
{{with $.Copyright}}
{{str2html $.Copyright}}更多说明 »
{{end}} {{with $.Serie}}{{if gt $.Days 100}}
提醒:本文最后更新于 {{$.Days}} 天前,文中所描述的信息可能已发生改变,请谨慎使用。
{{end}}
专题「{{.Name}}」的其它文章 »
{{range .Articles}}{{if ne .ID $.Article.ID}}- {{.Title}} ({{dateformat .CreateTime "Jan 02, 2006"}})
{{end}}{{end}}
{{end}}
{{end}}
{{end}}
+{{define "article"}}{{with .Article}}
{{.Title}}
{{str2html .Content}}
本文链接:https://{{$.Domain}}/post/{{.Slug}}.html,参与评论 »
--EOF--
发表于 {{dateformat .CreateTime "2006-01-02 15:04:05"}}{{if gt (.Tags|len) 0}},并被添加「{{range $index, $elem := .Tags}}{{if gt $index 0}}、{{end}}{{$elem}}{{end}}」标签{{end}}{{if .UpdateTime|isnotzero}},最后修改于 {{dateformat .UpdateTime "2006-01-02 15:04:05"}}{{end}}。
{{with $.Copyright}}
{{str2html $.Copyright}}更多说明 »
{{end}} {{with $.Serie}}{{if gt $.Days 100}}
提醒:本文最后更新于 {{$.Days}} 天前,文中所描述的信息可能已发生改变,请谨慎使用。
{{end}}
专题「{{.Name}}」的其它文章 »
{{range .Articles}}{{if ne .ID $.Article.ID}}- {{.Title}} ({{dateformat .CreateTime "Jan 02, 2006"}})
{{end}}{{end}}
{{end}}
{{end}}
{{end}}
diff --git a/xml.go b/xml.go
index 50e81d3..e8e7e7f 100644
--- a/xml.go
+++ b/xml.go
@@ -38,12 +38,11 @@ func doFeed() {
_, _, artcs := PageList(1, FEED_COUNT)
buildDate := time.Now()
params := map[string]interface{}{
- "Title": Ei.BTitle,
- "SubTitle": Ei.SubTitle,
- "Domain": runmode.Domain,
- "Enablehttps": runmode.EnableHttps,
- "BuildDate": buildDate.Format(time.RFC1123Z),
- "Artcs": artcs,
+ "Title": Ei.BTitle,
+ "SubTitle": Ei.SubTitle,
+ "Domain": runmode.Domain,
+ "BuildDate": buildDate.Format(time.RFC1123Z),
+ "Artcs": artcs,
}
f, err := os.OpenFile("static/feed.xml", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.ModePerm)
@@ -66,7 +65,7 @@ func doSitemap() {
logd.Error("not found sitemapTpl.")
return
}
- params := map[string]interface{}{"Artcs": Ei.Articles, "Domain": runmode.Domain, "Enablehttps": runmode.EnableHttps}
+ params := map[string]interface{}{"Artcs": Ei.Articles, "Domain": runmode.Domain}
f, err := os.OpenFile("static/sitemap.xml", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.ModePerm)
if err != nil {
logd.Error(err)
Comments