mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-08 23:52:26 +08:00
update
This commit is contained in:
12
api.go
12
api.go
@@ -393,6 +393,18 @@ func apiTrashRecover(c *gin.Context) {
|
||||
|
||||
func apiFileUpload(c *gin.Context) {
|
||||
|
||||
// file, header , err := c.Request.FormFile("upload")
|
||||
// filename := header.Filename
|
||||
// fmt.Println(header.Filename)
|
||||
// out, err := os.Create("./tmp/"+filename+".png")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// defer out.Close()
|
||||
// _, err = io.Copy(out, file)
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
}
|
||||
|
||||
func responseNotice(c *gin.Context, typ, content, hl string) {
|
||||
|
||||
77
back.go
77
back.go
@@ -2,7 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
@@ -45,9 +47,8 @@ func HandleLogin(c *gin.Context) {
|
||||
c.Redirect(http.StatusFound, "/admin/profile")
|
||||
return
|
||||
}
|
||||
c.HTML(http.StatusOK, "login.html", gin.H{
|
||||
"BTitle": Ei.BTitle,
|
||||
})
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "login.html", gin.H{"BTitle": Ei.BTitle})
|
||||
}
|
||||
|
||||
func HandleLoginPost(c *gin.Context) {
|
||||
@@ -55,12 +56,12 @@ func HandleLoginPost(c *gin.Context) {
|
||||
pwd := c.PostForm("password")
|
||||
// code := c.PostForm("code") // 二次验证
|
||||
if user == "" || pwd == "" {
|
||||
logd.Info("参数错误", user, pwd)
|
||||
logd.Print("参数错误", user, pwd)
|
||||
c.Redirect(http.StatusFound, "/admin/login")
|
||||
return
|
||||
}
|
||||
if Ei.Username != user || !VerifyPasswd(Ei.Password, user, pwd) {
|
||||
logd.Info("账号或密码错误", user, pwd)
|
||||
logd.Print("账号或密码错误", user, pwd)
|
||||
c.Redirect(http.StatusFound, "/admin/login")
|
||||
return
|
||||
}
|
||||
@@ -84,8 +85,8 @@ func HandleProfile(c *gin.Context) {
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "个人配置 | " + Ei.BTitle
|
||||
h["Account"] = Ei
|
||||
h["Profile"] = true
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-profile", h)
|
||||
}
|
||||
|
||||
// 写文章==>Write
|
||||
@@ -107,7 +108,6 @@ func HandlePost(c *gin.Context) {
|
||||
if h["Title"] == "" {
|
||||
h["Title"] = "撰写文章 | " + Ei.BTitle
|
||||
}
|
||||
h["Post"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Domain"] = setting.Conf.Mode.Domain
|
||||
h["Series"] = Ei.Series
|
||||
@@ -116,7 +116,8 @@ func HandlePost(c *gin.Context) {
|
||||
tags = append(tags, T{tag, tag})
|
||||
}
|
||||
h["Tags"] = tags
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-post", h)
|
||||
}
|
||||
|
||||
func HandleDraftDelete(c *gin.Context) {
|
||||
@@ -149,7 +150,6 @@ func HandlePosts(c *gin.Context) {
|
||||
h["Manage"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "文章管理 | " + Ei.BTitle
|
||||
h["Posts"] = true
|
||||
h["Series"] = Ei.Series
|
||||
h["Serie"] = se
|
||||
h["KW"] = kw
|
||||
@@ -169,7 +169,8 @@ func HandlePosts(c *gin.Context) {
|
||||
h["PP"].(map[int]string)[i+1] = vals.Encode()
|
||||
}
|
||||
h["Cur"] = pg
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-posts", h)
|
||||
}
|
||||
|
||||
// 专题列表
|
||||
@@ -178,9 +179,9 @@ func HandleSeries(c *gin.Context) {
|
||||
h["Manage"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "专题管理 | " + Ei.BTitle
|
||||
h["Series"] = true
|
||||
h["List"] = Ei.Series
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-series", h)
|
||||
}
|
||||
|
||||
func HandleSerie(c *gin.Context) {
|
||||
@@ -194,8 +195,8 @@ func HandleSerie(c *gin.Context) {
|
||||
}
|
||||
h["Manage"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Serie"] = true
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-serie", h)
|
||||
}
|
||||
|
||||
// 标签列表
|
||||
@@ -204,9 +205,9 @@ func HandleTags(c *gin.Context) {
|
||||
h["Manage"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "标签管理 | " + Ei.BTitle
|
||||
h["Tags"] = true
|
||||
h["List"] = Ei.Tags
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-tags", h)
|
||||
}
|
||||
|
||||
// 草稿箱
|
||||
@@ -215,15 +216,15 @@ func HandleDraft(c *gin.Context) {
|
||||
h["Manage"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "草稿箱 | " + Ei.BTitle
|
||||
h["Draft"] = true
|
||||
var err error
|
||||
h["List"], err = LoadDraft()
|
||||
if err != nil {
|
||||
logd.Error(err)
|
||||
c.HTML(http.StatusBadRequest, "backLayout.html", h)
|
||||
return
|
||||
c.Status(http.StatusBadRequest)
|
||||
} else {
|
||||
c.Status(http.StatusOK)
|
||||
}
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
RenderHTMLBack(c, "admin-draft", h)
|
||||
}
|
||||
|
||||
// 回收箱
|
||||
@@ -232,7 +233,6 @@ func HandleTrash(c *gin.Context) {
|
||||
h["Manage"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "回收箱 | " + Ei.BTitle
|
||||
h["Trash"] = true
|
||||
var err error
|
||||
h["List"], err = LoadTrash()
|
||||
if err != nil {
|
||||
@@ -240,7 +240,8 @@ func HandleTrash(c *gin.Context) {
|
||||
c.HTML(http.StatusBadRequest, "backLayout.html", h)
|
||||
return
|
||||
}
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-trash", h)
|
||||
}
|
||||
|
||||
// 基本设置==>Setting
|
||||
@@ -249,8 +250,8 @@ func HandleGeneral(c *gin.Context) {
|
||||
h["Setting"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "基本设置 | " + Ei.BTitle
|
||||
h["General"] = true
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-general", h)
|
||||
}
|
||||
|
||||
// 阅读设置
|
||||
@@ -259,8 +260,8 @@ func HandleDiscussion(c *gin.Context) {
|
||||
h["Setting"] = true
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["Title"] = "阅读设置 | " + Ei.BTitle
|
||||
h["Discussion"] = true
|
||||
c.HTML(http.StatusOK, "backLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLBack(c, "admin-discussion", h)
|
||||
}
|
||||
|
||||
// api
|
||||
@@ -274,3 +275,25 @@ func HandleAPI(c *gin.Context) {
|
||||
}
|
||||
api(c)
|
||||
}
|
||||
|
||||
func RenderHTMLBack(c *gin.Context, name string, data gin.H) {
|
||||
if name == "login.html" {
|
||||
err := Tmpl.ExecuteTemplate(c.Writer, name, data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||
return
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
err := Tmpl.ExecuteTemplate(&buf, name, data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
data["LayoutContent"] = template.HTML(buf.String())
|
||||
err = Tmpl.ExecuteTemplate(c.Writer, "backLayout.html", data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||
}
|
||||
|
||||
62
front.go
62
front.go
@@ -3,7 +3,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"regexp"
|
||||
@@ -31,6 +33,8 @@ func UserCookie(c *gin.Context) {
|
||||
cookie, err := c.Request.Cookie("u")
|
||||
if err != nil || cookie.Value == "" {
|
||||
// TODO cookie操作
|
||||
b := []byte(c.ClientIP() + time.Now().String())
|
||||
c.SetCookie("u", fmt.Sprintf("%x", SHA1(b)), 86400*999, "/", "", true, true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,15 +56,6 @@ func StaticVersion(c *gin.Context) (version int) {
|
||||
return 0
|
||||
}
|
||||
|
||||
func HandleNotFound(c *gin.Context) {
|
||||
h := GetBase()
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = "Not Found"
|
||||
h["NotFoundPage"] = true
|
||||
h["Path"] = ""
|
||||
c.HTML(http.StatusNotFound, "homeLayout.html", h)
|
||||
}
|
||||
|
||||
func GetBase() gin.H {
|
||||
return gin.H{
|
||||
"Favicon": setting.Conf.Favicon,
|
||||
@@ -75,19 +70,28 @@ func GetBase() gin.H {
|
||||
}
|
||||
}
|
||||
|
||||
func HandleNotFound(c *gin.Context) {
|
||||
h := GetBase()
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = "Not Found"
|
||||
h["Path"] = ""
|
||||
c.Status(http.StatusNotFound)
|
||||
RenderHTMLFront(c, "notfound", h)
|
||||
}
|
||||
|
||||
func HandleHomePage(c *gin.Context) {
|
||||
h := GetBase()
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = Ei.BTitle + " | " + Ei.SubTitle
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["HomePage"] = true
|
||||
h["CurrentPage"] = "blog-home"
|
||||
pn, err := strconv.Atoi(c.Query("pn"))
|
||||
if err != nil || pn < 1 {
|
||||
pn = 1
|
||||
}
|
||||
h["Prev"], h["Next"], h["List"] = PageList(pn, setting.Conf.PageNum)
|
||||
c.HTML(http.StatusOK, "homeLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLFront(c, "home", h)
|
||||
}
|
||||
|
||||
func HandleSeriesPage(c *gin.Context) {
|
||||
@@ -95,10 +99,10 @@ func HandleSeriesPage(c *gin.Context) {
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = "专题 | " + Ei.BTitle
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["SeriesPage"] = true
|
||||
h["CurrentPage"] = "series"
|
||||
h["Article"] = Ei.PageSeries
|
||||
c.HTML(http.StatusOK, "homeLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLFront(c, "series", h)
|
||||
}
|
||||
|
||||
func HandleArchivesPage(c *gin.Context) {
|
||||
@@ -106,10 +110,10 @@ func HandleArchivesPage(c *gin.Context) {
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = "归档 | " + Ei.BTitle
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["ArchivesPage"] = true
|
||||
h["CurrentPage"] = "archives"
|
||||
h["Article"] = Ei.PageArchives
|
||||
c.HTML(http.StatusOK, "homeLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLFront(c, "archives", h)
|
||||
}
|
||||
|
||||
func HandleArticlePage(c *gin.Context) {
|
||||
@@ -124,12 +128,13 @@ func HandleArticlePage(c *gin.Context) {
|
||||
h["Title"] = artc.Title + " | " + Ei.BTitle
|
||||
h["Path"] = c.Request.URL.Path
|
||||
h["CurrentPage"] = "post-" + artc.Slug
|
||||
var name string
|
||||
if path == "blogroll.html" {
|
||||
h["BlogrollPage"] = true
|
||||
name = "blogroll"
|
||||
} else if path == "about.html" {
|
||||
h["AboutPage"] = true
|
||||
name = "about"
|
||||
} else {
|
||||
h["ArticlePage"] = true
|
||||
name = "article"
|
||||
h["Copyright"] = Ei.Copyright
|
||||
if !artc.UpdateTime.IsZero() {
|
||||
h["Days"] = int(time.Now().Sub(artc.UpdateTime).Hours()) / 24
|
||||
@@ -141,7 +146,8 @@ func HandleArticlePage(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
h["Article"] = artc
|
||||
c.HTML(http.StatusOK, "homeLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLFront(c, name, h)
|
||||
}
|
||||
|
||||
func HandleSearchPage(c *gin.Context) {
|
||||
@@ -149,7 +155,6 @@ func HandleSearchPage(c *gin.Context) {
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = "站内搜索 | " + Ei.BTitle
|
||||
h["Path"] = ""
|
||||
h["SearchPage"] = true
|
||||
h["CurrentPage"] = "search-post"
|
||||
|
||||
q := c.Query("q")
|
||||
@@ -187,7 +192,8 @@ func HandleSearchPage(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
c.HTML(http.StatusOK, "homeLayout.html", h)
|
||||
c.Status(http.StatusOK)
|
||||
RenderHTMLFront(c, "search", h)
|
||||
}
|
||||
|
||||
func HandleFeed(c *gin.Context) {
|
||||
@@ -272,3 +278,17 @@ func HandleDisqus(c *gin.Context) {
|
||||
}
|
||||
c.JSON(http.StatusOK, ss)
|
||||
}
|
||||
|
||||
func RenderHTMLFront(c *gin.Context, name string, data gin.H) {
|
||||
var buf bytes.Buffer
|
||||
err := Tmpl.ExecuteTemplate(&buf, name, data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
data["LayoutContent"] = template.HTML(buf.String())
|
||||
err = Tmpl.ExecuteTemplate(c.Writer, "homeLayout.html", data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||
}
|
||||
|
||||
25
helper.go
25
helper.go
@@ -1,9 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"path"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
@@ -26,6 +29,28 @@ func VerifyPasswd(origin, name, input string) bool {
|
||||
return origin == EncryptPasswd(name, input)
|
||||
}
|
||||
|
||||
func SHA1(data []byte) [sha1.Size]byte {
|
||||
return sha1.Sum(data)
|
||||
}
|
||||
|
||||
func ReadDir(dir string, filter func(name string) bool) (files []string) {
|
||||
fis, err := ioutil.ReadDir(dir)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, fi := range fis {
|
||||
if filter(fi.Name()) {
|
||||
continue
|
||||
}
|
||||
if fi.IsDir() {
|
||||
files = append(files, ReadDir(path.Join(dir, fi.Name()), filter)...)
|
||||
continue
|
||||
}
|
||||
files = append(files, path.Join(dir, fi.Name()))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func IgnoreHtmlTag(src string) string {
|
||||
//去除所有尖括号内的HTML代码
|
||||
re, _ := regexp.Compile("\\<[\\S\\s]+?\\>")
|
||||
|
||||
20
router.go
20
router.go
@@ -13,7 +13,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var router *gin.Engine
|
||||
var (
|
||||
router *gin.Engine
|
||||
Tmpl *template.Template
|
||||
)
|
||||
|
||||
func init() {
|
||||
if setting.Conf.RunMode == setting.PROD {
|
||||
@@ -31,14 +34,15 @@ func init() {
|
||||
})
|
||||
router.Use(sessions.Sessions("su", store))
|
||||
// 匹配模版
|
||||
//router.LoadHTMLGlob("views/*.html")
|
||||
if tmpl, err := template.New("").Funcs(tmpl.TplFuncMap).ParseGlob("views/*.*"); err == nil {
|
||||
tmpl, err = tmpl.ParseGlob("views/admin/*.html")
|
||||
if err != nil {
|
||||
logd.Fatal(err)
|
||||
Tmpl = template.New("eiblog").Funcs(tmpl.TplFuncMap)
|
||||
files := ReadDir("views", func(name string) bool {
|
||||
if name == ".DS_Store" {
|
||||
return true
|
||||
}
|
||||
router.SetHTMLTemplate(tmpl)
|
||||
} else {
|
||||
return false
|
||||
})
|
||||
_, err := Tmpl.ParseFiles(files...)
|
||||
if err != nil {
|
||||
logd.Fatal(err)
|
||||
}
|
||||
// 开启静态文件
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="main">
|
||||
{{if .Profile}}{{template "admin-profile" .}}{{else if .Post}}{{template "admin-post" .}}{{else if .Posts}}{{template "admin-posts" .}}{{else if .Series}}{{template "admin-series" .}}{{else if .Serie}}{{template "admin-serie" .}}{{else if .Tags}}{{template "admin-tags" .}}{{else if .General}}{{template "admin-general" .}}{{else if .Discussion}}{{template "admin-discussion" .}}{{else if .Draft}}{{template "admin-draft" .}}{{else if .Trash}}{{template "admin-trash" .}}{{end}}
|
||||
{{.LayoutContent}}
|
||||
</div>
|
||||
<div class="typecho-foot" role="contentinfo">
|
||||
<div class="copyright">
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang="zh-cn"><head><meta charset="utf-8"><meta content="width=device-width,minimum-scale=1.0" name="viewport"><meta name="format-detection" content="telephone=no"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="referrer" content="always"><title>{{.Title}}</title><script>!function(n,t){function e(){o("nls",1)}function c(){t.documentElement.style.display="none",u(),location.reload()}function r(n){var t="";try{t=f[n]||"",t.length<99&&c()}catch(e){u()}return t}function i(n,t){try{f[n]=t,t!==f[n]&&u()}catch(e){u()}}function o(n,e){var c=999;e||(c=-1),c=new Date(+new Date+86400000*c).toGMTString();var r=n+"="+e+";path=/;secure;expires="+c;t.cookie=r}function a(n){var e=t.getElementById(n).innerHTML;i(n,e)}function l(e,c){var i=r(e),o=t.createElement(c?"script":"style");return n.execScript&&c?n.execScript(i):(o.innerHTML=i,void t.head.appendChild(o))}function u(){o("v",0)}var f,h=function(){},d=n.L={h:h,l:h,c:h};try{f=localStorage,d.h=a,d.l=l,d.c=o}catch(p){e()}}(this,document);</script>{{if .Version}}<script>L.c('v', {{.Version}})</script>{{end}}<link rel="apple-touch-icon" href="{{.Favicon}}"><link rel="search" type="application/opensearchdescription+xml" href="//{{.Domain}}/opensearch.xml" title="{{.BTitle}}">{{if .Version}}<style id="blog_css">{{template "blog_css"}}</style><script>L.h('blog_css')</script>{{else}}<script>L.l("blog_css")</script>{{end}}<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="//{{.Domain}}/rss.html"><meta name="description" content="{{.Description}}"><style id="style-1-cropbar-clipper">.en-markup-crop-options{top:18px!important;left:50%!important;margin-left:-100px!important;width:200px!important;border:2px rgba(255,255,255,.38) solid!important;border-radius:4px!important}.en-markup-crop-options div div:first-of-type{margin-left:0!important}</style></head><body><div class="container"><div class="left-col"><div class="intrude-less"><header id="header" class="inner"><div class="profilepic"><a href="/"></a></div><h1><a href="/">{{.BlogName}}</a></h1><p class="subtitle">{{.SubTitle}}</p><nav id="main-nav"><ul><li {{if eq .Path "/"}}class="on" {{end}}><a href="/"><span>首页</span></a></li><li {{if eq .Path "/series.html"}}class="on" {{end}}><a href="/series.html"><span>专题</span></a></li><li {{if eq .Path "/archives.html"}}class="on" {{end}}><a href="/archives.html"><span>归档</span></a></li><li {{if eq .Path "/post/blogroll.html"}}class="on" {{end}}><a href="/post/blogroll.html"><span>友链</span></a></li><li {{if eq .Path "/post/about.html"}}class="on" {{end}}><a href="/post/about.html"><span>关于</span></a></li></ul></nav><nav id="sub-nav"><div class="social"><a target="_blank" class="twitter external" rel="nofollow" href="{{.Twitter}}" title="Twitter">Twitter</a><a target="_blank" class="rss" href="//{{.Domain}}/rss.html" title="RSS 订阅">RSS</a><a class="search" href="/search.html" title="站内搜索">Search</a></div></nav></header></div></div><div class="mid-col"><div class="mid-col-container">{{if .HomePage}} {{template "home" .}} {{else if .ArticlePage}} {{template "article" .}}{{else if .SeriesPage}}{{template "series" .}}{{else if .ArchivesPage}}{{template "archives" .}} {{else if .BlogrollPage}}{{template "blogroll" .}}{{else if .AboutPage}}{{template "about" .}}{{else if .SearchPage}} {{template "search" .}}{{else if .NotFoundPage}}{{template "notfound"}} {{end}}</div><footer id=footer class=inner>© {{.CopyYear}} - {{.BTitle}} - <a target="_blank" rel="nofollow designer" class="external beian" href="http://www.miitbeian.gov.cn/">{{.BeiAn}}</a><br>Powered by <a target=_blank href="//github.com/eiblog/eiblog">Eiblog</a> & <a target=_blank rel="nofollow designer" class=external href="//imququ.com">JerryQu</a></footer></div></div><input type=hidden id=CURRENT_PAGE value="{{.CurrentPage}}"><input type=hidden id=CDN_DOMAIN value="{{.Static}}">{{if .Version}}<script id="ana_js">{{template "ana_js"}}</script><script>L.h('ana_js')</script>{{else}}<script>L.l('ana_js', 1)</script>{{end}}{{if .Version}}<script id="jq_js">{{template "jq_js"}}</script><script>L.h('jq_js')</script>{{else}}<script>L.l('jq_js', 1)</script>{{end}}{{if .Version}}<script id="hl_js">{{template "hl_js"}}</script><script>L.h('hl_js')</script>{{else}}<script>L.l('hl_js', 1)</script>{{end}}{{if .Version}}<script id="blog_js">{{template "blog_js"}}</script><script>L.h('blog_js')</script>{{else}}<script>L.l('blog_js', 1)</script>{{end}}</body></html>
|
||||
<!DOCTYPE html><html lang="zh-cn"><head><meta charset="utf-8"><meta content="width=device-width,minimum-scale=1.0" name="viewport"><meta name="format-detection" content="telephone=no"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="referrer" content="always"><title>{{.Title}}</title><script>!function(n,t){function e(){o("nls",1)}function c(){t.documentElement.style.display="none",u(),location.reload()}function r(n){var t="";try{t=f[n]||"",t.length<99&&c()}catch(e){u()}return t}function i(n,t){try{f[n]=t,t!==f[n]&&u()}catch(e){u()}}function o(n,e){var c=999;e||(c=-1),c=new Date(+new Date+86400000*c).toGMTString();var r=n+"="+e+";path=/;secure;expires="+c;t.cookie=r}function a(n){var e=t.getElementById(n).innerHTML;i(n,e)}function l(e,c){var i=r(e),o=t.createElement(c?"script":"style");return n.execScript&&c?n.execScript(i):(o.innerHTML=i,void t.head.appendChild(o))}function u(){o("v",0)}var f,h=function(){},d=n.L={h:h,l:h,c:h};try{f=localStorage,d.h=a,d.l=l,d.c=o}catch(p){e()}}(this,document);</script>{{if .Version}}<script>L.c('v', {{.Version}})</script>{{end}}<link rel="apple-touch-icon" href="{{.Favicon}}"><link rel="search" type="application/opensearchdescription+xml" href="//{{.Domain}}/opensearch.xml" title="{{.BTitle}}">{{if .Version}}<style id="blog_css">{{template "blog_css"}}</style><script>L.h('blog_css')</script>{{else}}<script>L.l("blog_css")</script>{{end}}<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="//{{.Domain}}/rss.html"><meta name="description" content="{{.Description}}"><style id="style-1-cropbar-clipper">.en-markup-crop-options{top:18px!important;left:50%!important;margin-left:-100px!important;width:200px!important;border:2px rgba(255,255,255,.38) solid!important;border-radius:4px!important}.en-markup-crop-options div div:first-of-type{margin-left:0!important}</style></head><body><div class="container"><div class="left-col"><div class="intrude-less"><header id="header" class="inner"><div class="profilepic"><a href="/"></a></div><h1><a href="/">{{.BlogName}}</a></h1><p class="subtitle">{{.SubTitle}}</p><nav id="main-nav"><ul><li {{if eq .Path "/"}}class="on" {{end}}><a href="/"><span>首页</span></a></li><li {{if eq .Path "/series.html"}}class="on" {{end}}><a href="/series.html"><span>专题</span></a></li><li {{if eq .Path "/archives.html"}}class="on" {{end}}><a href="/archives.html"><span>归档</span></a></li><li {{if eq .Path "/post/blogroll.html"}}class="on" {{end}}><a href="/post/blogroll.html"><span>友链</span></a></li><li {{if eq .Path "/post/about.html"}}class="on" {{end}}><a href="/post/about.html"><span>关于</span></a></li></ul></nav><nav id="sub-nav"><div class="social"><a target="_blank" class="twitter external" rel="nofollow" href="{{.Twitter}}" title="Twitter">Twitter</a><a target="_blank" class="rss" href="//{{.Domain}}/rss.html" title="RSS 订阅">RSS</a><a class="search" href="/search.html" title="站内搜索">Search</a></div></nav></header></div></div><div class="mid-col"><div class="mid-col-container">{{.LayoutContent}}</div><footer id=footer class=inner>© {{.CopyYear}} - {{.BTitle}} - <a target="_blank" rel="nofollow designer" class="external beian" href="http://www.miitbeian.gov.cn/">{{.BeiAn}}</a><br>Powered by <a target=_blank href="//github.com/eiblog/eiblog">Eiblog</a> & <a target=_blank rel="nofollow designer" class=external href="//imququ.com">JerryQu</a></footer></div></div><input type=hidden id=CURRENT_PAGE value="{{.CurrentPage}}"><input type=hidden id=CDN_DOMAIN value="{{.Static}}">{{if .Version}}<script id="ana_js">{{template "ana_js"}}</script><script>L.h('ana_js')</script>{{else}}<script>L.l('ana_js', 1)</script>{{end}}{{if .Version}}<script id="jq_js">{{template "jq_js"}}</script><script>L.h('jq_js')</script>{{else}}<script>L.l('jq_js', 1)</script>{{end}}{{if .Version}}<script id="hl_js">{{template "hl_js"}}</script><script>L.h('hl_js')</script>{{else}}<script>L.l('hl_js', 1)</script>{{end}}{{if .Version}}<script id="blog_js">{{template "blog_js"}}</script><script>L.h('blog_js')</script>{{else}}<script>L.l('blog_js', 1)</script>{{end}}</body></html>
|
||||
|
||||
Reference in New Issue
Block a user