{{str2html .Content.Content}}
43 |├── .gitignore ├── README.md ├── conf └── app.conf ├── controllers ├── blog.go ├── default.go └── editor.go ├── db └── mongodb.go ├── main.go ├── models └── blog.go ├── routers └── router.go ├── static ├── css │ ├── index.css │ ├── main.css │ └── simplemde.min.css └── js │ ├── reload.min.js │ └── simplemde.min.js ├── tests └── default_test.go ├── utils └── utils.go └── views ├── detail.html ├── editor.html ├── home.html └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # blog 2 | Build a blog with Beego MongoDB and Markdown 3 | 4 | Check the details 5 | 6 | [使用beego框架开发个人博客(一)](https://github.com/coderminer/blog/wiki/%E4%BD%BF%E7%94%A8beego%E6%A1%86%E6%9E%B6%E5%BC%80%E5%8F%91%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E4%B8%80)-%E5%88%9D%E5%A7%8B%E5%8C%96markdown%E7%BC%96%E8%BE%91%E5%99%A8) 7 | [使用beego框架开发个人博客(二)](https://github.com/coderminer/blog/wiki/%E4%BD%BF%E7%94%A8beego%E6%A1%86%E6%9E%B6%E5%BC%80%E5%8F%91%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E4%BA%8C)) 8 | [使用beego框架开发个人博客(三)](https://github.com/coderminer/blog/wiki/%E4%BD%BF%E7%94%A8beego%E6%A1%86%E6%9E%B6%E5%BC%80%E5%8F%91%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2(%E4%B8%89)) -------------------------------------------------------------------------------- /conf/app.conf: -------------------------------------------------------------------------------- 1 | appname = blog 2 | httpport = 8080 3 | runmode = dev 4 | -------------------------------------------------------------------------------- /controllers/blog.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/coderminer/blog/models" 5 | 6 | "github.com/astaxie/beego" 7 | ) 8 | 9 | type BlogController struct { 10 | beego.Controller 11 | } 12 | 13 | func (this *BlogController) Get() { 14 | blogs, err := models.NewBlog().GetAllBlogs(0) 15 | if err == nil { 16 | this.Data["Blogs"] = blogs 17 | } 18 | 19 | this.TplName = "index.html" 20 | } 21 | 22 | func (this *BlogController) Detail() { 23 | id := this.Ctx.Input.Param(":id") 24 | data, err := models.NewBlog().GetBlogById(id) 25 | if err == nil { 26 | this.Data["Content"] = data 27 | } else { 28 | this.Abort("404") 29 | } 30 | 31 | this.TplName = "detail.html" 32 | } 33 | -------------------------------------------------------------------------------- /controllers/default.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "github.com/astaxie/beego" 5 | ) 6 | 7 | type MainController struct { 8 | beego.Controller 9 | } 10 | 11 | func (c *MainController) Get() { 12 | c.Data["Website"] = "beego.me" 13 | c.Data["Email"] = "astaxie@gmail.com" 14 | c.TplName = "home.html" 15 | } 16 | -------------------------------------------------------------------------------- /controllers/editor.go: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | "time" 7 | 8 | "github.com/astaxie/beego" 9 | "github.com/coderminer/blog/models" 10 | "github.com/coderminer/blog/utils" 11 | "github.com/globalsign/mgo/bson" 12 | stripmd "github.com/writeas/go-strip-markdown" 13 | ) 14 | 15 | type EditorController struct { 16 | beego.Controller 17 | } 18 | 19 | type BlogData struct { 20 | Title string `json:"title"` 21 | Origin string `json:"origin"` 22 | Content string `json:"content"` 23 | } 24 | 25 | func (this *EditorController) Get() { 26 | this.TplName = "editor.html" 27 | } 28 | 29 | func (this *EditorController) Post() { 30 | title := this.GetString("title") 31 | origin := this.GetString("origin") 32 | content := this.GetString("content") 33 | fmt.Println("post data", title, origin, content) 34 | 35 | blog := &models.BlogModel{ 36 | Id: bson.NewObjectId().Hex(), 37 | Title: title, 38 | Original: origin, 39 | Summary: getDes(origin), 40 | Content: content, 41 | Date: time.Now(), 42 | Author: "CoderMiner", 43 | Img: "http://7xplrz.com1.z0.glb.clouddn.com/jianshu/android/133H_1.jpg", 44 | } 45 | 46 | resp := utils.Response{ 47 | Status: 0, 48 | } 49 | defer resp.WriteJson(this.Ctx.ResponseWriter) 50 | 51 | err := blog.PostBlog(blog) 52 | if err != nil { 53 | resp = utils.Response{ 54 | Status: -1, 55 | Msg: "post blog error", 56 | } 57 | } 58 | 59 | } 60 | 61 | func getDes(origin string) string { 62 | original := stripmd.Strip(origin) 63 | des := strings.Replace(original, "\n", "", -1) 64 | desrune := []rune(des) 65 | return string(desrune[:150]) 66 | } 67 | -------------------------------------------------------------------------------- /db/mongodb.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import ( 4 | "log" 5 | "time" 6 | 7 | "github.com/globalsign/mgo" 8 | ) 9 | 10 | const ( 11 | host = "127.0.0.1:27017" 12 | authdb = "admin" 13 | user = "user" 14 | pass = "123456" 15 | timeout = 60 * time.Second 16 | poollimit = 4096 17 | ) 18 | 19 | var globalS *mgo.Session 20 | 21 | func init() { 22 | dialInfo := &mgo.DialInfo{ 23 | Addrs: []string{host}, 24 | Timeout: timeout, 25 | Source: authdb, 26 | Username: user, 27 | Password: pass, 28 | PoolLimit: poollimit, 29 | } 30 | s, err := mgo.DialWithInfo(dialInfo) 31 | if err != nil { 32 | log.Fatal("create session error", err) 33 | } 34 | globalS = s 35 | } 36 | 37 | func connect(db, collection string) (*mgo.Session, *mgo.Collection) { 38 | ms := globalS.Copy() 39 | c := ms.DB(db).C(collection) 40 | return ms, c 41 | } 42 | 43 | func Insert(db, collection string, docs ...interface{}) error { 44 | ms, c := connect(db, collection) 45 | defer ms.Close() 46 | return c.Insert(docs...) 47 | } 48 | 49 | func FindOne(db, collection string, query, selector, result interface{}) error { 50 | ms, c := connect(db, collection) 51 | defer ms.Close() 52 | return c.Find(query).Select(selector).One(result) 53 | } 54 | 55 | func FindAll(db, collection string, query, selector, result interface{}) error { 56 | ms, c := connect(db, collection) 57 | defer ms.Close() 58 | return c.Find(query).Select(selector).All(result) 59 | } 60 | 61 | func FindAllSort(db, collection, sort string, query, selector, result interface{}) error { 62 | ms, c := connect(db, collection) 63 | defer ms.Close() 64 | return c.Find(query).Select(selector).Sort(sort).All(result) 65 | } 66 | 67 | func FindWithPage(db, collection, sort string, page, limit int, query, selector, result interface{}) error { 68 | ms, c := connect(db, collection) 69 | defer ms.Close() 70 | return c.Find(query).Select(selector).Sort(sort).Skip(page * limit).Limit(limit).All(result) 71 | } 72 | 73 | func Update(db, collection string, selector, update interface{}) error { 74 | ms, c := connect(db, collection) 75 | defer ms.Close() 76 | return c.Update(selector, update) 77 | } 78 | 79 | func UpdateAll(db, collection string, selector, update interface{}) error { 80 | ms, c := connect(db, collection) 81 | defer ms.Close() 82 | _, err := c.UpdateAll(selector, update) 83 | return err 84 | } 85 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "github.com/coderminer/blog/routers" 5 | 6 | "github.com/astaxie/beego" 7 | ) 8 | 9 | func main() { 10 | beego.Run() 11 | } 12 | -------------------------------------------------------------------------------- /models/blog.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/globalsign/mgo/bson" 7 | 8 | "github.com/coderminer/blog/db" 9 | ) 10 | 11 | type BlogModel struct { 12 | Id string `bson:"_id"` 13 | Title string `bson:"title"` 14 | Author string `bson:"author"` 15 | Summary string `bson:"summary"` 16 | Original string `bson:"original"` //原始的markdown格式文本 17 | Content string `bson:"content"` //渲染之后的html文本 18 | Date time.Time `bson:"date"` 19 | Tags []TagModel `bson:"tags"` 20 | Img string `bson:"img"` 21 | } 22 | 23 | type TagModel struct { 24 | Id string `bson:"_id"` 25 | Name string `bson:"name"` 26 | } 27 | 28 | const ( 29 | database = "Blog" 30 | collection = "BlogModel" 31 | ) 32 | 33 | func NewBlog() *BlogModel { 34 | return &BlogModel{} 35 | } 36 | 37 | func (b *BlogModel) PostBlog(blog *BlogModel) error { 38 | return db.Insert(database, collection, blog) 39 | } 40 | 41 | func (b *BlogModel) GetAllBlogs(page int) ([]BlogModel, error) { 42 | var blogs []BlogModel 43 | err := db.FindAllSort(database, collection, "-date", nil, nil, &blogs) 44 | return blogs, err 45 | } 46 | 47 | func (b *BlogModel) GetBlogById(id string) (BlogModel, error) { 48 | var blog BlogModel 49 | err := db.FindOne(database, collection, bson.M{"_id": id}, nil, &blog) 50 | return blog, err 51 | } 52 | -------------------------------------------------------------------------------- /routers/router.go: -------------------------------------------------------------------------------- 1 | package routers 2 | 3 | import ( 4 | "github.com/astaxie/beego" 5 | "github.com/coderminer/blog/controllers" 6 | ) 7 | 8 | func init() { 9 | beego.Router("/", &controllers.MainController{}) 10 | 11 | beego.Router("/editor", &controllers.EditorController{}) 12 | beego.Router("/blog", &controllers.BlogController{}) 13 | beego.Router("/blog/:id", &controllers.BlogController{}, "get:Detail") 14 | } 15 | -------------------------------------------------------------------------------- /static/css/index.css: -------------------------------------------------------------------------------- 1 | a,abbr,acronym,address,applet,article,aside,audio,big,blockquote,body,canvas,caption,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,ul,var,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}img{max-width:100%}html{box-sizing:border-box;font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}*,:after,:before{box-sizing:inherit}a{background-color:transparent}a:active,a:hover{outline:0}b,strong{font-weight:700}dfn,em,i{font-style:italic}h1{margin:.67em 0;font-size:2em}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}mark{background-color:#fdffb6}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;color:inherit;font:inherit}button{overflow:visible;border:0}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input:focus{outline:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}legend{padding:0;border:0}textarea{overflow:auto}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}html{overflow-y:scroll;font-size:62.5%;-webkit-tap-highlight-color:transparent}body,html{overflow-x:hidden}body{color:#3c484e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1.5rem;line-height:1.6em;font-weight:400;font-style:normal;letter-spacing:0;text-rendering:optimizeLegibility;background:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-font-feature-settings:"liga" on}::-moz-selection{text-shadow:none;background:#cbeafb}::selection{text-shadow:none;background:#cbeafb}hr{position:relative;display:block;width:100%;margin:2.5em 0 3.5em;padding:0;height:1px;border:0;border-top:1px solid #e3e9ed}audio,canvas,iframe,img,svg,video{vertical-align:middle}fieldset{margin:0;padding:0;border:0}textarea{resize:vertical}blockquote,dl,ol,p,ul{margin:0 0 1.5em}ol,ul{padding-left:1.3em;padding-right:1.5em}ol ol,ol ul,ul ol,ul ul{margin:.5em 0 1em}ul{list-style:disc}ol{list-style:decimal}li{margin:.5em 0;padding-left:.3em;line-height:1.6em}dt{float:left;margin:0 20px 0 0;width:120px;color:#15171a;font-weight:500;text-align:right}dd{margin:0 0 5px;text-align:left}blockquote{margin:1.5em 0;padding:0 1.6em;border-left:.5em solid #e5eff5}blockquote p{margin:.8em 0;font-size:1.2em;font-weight:300}blockquote small{display:inline-block;margin:.8em 0 .8em 1.5em;font-size:.9em;opacity:.8}blockquote small:before{content:"\2014 \00A0"}blockquote cite{font-weight:700}blockquote cite a{font-weight:400}a{color:#26a8ed;text-decoration:none}a:hover{text-decoration:underline}h1,h2,h3,h4,h5,h6{margin-top:0;line-height:1.15;font-weight:700;text-rendering:optimizeLegibility}h1{margin:0 0 .5em;font-size:5rem;font-weight:700}@media(max-width:500px){h1{font-size:2.2rem}}h2{margin:1.5em 0 .5em;font-size:2rem}@media(max-width:500px){h2{font-size:1.8rem}}h3{margin:1.5em 0 .5em;font-size:1.8rem;font-weight:500}@media(max-width:500px){h3{font-size:1.7rem}}h4{margin:1.5em 0 .5em;font-size:1.6rem;font-weight:500}h5,h6{margin:1.5em 0 .5em;font-size:1.4rem;font-weight:500}body{background:#f4f8fb}.img{display:block;width:100%;height:100%;background-position:50%;background-size:cover;border-radius:100%}.hidden{visibility:hidden;position:absolute;text-indent:-9999px}.site-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:100vh}.site-main{z-index:100;-ms-flex-positive:1;flex-grow:1}.outer{position:relative;padding:0 4vw}.inner{margin:0 auto;max-width:1040px;width:100%}@media(min-width:900px){.author-template .post-feed,.home-template .post-feed,.tag-template .post-feed{margin-top:-70px;padding-top:0}.home-template .site-nav{position:relative;top:-70px}}.site-header{position:relative;padding-top:12px;padding-bottom:12px;color:#fff;background:#090a0b no-repeat 50%;background-size:cover}.site-header:before{bottom:0;background:rgba(0,0,0,.18)}.site-header:after,.site-header:before{content:"";position:absolute;top:0;right:0;left:0;z-index:10;display:block}.site-header:after{bottom:auto;height:80px;background:linear-gradient(rgba(0,0,0,.1),transparent)}.site-header.no-cover:after,.site-header.no-cover:before{display:none}.site-header-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;padding:10vw 4vw;min-height:200px;max-height:450px;text-align:center}.site-title{z-index:10;margin:0;padding:0;font-size:3.8rem;font-weight:700}.site-logo{max-height:45px}.site-description{z-index:10;margin:0;padding:5px 0;font-size:2.2rem;font-weight:300;letter-spacing:.5px;opacity:.8}@media(max-width:500px){.site-title{font-size:3rem}.site-description{font-size:1.8rem}}.site-nav{position:relative;z-index:300;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:start;align-items:flex-start;height:40px;font-size:1.2rem}.site-nav,.site-nav-left{display:-ms-flexbox;display:flex;overflow-y:hidden}.site-nav-left{-ms-flex-align:center;align-items:center;overflow-x:auto;-webkit-overflow-scrolling:touch;margin-right:10px;padding-bottom:80px;letter-spacing:.4px;white-space:nowrap;-ms-overflow-scrolling:touch}.site-nav-logo{-ms-flex-negative:0;flex-shrink:0;display:block;margin-right:24px;padding:11px 0;color:#fff;font-size:1.7rem;line-height:1em;font-weight:700;letter-spacing:-.5px}.site-nav-logo:hover{text-decoration:none}.site-nav-logo img{display:block;width:auto;height:21px}.nav{display:-ms-flexbox;display:flex;margin:0 0 0 -12px;padding:0;list-style:none}.nav li{padding:0;text-transform:uppercase}.nav li,.nav li a{display:block;margin:0}.nav li a{padding:10px 12px;color:#fff;opacity:.8}.nav li a:hover{text-decoration:none;opacity:1}.site-nav-right{height:40px}.site-nav-right,.social-links{-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.social-links a:last-of-type{padding-right:20px}.social-link{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin:0;padding:10px;color:#fff;opacity:.8}.social-link:hover{opacity:1}.social-link svg{height:1.8rem;fill:#fff}.social-link-fb svg{height:1.5rem}.social-link-wb svg{height:1.6rem}.social-link-wb svg path{stroke:#fff}.social-link-rss svg{height:1.9rem}.subscribe-button{display:block;padding:4px 10px;border:1px solid #fff;color:#fff;font-size:1.2rem;line-height:1em;border-radius:10px;opacity:.8}.subscribe-button:hover{text-decoration:none;opacity:1}.rss-button{opacity:.8}.rss-button:hover{opacity:1}.rss-button svg{margin-bottom:1px;height:2.1rem;fill:#fff}@media(max-width:700px){.site-header{padding-right:0;padding-left:0}.site-nav-left{margin-right:0;padding-left:4vw}.site-nav-right{display:none}}.post-feed{position:relative;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -20px;padding:40px 0 0}.post-card,.post-feed{display:-ms-flexbox;display:flex}.post-card{-ms-flex:1 1 300px;flex:1 1 300px;-ms-flex-direction:column;flex-direction:column;overflow:hidden;margin:0 20px 40px;min-height:300px;background:#fff 50%;background-size:cover;border-radius:5px;box-shadow:8px 14px 38px rgba(39,44,49,.06),1px 3px 8px rgba(39,44,49,.03);transition:all .5s ease}.post-card:hover{box-shadow:0 0 1px rgba(39,44,49,.1),0 3px 16px rgba(39,44,49,.07);transition:all .3s ease;transform:translate3D(0,-1px,0)}.post-card-image-link{position:relative;display:block;overflow:hidden;border-radius:5px 5px 0 0}.post-card-image{width:auto;height:200px;background:#c5d2d9 no-repeat 50%;background-size:cover}.post-card-content-link{position:relative;display:block;padding:25px 25px 0;color:#15171a}.post-card-content-link:hover{text-decoration:none}.post-card-tags{display:block;margin-bottom:4px;color:#738a94;font-size:1.2rem;line-height:1.15em;font-weight:500;letter-spacing:.5px;text-transform:uppercase}.post-card-title{margin-top:0}.post-card-content{-ms-flex-positive:1;flex-grow:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}.post-card-excerpt{font-family:Georgia,serif}.post-card-meta{padding:0 25px 25px}.author-profile-image{margin-right:5px;width:25px;height:25px;border-radius:100%;object-fit:cover}.post-card-author{font-size:1.3rem;font-weight:500;letter-spacing:.5px;text-transform:uppercase}@media(min-width:795px){.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image){-ms-flex:1 1 100%;flex:1 1 100%;-ms-flex-direction:row;flex-direction:row}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) .post-card-image-link{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;border-radius:5px 0 0 5px}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) .post-card-image{position:absolute;width:100%;height:100%}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) .post-card-content{-ms-flex:0 1 357px;flex:0 1 357px}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) h2{font-size:2.6rem}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) p{font-size:1.8rem;line-height:1.55em}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) .post-card-content-link{padding:30px 40px 0}.home-template .post-feed .post-card:nth-child(6n+1):not(.no-image) .post-card-meta{padding:0 40px 30px}}.home-template .site-header:after{display:none}@media(max-width:650px){.post-feed{padding-top:5vw}.post-card{margin:0 20px 5vw}}.page-template .site-main,.post-template .site-main{padding-bottom:4vw;background:#fff}.post-full{position:relative;z-index:50}.post-full-header{margin:0 auto;padding:6vw 3vw 3vw;max-width:1040px;text-align:center}@media(max-width:500px){.post-full-header{padding:14vw 3vw 10vw}}.post-full-meta{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:#738a94;font-size:1.4rem;font-weight:600;text-transform:uppercase}.post-full-meta-date{color:#3eb0ef}.post-full-title{margin:0;color:#090a0b}.date-divider{display:inline-block;margin:0 6px 1px}.post-full-image{margin:0 -10vw -165px;height:800px;background:#c5d2d9 50%;background-size:cover;border-radius:5px}@media(max-width:1170px){.post-full-image{margin:0 -4vw -100px;height:600px;border-radius:0}}@media(max-width:800px){.post-full-image{height:400px}}.post-full-content{position:relative;margin:0 auto;padding:70px 100px 0;min-height:230px;font-family:Georgia,serif;font-size:2.2rem;line-height:1.6em;background:#fff}@media(max-width:1170px){.post-full-content{padding:5vw 7vw 0}}@media(max-width:800px){.post-full-content{font-size:1.9rem}}.post-full-content:before{left:-5px;transform:rotate(-5deg)}.post-full-content:after,.post-full-content:before{content:"";position:absolute;top:15px;z-index:-1;display:block;width:20px;height:200px;background:rgba(39,44,49,.15);filter:blur(5px)}.post-full-content:after{right:-5px;transform:rotate(5deg)}.no-image .post-full-content{padding-top:0}.no-image .post-full-content:after,.no-image .post-full-content:before{display:none}.kg-card-markdown{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;max-width:920px}.footnotes,.post-full-comments,.post-full-content blockquote,.post-full-content dl,.post-full-content h1,.post-full-content h2,.post-full-content h3,.post-full-content h4,.post-full-content h5,.post-full-content h6,.post-full-content ol,.post-full-content p,.post-full-content pre,.post-full-content ul{min-width:100%}.post-full-content li{word-break:break-word}.post-full-content li p{margin:0}.post-template .kg-card-markdown>p:first-child{font-size:1.25em;line-height:1.5em}.post-full-content a{color:#000;box-shadow:inset 0 -1px 0 #3eb0ef}.post-full-content a:hover{color:#3eb0ef;text-decoration:none}.post-full-content em,.post-full-content strong{color:#090a0b}.post-full-content small{display:inline-block;line-height:1.6em}.post-full-content li:first-child{margin-top:0}.post-full-content img,.post-full-content video{display:block;margin:1.5em auto;max-width:1040px}@media(max-width:1040px){.post-full-content img,.post-full-content video{width:100%}}.post-full-content img[src$="#full"]{max-width:none;width:100vw}.post-full-content img+br+small{display:block;margin-top:-3em;margin-bottom:1.5em}.post-full-content iframe{margin:0 auto}.post-full-content blockquote{margin:0 0 1.5em;padding:0 1.5em;border-left:3px solid #3eb0ef}.post-full-content blockquote p{margin:0 0 1em;color:inherit;font-size:inherit;line-height:inherit;font-style:italic}.post-full-content blockquote p:last-child{margin-bottom:0}.post-full-content code{padding:0 5px 2px;font-size:.8em;line-height:1em;font-weight:400!important;background:#e5eff5;border-radius:3px}.post-full-content pre{overflow-x:auto;margin:1.5em 0 3em;padding:20px;max-width:100%;border:1px solid #000;color:#e5eff5;font-size:1.4rem;line-height:1.5em;background:#0e0f11;border-radius:5px}.post-full-content pre code{padding:0;font-size:inherit;line-height:inherit;background:0 0}.post-full-content pre code *{color:inherit}.post-full-content .fluid-width-video-wrapper{margin:1.5em 0 3em}.post-full-content hr{margin:4vw 0}.post-full-content hr:after{content:"";position:absolute;top:-15px;left:50%;display:block;margin-left:-10px;width:1px;height:30px;background:#e3e9ed;box-shadow:0 0 0 5px #fff;transform:rotate(45deg)}.post-full-content h1,.post-full-content h2,.post-full-content h3,.post-full-content h4,.post-full-content h5,.post-full-content h6{color:#090a0b;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.post-full-content h1{margin:.5em 0 .2em;font-size:4.6rem;font-weight:700}@media(max-width:500px){.post-full-content h1{font-size:2.8rem}}.post-full-content h2{margin:.5em 0 .2em;font-size:3.6rem;font-weight:700}@media(max-width:500px){.post-full-content h2{font-size:2.6rem}}.post-full-content h3{margin:.5em 0 .2em;font-size:2.8rem;font-weight:700}@media(max-width:500px){.post-full-content h3{font-size:2.2rem}}.post-full-content h4{margin:.5em 0 .2em;font-size:2.8rem;font-weight:700}@media(max-width:500px){.post-full-content h4{font-size:2.2rem}}.post-full-content h5{display:block;margin:.5em 0;padding:1em 0 1.5em;border:0;color:#3eb0ef;font-family:Georgia,serif;font-size:3.2rem;line-height:1.35em;text-align:center}@media(min-width:1180px){.post-full-content h5{max-width:1060px;width:100vw}}@media(max-width:500px){.post-full-content h5{padding:0 0 .5em;font-size:2.2rem}}.post-full-content h6{margin:.5em 0 .2em;font-size:2.3rem;font-weight:700}@media(max-width:500px){.post-full-content h6{font-size:2rem}}.footnotes-sep{margin-bottom:30px}.footnotes{font-size:1.5rem}.footnotes p{margin:0}.footnote-backref{color:#3eb0ef!important;font-size:1.2rem;font-weight:700;text-decoration:none!important;box-shadow:none!important}@media(max-width:500px){.post-full-meta{font-size:1.2rem;line-height:1.3em}.post-full-title{font-size:2.9rem}.post-full-image{margin-bottom:4vw;height:350px}.post-full-content{padding:0}.post-full-content:after,.post-full-content:before{display:none}}.post-full-content table{display:inline-block;overflow-x:auto;margin:.5em 0 2.5em;max-width:100%;width:auto;border-spacing:0;border-collapse:collapse;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1.6rem;white-space:nowrap;vertical-align:top;-webkit-overflow-scrolling:touch;background:radial-gradient(ellipse at left,rgba(0,0,0,.2) 0,transparent 75%) 0,radial-gradient(ellipse at right,rgba(0,0,0,.2) 0,transparent 75%) 100%;background-attachment:scroll,scroll;background-size:10px 100%,10px 100%;background-repeat:no-repeat}.post-full-content table td:first-child{background-image:linear-gradient(90deg,#fff 50%,hsla(0,0%,100%,0));background-size:20px 100%;background-repeat:no-repeat}.post-full-content table td:last-child{background-image:linear-gradient(270deg,#fff 50%,hsla(0,0%,100%,0));background-position:100% 0;background-size:20px 100%;background-repeat:no-repeat}.post-full-content table th{color:#15171a;font-size:1.2rem;font-weight:700;letter-spacing:.2px;text-align:left;text-transform:uppercase;background-color:#f4f8fb}.post-full-content table td,.post-full-content table th{padding:6px 12px;border:1px solid #e3ecf3}.subscribe-form{margin:1.5em 0;padding:6.5vw 7vw 7vw;border:1px solid #edf4f8;text-align:center;background:#f4f8fb;border-radius:7px}.subscribe-form-title{margin:0 0 3px;padding:0;color:#15171a;font-size:3.5rem;line-height:1;font-weight:700}.subscribe-form p{margin-bottom:1em;color:#738a94;font-size:2.2rem;line-height:1.55em;letter-spacing:.2px}.subscribe-form form{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin:0 auto;max-width:420px}.subscribe-form .form-group{-ms-flex-positive:1;flex-grow:1}.subscribe-email{display:block;padding:10px;width:100%;border:1px solid #dae2e7;color:#738a94;font-size:1.8rem;line-height:1em;font-weight:400;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;border-radius:5px;transition:border-color .15s linear;-webkit-appearance:none}.subscribe-form button{display:inline-block;margin:0 0 0 10px;padding:0 20px;height:41px;outline:0;color:#fff;font-size:1.5rem;line-height:37px;font-weight:400;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.1);background:linear-gradient(#4fb7f0,#29a0e0 60%,#29a0e0 90%,#36a6e2);border-radius:5px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.14);-webkit-font-smoothing:subpixel-antialiased}.subscribe-form button:active,.subscribe-form button:focus{background:#209cdf}@media(max-width:650px){.subscribe-form-title{font-size:2.4rem}.subscribe-form p{font-size:1.6rem}}@media(max-width:500px){.subscribe-form form{-ms-flex-direction:column;flex-direction:column}.subscribe-form .form-group{width:100%}.subscribe-form button{margin:10px 0 0;width:100%}}.post-full-footer{-ms-flex-pack:justify;justify-content:space-between;margin:0 auto;padding:3vw 0 6vw;max-width:840px}.author-card,.post-full-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.author-card .author-profile-image{margin-right:15px;width:60px;height:60px}.author-card-name{margin:0 0 2px;padding:0;font-size:2rem}.author-card-name a{color:#15171a;font-weight:700}.author-card-name a:hover{text-decoration:none}.author-card-content p{margin:0;color:#738a94;line-height:1.3em}.post-full-footer-right{-ms-flex-negative:0;flex-shrink:0;margin-left:20px}.author-card-button{display:block;padding:9px 16px;border:1px solid #aebbc1;color:#738a94;font-size:1.2rem;line-height:1;font-weight:500;border-radius:20px;transition:all .2s ease}.author-card-button:hover{border-color:#3eb0ef;color:#3eb0ef;text-decoration:none}.post-full-comments{margin:0 auto;max-width:840px}.read-next-feed{-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -20px;padding:40px 0 0}.read-next-card,.read-next-feed{display:-ms-flexbox;display:flex}.read-next-card{position:relative;-ms-flex:1 1 300px;flex:1 1 300px;-ms-flex-direction:column;flex-direction:column;overflow:hidden;margin:0 20px 40px;padding:25px;color:#fff;background:#15171a 50%;background-size:cover;border-radius:5px;box-shadow:8px 14px 38px rgba(39,44,49,.06),1px 3px 8px rgba(39,44,49,.03)}.read-next-card:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:block;background:linear-gradient(135deg,rgba(0,40,60,.8),rgba(0,20,40,.7));border-radius:5px;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.read-next-card-header{position:relative;z-index:50;padding-top:20px;text-align:center}.read-next-card-header-sitetitle{display:block;font-size:1.3rem;line-height:1.3em;opacity:.8}.read-next-card-header-title{margin:0;padding:0 20px;color:#fff;font-size:3rem;line-height:1.2em;letter-spacing:1px}.read-next-card-header-title a{color:#fff;font-weight:300;text-decoration:none}.read-next-card-header-title a:hover{text-decoration:none}.read-next-divider{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;height:80px}.read-next-divider svg{width:40px;fill:transparent;stroke:#fff;stroke-width:.5px;stroke-opacity:.65}.read-next-card-content{position:relative;z-index:50;-ms-flex-positive:1;flex-grow:1;display:-ms-flexbox;display:flex;font-size:1.7rem}.read-next-card-content ul{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:0 auto;padding:0;text-align:center;list-style:none}.read-next-card-content li{margin:0;padding:0;font-size:1.6rem;line-height:1.25em;font-weight:200;letter-spacing:-.5px}.read-next-card-content li a{display:block;padding:20px 0;border-bottom:1px solid hsla(0,0%,100%,.3);color:#fff;font-weight:500;vertical-align:top;transition:opacity .3s ease}.read-next-card-content li:first-of-type a{padding-top:10px}.read-next-card-content li a:hover{opacity:1}.read-next-card-footer{position:relative;margin:15px 0 3px;text-align:center}.read-next-card-footer a{color:#fff}.floating-header{visibility:hidden;position:fixed;top:0;right:0;left:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:60px;border-bottom:1px solid rgba(0,0,0,.06);background:hsla(0,0%,100%,.95);transition:all .5s cubic-bezier(.19,1,.22,1);transform:translate3d(0,-120%,0)}.floating-active{visibility:visible;transition:all .5s cubic-bezier(.22,1,.27,1);transform:translateZ(0)}.floating-header-logo{overflow:hidden;margin:0 0 0 20px;font-size:1.6rem;line-height:1em;letter-spacing:-1px;text-overflow:ellipsis;white-space:nowrap}.floating-header-logo a{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;color:#15171a;line-height:1.1em;font-weight:700}.floating-header-logo a:hover{text-decoration:none}.floating-header-logo img{margin:0 10px 0 0;max-height:20px}.floating-header-divider{margin:0 5px;line-height:1em}.floating-header-title{-ms-flex:1;flex:1;overflow:hidden;margin:0;color:#2e2e2e;font-size:1.6rem;line-height:1.3em;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.floating-header-share{-ms-flex-pack:end;justify-content:flex-end;padding-left:2%;font-size:1.3rem;line-height:1}.floating-header-share,.floating-header-share a{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.floating-header-share a{-ms-flex-pack:center;justify-content:center}.floating-header-share svg{width:auto;height:16px;fill:#fff}.floating-header-share-label{-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-right:10px;color:rgba(0,0,0,.7);font-weight:500}.floating-header-share-label svg{margin:0 5px 0 10px;width:18px;height:18px;stroke:rgba(0,0,0,.7);transform:rotate(90deg)}.floating-header-share-fb,.floating-header-share-tw{display:block;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center;width:60px;height:60px;color:#fff;line-height:48px;text-align:center;transition:all .5s cubic-bezier(.19,1,.22,1)}.floating-header-share-tw{background:#33b1ff}.floating-header-share-fb{background:#005e99}.progress{position:absolute;right:0;bottom:-1px;left:0;width:100%;height:2px;border:0;color:#3eb0ef;background:0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.progress::-webkit-progress-bar{background-color:transparent}.progress::-webkit-progress-value{background-color:#3eb0ef}.progress::-moz-progress-bar{background-color:#3eb0ef}.progress-container{position:absolute;top:0;left:0;display:block;width:100%;height:2px;background-color:transparent}.progress-bar{display:block;width:50%;height:inherit;background-color:#3eb0ef}@media(max-width:900px){.floating-header{height:40px}.floating-header-logo,.floating-header-title{font-size:1.5rem}.floating-header-share-fb,.floating-header-share-tw{width:40px;height:40px;line-height:38px}}@media(max-width:800px){.floating-header-logo{margin-left:10px}.floating-header-logo a{color:#2e2e2e}.floating-header-divider,.floating-header-title{visibility:hidden}}@media(max-width:450px){.floating-header-share-label{display:none}}.site-header-content .author-profile-image{z-index:10;-ms-flex-negative:0;flex-shrink:0;margin:0 0 20px;width:100px;height:100px;box-shadow:0 0 0 6px hsla(0,0%,100%,.1)}.site-header-content .author-bio{z-index:10;-ms-flex-negative:0;flex-shrink:0;margin:5px 0 10px;max-width:600px;font-size:2rem;line-height:1.3em;font-weight:300;letter-spacing:.5px;opacity:.8}.site-header-content .author-meta{z-index:10;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin:0 0 10px;font-family:Georgia,serif;font-style:italic}.site-header-content .author-location svg{height:1.9rem;stroke:#fff}.site-header-content .bull{display:inline-block;margin:0 12px;opacity:.5}.site-header-content .social-link:first-of-type{padding-left:4px}@media(max-width:500px){.site-header-content .author-bio{font-size:1.8rem;line-height:1.15em;letter-spacing:0}.author-location,.author-stats{display:none}}.error-template .site-main{padding:7vw 4vw}.site-nav-center{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}.site-nav-center .site-nav-logo{margin-right:0}.error-message{text-align:center}.error-code{margin:0;font-size:12vw;line-height:1em;letter-spacing:-5px;opacity:.3}.error-description{margin:0;color:#738a94;font-size:3rem;line-height:1.3em;font-weight:400}@media(max-width:800px){.error-description{margin:5px 0 0;font-size:1.8rem}}.error-link{display:inline-block;margin-top:5px}.error-template .post-feed{padding-top:0}.subscribe-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9000;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background:rgba(0,25,40,.97);opacity:0;transition:opacity .2s ease-in;pointer-events:none;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.subscribe-overlay:target{opacity:1;pointer-events:auto}.subscribe-overlay-content{position:relative;z-index:9999;margin:0 0 5vw;padding:4vw;color:#fff;text-align:center}.subscribe-overlay-logo{position:fixed;top:23px;left:30px;height:30px}.subscribe-overlay-title{display:inline-block;margin:0 0 10px;font-size:6rem;line-height:1.15em}.subscribe-overlay-description{margin:0 auto 50px;max-width:650px;font-family:Georgia,serif;font-size:3rem;line-height:1.3em;font-weight:300;opacity:.8}.subscribe-overlay form{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin:0 auto;max-width:500px}.subscribe-overlay .form-group{-ms-flex-positive:1;flex-grow:1}.subscribe-overlay .subscribe-email{display:block;padding:14px 20px;width:100%;border:0;color:#738a94;font-size:2rem;line-height:1em;font-weight:400;letter-spacing:.5px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;border-radius:8px;transition:border-color .15s linear;-webkit-appearance:none}.subscribe-email:focus{outline:0;border-color:#becdd5}.subscribe-overlay button{display:inline-block;margin:0 0 0 15px;padding:0 25px;height:52px;outline:0;color:#fff;font-size:1.7rem;line-height:37px;font-weight:400;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,.1);background:linear-gradient(#4fb7f0,#29a0e0 60%,#29a0e0 90%,#36a6e2);border-radius:8px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.14);-webkit-font-smoothing:subpixel-antialiased}.subscribe-overlay button:active,.subscribe-overlay button:focus{background:#209cdf}.subscribe-overlay-close{position:absolute;top:0;right:0;bottom:0;left:0;display:block}.subscribe-overlay-close:before{transform:rotate(45deg)}.subscribe-overlay-close:after,.subscribe-overlay-close:before{content:"";position:absolute;top:40px;right:25px;display:block;width:30px;height:2px;background:#fff;opacity:.8}.subscribe-overlay-close:after{transform:rotate(-45deg)}.subscribe-overlay-close:hover{cursor:default}.site-footer{position:relative;padding-top:20px;padding-bottom:60px;color:#fff;background:#000}.site-footer-content{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;font-size:1.3rem}.site-footer-content,.site-footer-content a{color:hsla(0,0%,100%,.7)}.site-footer-content a:hover{color:#fff;text-decoration:none}.site-footer-nav{display:-ms-flexbox;display:flex}.site-footer-nav a{position:relative;margin-left:20px}.site-footer-nav a:before{content:"";position:absolute;top:11px;left:-11px;display:block;width:2px;height:2px;background:#fff;border-radius:100%}.site-footer-nav a:first-of-type:before{display:none}@media(max-width:650px){.site-footer-content{-ms-flex-direction:column;flex-direction:column}.site-footer-nav a:first-child{margin-left:0}} -------------------------------------------------------------------------------- /static/css/main.css: -------------------------------------------------------------------------------- 1 | /*==================================================== 2 | Importing bootstrap less files 3 | ====================================================*/ 4 | /*==================================================== 5 | COLOR VARIABLE FOR THEME 6 | ====================================================*/ 7 | /* common */ 8 | /*==================================================== 9 | common styles 10 | ====================================================*/ 11 | html, 12 | body { 13 | color: #505050; 14 | line-height: 1.75em; 15 | background: #ebebeb; 16 | position: relative; 17 | font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; 18 | } 19 | h1, 20 | h2, 21 | h3, 22 | h4, 23 | h5, 24 | h6 { 25 | font-weight: 400; 26 | color: #303030; 27 | } 28 | h1 { 29 | font-size: 3em; 30 | } 31 | h2 { 32 | font-size: 2.5em; 33 | } 34 | h3 { 35 | font-size: 2em; 36 | } 37 | h4 { 38 | font-size: 1.5em; 39 | } 40 | h5 { 41 | font-size: 1em; 42 | } 43 | h6 { 44 | font-size: 0.75em; 45 | } 46 | a { 47 | color: #e67e22; 48 | outline: none; 49 | } 50 | a:hover { 51 | color: #e67e22; 52 | } 53 | a:active, 54 | a:focus, 55 | a img { 56 | outline: none; 57 | } 58 | .btn { 59 | padding: 7px 14px; 60 | border-radius: 2px; 61 | } 62 | .btn-default { 63 | border: 1px solid #e67e22; 64 | background: #e67e22; 65 | color: #ffffff; 66 | -webkit-transition: all 0.2s ease-in-out; 67 | -o-transition: all 0.2s ease-in-out; 68 | transition: all 0.2s ease-in-out; 69 | } 70 | .btn-default:hover { 71 | border: 1px solid #303030; 72 | background: #303030; 73 | color: #ffffff; 74 | } 75 | .btn-default:focus { 76 | outline: none; 77 | } 78 | .btn-default[disabled] { 79 | border: 1px solid #303030; 80 | background: #303030; 81 | color: #ffffff; 82 | } 83 | input[type="search"], 84 | input[type="text"], 85 | input[type="url"], 86 | input[type="email"], 87 | textarea { 88 | padding: 7px 7px; 89 | border: 1px solid #ebebeb; 90 | border-radius: 2px; 91 | -webkit-transition: all 0.2s; 92 | -o-transition: all 0.2s; 93 | transition: all 0.2s; 94 | } 95 | input[type="search"]:focus, 96 | input[type="text"]:focus, 97 | input[type="url"]:focus, 98 | input[type="email"]:focus, 99 | textarea:focus { 100 | border: 1px solid #e67e22; 101 | outline: none; 102 | } 103 | blockquote { 104 | border-left: 4px solid #e67e22; 105 | } 106 | pre { 107 | padding: 0; 108 | background: none; 109 | border: none; 110 | } 111 | ::-moz-selection { 112 | color: #ffffff; 113 | background: #e67e22; 114 | text-shadow: none; 115 | } 116 | ::selection { 117 | color: #ffffff; 118 | background: #e67e22; 119 | text-shadow: none; 120 | } 121 | /* header */ 122 | /*==================================================== 123 | header 124 | ====================================================*/ 125 | .main-header { 126 | text-align: center; 127 | padding: 42px 0; 128 | background: #fff; 129 | } 130 | .main-header .branding { 131 | font-size: 3.5em; 132 | color: #303030; 133 | } 134 | .main-header .branding:hover { 135 | text-decoration: none; 136 | } 137 | .main-header .branding img { 138 | max-width: 100%; 139 | } 140 | .home-template .main-header { 141 | padding-top: 62px; 142 | padding-bottom: 62px; 143 | background-repeat: no-repeat; 144 | background-position: center 20%; 145 | -webkit-background-size: cover; 146 | background-size: cover; 147 | } 148 | /* main-navigation */ 149 | .main-navigation { 150 | text-align: center; 151 | background: #333; 152 | margin-bottom: 35px; 153 | border-bottom: 2px solid #e1e1e1; 154 | } 155 | .main-navigation .menu { 156 | padding: 0; 157 | margin: 0; 158 | } 159 | .main-navigation .menu li { 160 | list-style: none; 161 | display: inline-block; 162 | position: relative; 163 | } 164 | .main-navigation .menu li.nav-current { 165 | border-bottom: 2px solid #e67e22; 166 | margin-bottom: -2px; 167 | } 168 | .main-navigation .menu li a { 169 | color: #eee; 170 | line-height: 4em; 171 | display: block; 172 | padding: 0 21px; 173 | } 174 | .main-navigation .menu li:hover > a { 175 | color: #fff; 176 | text-decoration: none; 177 | } 178 | .main-navigation .menu li ul { 179 | visibility: hidden; 180 | background: #ffffff; 181 | text-align: left; 182 | padding: 7px 0px; 183 | margin: 0; 184 | position: absolute; 185 | left: 0; 186 | top: 120%; 187 | width: 200px; 188 | z-index: 999; 189 | opacity: 0; 190 | filter: alpha(opacity=0); 191 | -webkit-transition: all 0.2s ease; 192 | -o-transition: all 0.2s ease; 193 | transition: all 0.2s ease; 194 | } 195 | .main-navigation .menu li ul li { 196 | display: block; 197 | margin: 0; 198 | } 199 | .main-navigation .menu li ul li a { 200 | line-height: 2.5em; 201 | color: #505050; 202 | } 203 | .main-navigation .menu li ul:hover > a { 204 | color: #e67e22; 205 | } 206 | .main-navigation .menu li:hover ul { 207 | visibility: visible; 208 | opacity: 1; 209 | filter: alpha(opacity=100); 210 | top: 100%; 211 | } 212 | @media (max-width: 767px) { 213 | .main-navigation { 214 | text-align: left; 215 | } 216 | .main-navigation .menu li { 217 | display: block; 218 | } 219 | .main-navigation .menu li:hover > a { 220 | color: #e67e22; 221 | text-decoration: none; 222 | } 223 | .main-navigation .menu li ul { 224 | visibility: visible; 225 | padding: 0px 0px 0px 20px; 226 | margin: 0; 227 | position: relative; 228 | top: 0; 229 | width: 100%; 230 | opacity: 1; 231 | filter: alpha(opacity=100); 232 | } 233 | } 234 | /* navbar */ 235 | .navbar-header { 236 | text-align: center; 237 | } 238 | .navbar-header i { 239 | height: 56px; 240 | line-height: 56px; 241 | font-size: 2em; 242 | cursor: pointer; 243 | } 244 | @media (min-width: 768px) { 245 | .nav-toggle-button { 246 | display: none; 247 | } 248 | } 249 | /* post */ 250 | /*==================================================== 251 | main post area 252 | ====================================================*/ 253 | .post { 254 | padding: 35px; 255 | background: #ffffff; 256 | margin-bottom: 35px; 257 | position: relative; 258 | overflow: hidden; 259 | } 260 | .post .featured { 261 | position: absolute; 262 | background: #e67e22; 263 | color: #ffffff; 264 | text-align: center; 265 | top: -12px; 266 | right: -32px; 267 | width: 80px; 268 | height: 40px; 269 | line-height: 54px; 270 | -webkit-transform: rotate(45deg); 271 | -ms-transform: rotate(45deg); 272 | -o-transform: rotate(45deg); 273 | transform: rotate(45deg); 274 | } 275 | .post .featured i { 276 | -webkit-transform: rotate(-45deg); 277 | -ms-transform: rotate(-45deg); 278 | -o-transform: rotate(-45deg); 279 | transform: rotate(-45deg); 280 | } 281 | .post .post-head { 282 | text-align: center; 283 | } 284 | .post .post-head .post-title { 285 | margin: 0; 286 | font-size: 2.5em; 287 | line-height: 1em; 288 | } 289 | .post .post-head .post-title a { 290 | color: #303030; 291 | } 292 | .post .post-head .post-title a:hover, 293 | .post .post-head .post-title a:focus { 294 | text-decoration: none; 295 | } 296 | .post .post-head .post-meta { 297 | color: #959595; 298 | margin: 14px 0 0px; 299 | } 300 | .post .post-head .post-meta span { 301 | margin: 0px 7px; 302 | white-space: nowrap; 303 | } 304 | .post .featured-media { 305 | margin-top: 30px; 306 | overflow: hidden; 307 | } 308 | .post .featured-media img { 309 | width: 100%; 310 | } 311 | .post .post-content { 312 | margin: 30px 0; 313 | } 314 | .post .post-footer { 315 | margin-top: 30px; 316 | border-top: 1px solid #ebebeb; 317 | padding: 21px 0 0; 318 | } 319 | .post .post-footer .tag-list { 320 | color: #959595; 321 | line-height: 28px; 322 | } 323 | .post .post-footer .tag-list a { 324 | color: #959595; 325 | margin-left: 7px; 326 | } 327 | .post .post-footer .tag-list a:hover { 328 | color: #e67e22; 329 | } 330 | /* post content */ 331 | /*==================================================== 332 | main post content 333 | ====================================================*/ 334 | .post-content { 335 | font: 400 18px/1.62 "Georgia", "Xin Gothic", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei", sans-serif; 336 | color: #444443; 337 | } 338 | .post-content h1, 339 | .post-content h2, 340 | .post-content h3, 341 | .post-content h4, 342 | .post-content h5, 343 | .post-content h6 { 344 | font-family: "Georgia", "Xin Gothic", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei", "SimSun", sans-serif; 345 | color: #222223; 346 | } 347 | .post-content h1 { 348 | font-size: 1.8em; 349 | margin: 0.67em 0; 350 | } 351 | .post-content > h1 { 352 | margin-top: 0; 353 | font-size: 2em; 354 | } 355 | .post-content h2 { 356 | font-size: 1.5em; 357 | margin: 0.83em 0; 358 | } 359 | .post-content h3 { 360 | font-size: 1.17em; 361 | margin: 1em 0; 362 | } 363 | .post-content h4, 364 | .post-content h5, 365 | .post-content h6 { 366 | font-size: 1em; 367 | margin: 1.6em 0 1em 0; 368 | } 369 | .post-content h6 { 370 | font-weight: 500; 371 | } 372 | .post-content p { 373 | margin-top: 0; 374 | margin-bottom: 1.46em; 375 | } 376 | .post-content a { 377 | word-wrap: break-word; 378 | -moz-text-decoration-color: rgba(0, 0, 0, 0.4); 379 | -webkit-text-decoration-color: rgba(0, 0, 0, 0.4); 380 | text-decoration-color: rgba(0, 0, 0, 0.4); 381 | } 382 | .post-content a:hover { 383 | -moz-text-decoration-color: rgba(0, 0, 0, 0.6); 384 | -webkit-text-decoration-color: rgba(0, 0, 0, 0.6); 385 | text-decoration-color: rgba(0, 0, 0, 0.6); 386 | } 387 | .post-content a img { 388 | /* Remove border on IE */ 389 | border: none; 390 | } 391 | .post-content strong, 392 | .post-content b { 393 | font-weight: 700; 394 | color: #222223; 395 | } 396 | .post-content em, 397 | .post-content i { 398 | font-style: italic; 399 | color: #222223; 400 | } 401 | .post-content img { 402 | max-width: 100%; 403 | height: auto; 404 | margin: 0.2em 0; 405 | } 406 | .post-content figure { 407 | position: relative; 408 | clear: both; 409 | outline: 0; 410 | margin: 10px 0 30px; 411 | padding: 0; 412 | min-height: 100px; 413 | } 414 | .post-content figure img { 415 | display: block; 416 | max-width: 100%; 417 | margin: auto auto 4px; 418 | -moz-box-sizing: border-box; 419 | -webkit-box-sizing: border-box; 420 | box-sizing: border-box; 421 | } 422 | .post-content figure figcaption { 423 | position: relative; 424 | width: 100%; 425 | text-align: center; 426 | left: 0; 427 | margin-top: 10px; 428 | font-weight: 400; 429 | font-size: 14px; 430 | color: #666665; 431 | } 432 | .post-content figure figcaption a { 433 | text-decoration: none; 434 | color: #666665; 435 | } 436 | .post-content hr { 437 | display: block; 438 | width: 50%; 439 | height: 1px; 440 | border: 0 none; 441 | border-top: #dededc 1px solid; 442 | margin: 3.2em auto; 443 | padding: 0; 444 | } 445 | .post-content blockquote { 446 | margin: 0 0 1.64em 0; 447 | border-left: 3px solid #e67e22; 448 | padding-left: 12px; 449 | color: #666664; 450 | } 451 | .post-content blockquote a { 452 | color: #666664; 453 | } 454 | .post-content ul, 455 | .post-content ol { 456 | margin: 0 0 24px 6px; 457 | padding-left: 16px; 458 | } 459 | .post-content ul { 460 | list-style-type: square; 461 | } 462 | .post-content ol { 463 | list-style-type: decimal; 464 | } 465 | .post-content li { 466 | margin-bottom: 0.2em; 467 | } 468 | .post-content li ul, 469 | .post-content li ol { 470 | margin-top: 0; 471 | margin-bottom: 0; 472 | margin-left: 14px; 473 | } 474 | .post-content li ul { 475 | list-style-type: disc; 476 | } 477 | .post-content li ul ul { 478 | list-style-type: circle; 479 | } 480 | .post-content li p { 481 | margin: 0.4em 0 0.6em; 482 | } 483 | .post-content .unstyled { 484 | list-style-type: none; 485 | margin: 0; 486 | padding: 0; 487 | } 488 | .post-content code, 489 | .post-content tt { 490 | color: #808080; 491 | font-size: 0.96em; 492 | background-color: #f9f9f7; 493 | padding: 1px 2px; 494 | border: 1px solid #dadada; 495 | border-radius: 3px; 496 | font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 497 | word-wrap: break-word; 498 | } 499 | .post-content pre { 500 | margin: 1.64em 0; 501 | padding: 7px; 502 | border: none; 503 | border-left: 3px solid #dadada; 504 | padding-left: 10px; 505 | overflow: auto; 506 | line-height: 1.5; 507 | font-size: 0.96em; 508 | font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 509 | color: #4c4c4c; 510 | background-color: #f9f9f7; 511 | } 512 | .post-content pre code, 513 | .post-content pre tt { 514 | color: #4c4c4c; 515 | border: none; 516 | background: none; 517 | padding: 0; 518 | } 519 | .post-content table { 520 | width: 100%; 521 | max-width: 100%; 522 | border-collapse: collapse; 523 | border-spacing: 0; 524 | margin-bottom: 1.5em; 525 | font-size: 0.96em; 526 | -moz-box-sizing: border-box; 527 | -webkit-box-sizing: border-box; 528 | box-sizing: border-box; 529 | } 530 | .post-content th, 531 | .post-content td { 532 | text-align: left; 533 | padding: 4px 8px 4px 10px; 534 | border: 1px solid #dadada; 535 | } 536 | .post-content td { 537 | vertical-align: top; 538 | } 539 | .post-content tr:nth-child(even) { 540 | background-color: #efefee; 541 | } 542 | .post-content iframe { 543 | display: block; 544 | max-width: 100%; 545 | margin-bottom: 30px; 546 | } 547 | .post-content figure iframe { 548 | margin: auto; 549 | } 550 | .post-content table pre { 551 | margin: 0; 552 | padding: 0; 553 | border: none; 554 | background: none; 555 | } 556 | @media (min-width: 1100px) { 557 | .post-content blockquote { 558 | margin-left: -24px; 559 | padding-left: 20px; 560 | border-width: 4px; 561 | } 562 | .post-content blockquote blockquote { 563 | margin-left: 0; 564 | } 565 | .post-content figure img { 566 | margin: 0 0 4px; 567 | } 568 | .post-content figure figcaption { 569 | position: absolute; 570 | left: -172px; 571 | width: 150px; 572 | top: 0; 573 | text-align: right; 574 | margin-top: 0; 575 | } 576 | .post-content figure figcaption:before { 577 | width: 25%; 578 | margin-left: 75%; 579 | border-top: 1px solid #dededc; 580 | display: block; 581 | content: ""; 582 | margin-bottom: 10px; 583 | } 584 | } 585 | .windows .post-content { 586 | font-size: 16px; 587 | font-family: "Georgia", "SimSun", sans-serif; 588 | } 589 | /* pagination */ 590 | /*==================================================== 591 | pagination 592 | ====================================================*/ 593 | .pagination { 594 | margin: 0 0 35px; 595 | text-align: center; 596 | display: block; 597 | } 598 | .pagination a { 599 | text-align: center; 600 | display: inline-block; 601 | color: #ffffff; 602 | background: #e67e22; 603 | border-radius: 2px; 604 | } 605 | .pagination a a:hover { 606 | background: #505050; 607 | text-decoration: none; 608 | color: #ffffff; 609 | } 610 | .pagination a i { 611 | width: 36px; 612 | height: 36px; 613 | line-height: 36px; 614 | } 615 | .pagination .page-number { 616 | background: #e67e22; 617 | color: #ffffff; 618 | margin: 0 3px; 619 | display: inline-block; 620 | line-height: 36px; 621 | padding: 0 14px; 622 | border-radius: 2px; 623 | } 624 | /* author */ 625 | /*==================================================== 626 | about author and comment 627 | ====================================================*/ 628 | .about-author { 629 | background: #ffffff; 630 | padding: 35px; 631 | margin-bottom: 35px; 632 | } 633 | .about-author .avatar { 634 | width: 100px; 635 | height: 100px; 636 | border-radius: 50%; 637 | } 638 | .about-author .details { 639 | margin-left: 114px; 640 | } 641 | .about-author .author { 642 | font-size: 1.5em; 643 | margin-bottom: 7px; 644 | } 645 | .about-author .author a:hover { 646 | text-decoration: none; 647 | } 648 | .about-author .meta-info { 649 | color: #959595; 650 | margin-bottom: 7px; 651 | } 652 | .about-author .meta-info span { 653 | margin-right: 14px; 654 | white-space: nowrap; 655 | } 656 | .about-author .meta-info span i { 657 | margin-right: 7px; 658 | } 659 | /* prev and next link */ 660 | .prev-next-wrap { 661 | margin-bottom: 35px; 662 | text-align: center; 663 | } 664 | @media (max-width: 767px) { 665 | .prev-next-wrap a { 666 | display: block; 667 | } 668 | } 669 | /* sidebar */ 670 | /*==================================================== 671 | sidebar 672 | ====================================================*/ 673 | .sidebar .widget { 674 | background: #ffffff; 675 | padding: 21px 30px; 676 | } 677 | .main-footer .widget { 678 | padding: 0px 30px; 679 | } 680 | .widget { 681 | margin-bottom: 35px; 682 | } 683 | .widget .title { 684 | margin-top: 0; 685 | padding-bottom: 7px; 686 | border-bottom: 1px solid #ebebeb; 687 | margin-bottom: 21px; 688 | position: relative; 689 | } 690 | .widget .title:after { 691 | content: ""; 692 | width: 90px; 693 | height: 1px; 694 | background: #e67e22; 695 | position: absolute; 696 | left: 0; 697 | bottom: -1px; 698 | } 699 | .widget .recent-post .recent-single-post { 700 | border-bottom: 1px dashed #ebebeb; 701 | padding-bottom: 14px; 702 | margin-bottom: 14px; 703 | } 704 | .widget .recent-post .recent-single-post:last-child { 705 | margin-bottom: 0; 706 | } 707 | .widget .recent-post .recent-single-post .post-title { 708 | color: #505050; 709 | -webkit-transition: all 0.2s ease; 710 | -o-transition: all 0.2s ease; 711 | transition: all 0.2s ease; 712 | } 713 | .widget .recent-post .recent-single-post .post-title:hover { 714 | color: #e67e22; 715 | text-decoration: none; 716 | } 717 | .widget .recent-post .recent-single-post .date { 718 | color: #959595; 719 | } 720 | .widget .tag-cloud a { 721 | border: 1px solid #ebebeb; 722 | padding: 2px 7px; 723 | color: #959595; 724 | line-height: 1.5em; 725 | display: inline-block; 726 | margin: 0 7px 7px 0; 727 | -webkit-transition: all 0.2s ease; 728 | -o-transition: all 0.2s ease; 729 | transition: all 0.2s ease; 730 | } 731 | .widget .tag-cloud a:hover { 732 | color: #ffffff; 733 | background: #e67e22; 734 | border: 1px solid #e67e22; 735 | text-decoration: none; 736 | } 737 | .widget .social { 738 | padding: 0; 739 | margin: 0; 740 | } 741 | .widget .social li { 742 | display: inline-block; 743 | margin: 0 2px 5px 0; 744 | text-align: center; 745 | } 746 | .widget .social li a i { 747 | width: 35px; 748 | height: 35px; 749 | line-height: 35px; 750 | border: 1px solid #ebebeb; 751 | color: #959595; 752 | -webkit-transition: all 0.2s; 753 | -o-transition: all 0.2s; 754 | transition: all 0.2s; 755 | } 756 | .widget .social li:hover i { 757 | color: #ffffff; 758 | background: #e67e22; 759 | border: 1px solid #e67e22; 760 | } 761 | .widget .newsletter .input-group { 762 | margin-bottom: 10px; 763 | display: block; 764 | } 765 | .widget .newsletter .input-group .email, 766 | .widget .newsletter .input-group btn { 767 | width: 100%; 768 | } 769 | .widget .ad { 770 | text-align: center; 771 | } 772 | .widget .ad img { 773 | max-width: 100%; 774 | } 775 | /* cover*/ 776 | /*==================================================== 777 | Tag page & author page cover 778 | ====================================================*/ 779 | .cover { 780 | text-align: center; 781 | background: #ffffff; 782 | padding: 35px; 783 | margin-bottom: 35px; 784 | } 785 | .cover .tag-name { 786 | margin-top: 0; 787 | } 788 | .cover .post-count { 789 | margin-top: 7px; 790 | color: #959595; 791 | } 792 | .cover .avatar { 793 | width: 100px; 794 | height: 100px; 795 | border-radius: 50%; 796 | } 797 | .cover .meta-info { 798 | color: #959595; 799 | } 800 | .cover .meta-info span { 801 | margin: 0 7px; 802 | } 803 | .cover .meta-info span i { 804 | margin-right: 7px; 805 | } 806 | .cover .bio { 807 | margin-top: 7px; 808 | } 809 | /* footer */ 810 | /*==================================================== 811 | footer 812 | ====================================================*/ 813 | .main-footer { 814 | background: #202020; 815 | padding: 35px 0 0; 816 | color: #959595; 817 | } 818 | .main-footer .widget .title { 819 | color: #ffffff; 820 | border-bottom: 1px solid #303030; 821 | } 822 | .main-footer .widget .tag-cloud a { 823 | border: 1px solid #303030; 824 | } 825 | .main-footer .widget .tag-cloud a:hover { 826 | border: 1px solid #e67e22; 827 | } 828 | .main-footer .widget .friend-links a { 829 | border: none; 830 | } 831 | .main-footer .widget .friend-links a:hover { 832 | border: none; 833 | } 834 | .main-footer .widget .friend-links hr { 835 | margin: 1em 0; 836 | border-top: 1px dashed #303030; 837 | } 838 | .main-footer .widget .recent-post .recent-single-post { 839 | border-bottom: 1px dashed #303030; 840 | } 841 | .main-footer .widget .recent-post .recent-single-post .post-title { 842 | color: #959595; 843 | } 844 | .main-footer .widget .recent-post .recent-single-post .post-title:hover { 845 | color: #e67e22; 846 | } 847 | .main-footer .widget .recent-post .recent-single-post .date { 848 | color: #505050; 849 | } 850 | .copyright { 851 | background: #111; 852 | font-size: 13px; 853 | text-align: center; 854 | color: #555555; 855 | padding-top: 28px; 856 | padding-bottom: 28px; 857 | border-top: 1px solid #303030; 858 | } 859 | .copyright span { 860 | margin: 0 .5em; 861 | } 862 | .copyright a { 863 | color: #555555; 864 | } 865 | #back-to-top { 866 | position: fixed; 867 | right: 10px; 868 | bottom: 10px; 869 | background: rgba(230, 126, 34, 0.6); 870 | color: #ffffff; 871 | text-align: center; 872 | border-radius: 2px; 873 | z-index: 1; 874 | display: none; 875 | } 876 | #back-to-top:hover { 877 | background: #e67e22; 878 | } 879 | #back-to-top i { 880 | width: 30px; 881 | height: 30px; 882 | line-height: 30px; 883 | } -------------------------------------------------------------------------------- /static/css/simplemde.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * simplemde v1.11.2 3 | * Copyright Next Step Webs, Inc. 4 | * @link https://github.com/NextStepWebs/simplemde-markdown-editor 5 | * @license MIT 6 | */ 7 | .CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:150px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;margin-top:100px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:150px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)} -------------------------------------------------------------------------------- /static/js/reload.min.js: -------------------------------------------------------------------------------- 1 | function b(a){var c=new WebSocket(a);c.onclose=function(){setTimeout(function(){b(a)},2E3)};c.onmessage=function(){location.reload()}}try{if(window.WebSocket)try{b("ws://localhost:12450/reload")}catch(a){console.error(a)}else console.log("Your browser does not support WebSockets.")}catch(a){console.error("Exception during connecting to Reload:",a)}; 2 | -------------------------------------------------------------------------------- /tests/default_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "net/http" 5 | "net/http/httptest" 6 | "testing" 7 | "runtime" 8 | "path/filepath" 9 | _ "blog/routers" 10 | 11 | "github.com/astaxie/beego" 12 | . "github.com/smartystreets/goconvey/convey" 13 | ) 14 | 15 | func init() { 16 | _, file, _, _ := runtime.Caller(1) 17 | apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator)))) 18 | beego.TestBeegoInit(apppath) 19 | } 20 | 21 | 22 | // TestBeego is a sample to run an endpoint test 23 | func TestBeego(t *testing.T) { 24 | r, _ := http.NewRequest("GET", "/", nil) 25 | w := httptest.NewRecorder() 26 | beego.BeeApp.Handlers.ServeHTTP(w, r) 27 | 28 | beego.Trace("testing", "TestBeego", "Code[%d]\n%s", w.Code, w.Body.String()) 29 | 30 | Convey("Subject: Test Station Endpoint\n", t, func() { 31 | Convey("Status Code Should Be 200", func() { 32 | So(w.Code, ShouldEqual, 200) 33 | }) 34 | Convey("The Result Should Not Be Empty", func() { 35 | So(w.Body.Len(), ShouldBeGreaterThan, 0) 36 | }) 37 | }) 38 | } 39 | 40 | -------------------------------------------------------------------------------- /utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | ) 7 | 8 | type Response struct { 9 | Status int `json:"status"` 10 | Msg string `json:"msg"` 11 | } 12 | 13 | func (resp *Response) WriteJson(w http.ResponseWriter) { 14 | data, err := json.Marshal(resp) 15 | if err != nil { 16 | w.Write([]byte(`{Status:-1}`)) 17 | } else { 18 | w.Write(data) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /views/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |{{str2html .Content.Content}}
43 |