Medium theme
This commit is contained in:
203
app/init.go
203
app/init.go
@ -1,32 +1,32 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/revel/revel"
|
"encoding/json"
|
||||||
. "github.com/leanote/leanote/app/lea"
|
"fmt"
|
||||||
"github.com/leanote/leanote/app/service"
|
|
||||||
"github.com/leanote/leanote/app/db"
|
|
||||||
"github.com/leanote/leanote/app/controllers"
|
"github.com/leanote/leanote/app/controllers"
|
||||||
"github.com/leanote/leanote/app/controllers/admin"
|
"github.com/leanote/leanote/app/controllers/admin"
|
||||||
"github.com/leanote/leanote/app/controllers/member"
|
"github.com/leanote/leanote/app/controllers/member"
|
||||||
|
"github.com/leanote/leanote/app/db"
|
||||||
|
. "github.com/leanote/leanote/app/lea"
|
||||||
_ "github.com/leanote/leanote/app/lea/binder"
|
_ "github.com/leanote/leanote/app/lea/binder"
|
||||||
"github.com/leanote/leanote/app/lea/session"
|
|
||||||
"github.com/leanote/leanote/app/lea/memcache"
|
"github.com/leanote/leanote/app/lea/memcache"
|
||||||
"github.com/leanote/leanote/app/lea/route"
|
"github.com/leanote/leanote/app/lea/route"
|
||||||
"reflect"
|
"github.com/leanote/leanote/app/lea/session"
|
||||||
"fmt"
|
"github.com/leanote/leanote/app/service"
|
||||||
|
"github.com/revel/revel"
|
||||||
"html/template"
|
"html/template"
|
||||||
"math"
|
"math"
|
||||||
"strings"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
"encoding/json"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"reflect"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Filters is the default set of global filters.
|
// Filters is the default set of global filters.
|
||||||
revel.Filters = []revel.Filter{
|
revel.Filters = []revel.Filter{
|
||||||
revel.PanicFilter, // Recover from panics and display an error page instead.
|
revel.PanicFilter, // Recover from panics and display an error page instead.
|
||||||
route.RouterFilter,
|
route.RouterFilter,
|
||||||
// revel.RouterFilter, // Use the routing table to select the right Action
|
// revel.RouterFilter, // Use the routing table to select the right Action
|
||||||
// AuthFilter, // Invoke the action.
|
// AuthFilter, // Invoke the action.
|
||||||
@ -36,31 +36,32 @@ func init() {
|
|||||||
|
|
||||||
// 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到
|
// 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到
|
||||||
// session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web
|
// session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web
|
||||||
session.SessionFilter, // leanote session
|
session.SessionFilter, // leanote session
|
||||||
// session.MSessionFilter, // leanote memcache session
|
// session.MSessionFilter, // leanote memcache session
|
||||||
|
|
||||||
revel.FlashFilter, // Restore and write the flash cookie.
|
revel.FlashFilter, // Restore and write the flash cookie.
|
||||||
revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
|
revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
|
||||||
revel.I18nFilter, // Resolve the requested language
|
revel.I18nFilter, // Resolve the requested language
|
||||||
revel.InterceptorFilter, // Run interceptors around the action.
|
revel.InterceptorFilter, // Run interceptors around the action.
|
||||||
revel.CompressFilter, // Compress the result.
|
revel.CompressFilter, // Compress the result.
|
||||||
revel.ActionInvoker, // Invoke the action.
|
revel.ActionInvoker, // Invoke the action.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//自定义模版函数
|
||||||
revel.TemplateFuncs["raw"] = func(str string) template.HTML {
|
revel.TemplateFuncs["raw"] = func(str string) template.HTML {
|
||||||
return template.HTML(str)
|
return template.HTML(str)
|
||||||
}
|
}
|
||||||
revel.TemplateFuncs["add"] = func(i int) string {
|
revel.TemplateFuncs["add"] = func(i int) string {
|
||||||
i = i + 1;
|
i = i + 1
|
||||||
return fmt.Sprintf("%v", i)
|
return fmt.Sprintf("%v", i)
|
||||||
}
|
}
|
||||||
revel.TemplateFuncs["sub"] = func(i int) int {
|
revel.TemplateFuncs["sub"] = func(i int) int {
|
||||||
i = i - 1;
|
i = i - 1
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
// 增加或减少
|
// 增加或减少
|
||||||
revel.TemplateFuncs["incr"] = func(n, i int) int {
|
revel.TemplateFuncs["incr"] = func(n, i int) int {
|
||||||
n = n + i;
|
n = n + i
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
revel.TemplateFuncs["join"] = func(arr []string) template.HTML {
|
revel.TemplateFuncs["join"] = func(arr []string) template.HTML {
|
||||||
@ -124,62 +125,62 @@ func init() {
|
|||||||
str = tag
|
str = tag
|
||||||
}
|
}
|
||||||
tagStr += str
|
tagStr += str
|
||||||
if i != lenTags - 1 {
|
if i != lenTags-1 {
|
||||||
tagStr += ","
|
tagStr += ","
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return template.HTML(tagStr)
|
return template.HTML(tagStr)
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
|
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
|
||||||
if tags == nil || len(tags) == 0 {
|
if tags == nil || len(tags) == 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
|
||||||
// TODO 这里判断语言, 从语言包中拿
|
|
||||||
tagMap := map[string]string{"red": "红色", "yellow": "黄色", "blue": "蓝色", "green": "绿色"}
|
|
||||||
tagStr := ""
|
|
||||||
lenTags := len(tags)
|
|
||||||
for i, tag := range tags {
|
|
||||||
if text, ok := tagMap[tag]; ok {
|
|
||||||
tagStr += text
|
|
||||||
} else {
|
|
||||||
tagStr += tag
|
|
||||||
}
|
}
|
||||||
if i != lenTags - 1 {
|
// TODO 这里判断语言, 从语言包中拿
|
||||||
tagStr += ","
|
tagMap := map[string]string{"red": "红色", "yellow": "黄色", "blue": "蓝色", "green": "绿色"}
|
||||||
|
tagStr := ""
|
||||||
|
lenTags := len(tags)
|
||||||
|
for i, tag := range tags {
|
||||||
|
if text, ok := tagMap[tag]; ok {
|
||||||
|
tagStr += text
|
||||||
|
} else {
|
||||||
|
tagStr += tag
|
||||||
|
}
|
||||||
|
if i != lenTags - 1 {
|
||||||
|
tagStr += ","
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return template.HTML(tagStr)
|
||||||
}
|
}
|
||||||
return template.HTML(tagStr)
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
revel.TemplateFuncs["li"] = func(a string) string {
|
revel.TemplateFuncs["li"] = func(a string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
// str连接
|
// str连接
|
||||||
revel.TemplateFuncs["urlConcat"] = func(url string, v... interface{}) string {
|
revel.TemplateFuncs["urlConcat"] = func(url string, v ...interface{}) string {
|
||||||
html := ""
|
html := ""
|
||||||
for i := 0; i < len(v); i = i + 2 {
|
for i := 0; i < len(v); i = i + 2 {
|
||||||
item := v[i]
|
item := v[i]
|
||||||
if i+1 == len(v) {
|
if i+1 == len(v) {
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
value := v[i+1]
|
value := v[i+1]
|
||||||
if item != nil && value != nil {
|
if item != nil && value != nil {
|
||||||
keyStr, _ := item.(string)
|
keyStr, _ := item.(string)
|
||||||
valueStr, err := value.(string)
|
valueStr, err := value.(string)
|
||||||
if !err {
|
if !err {
|
||||||
valueInt, _ := value.(int)
|
valueInt, _ := value.(int)
|
||||||
valueStr = strconv.Itoa(valueInt)
|
valueStr = strconv.Itoa(valueInt)
|
||||||
}
|
}
|
||||||
if keyStr != "" && valueStr != "" {
|
if keyStr != "" && valueStr != "" {
|
||||||
s := keyStr + "=" + valueStr
|
s := keyStr + "=" + valueStr
|
||||||
if html != "" {
|
if html != "" {
|
||||||
html += "&" + s
|
html += "&" + s
|
||||||
} else {
|
} else {
|
||||||
html += s
|
html += s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if html != "" {
|
if html != "" {
|
||||||
@ -209,32 +210,32 @@ func init() {
|
|||||||
// 必须要返回HTMLAttr, 返回html, golang 会执行安全检查返回ZgotmplZ
|
// 必须要返回HTMLAttr, 返回html, golang 会执行安全检查返回ZgotmplZ
|
||||||
// sorterI 可能是nil, 所以用interfalce{}来接收
|
// sorterI 可能是nil, 所以用interfalce{}来接收
|
||||||
/*
|
/*
|
||||||
data-url="/adminUser/index"
|
data-url="/adminUser/index"
|
||||||
data-sorter="email"
|
data-sorter="email"
|
||||||
class="th-sortable {{if eq .sorter "email-up"}}th-sort-up{{else}}{{if eq .sorter "email-down"}}th-sort-down{{end}}{{end}}"
|
class="th-sortable {{if eq .sorter "email-up"}}th-sort-up{{else}}{{if eq .sorter "email-down"}}th-sort-down{{end}}{{end}}"
|
||||||
*/
|
*/
|
||||||
revel.TemplateFuncs["sorterTh"] = func(url, sorterField string, sorterI interface{}) template.HTMLAttr {
|
revel.TemplateFuncs["sorterTh"] = func(url, sorterField string, sorterI interface{}) template.HTMLAttr {
|
||||||
sorter := ""
|
sorter := ""
|
||||||
if sorterI != nil {
|
if sorterI != nil {
|
||||||
sorter, _ = sorterI.(string)
|
sorter, _ = sorterI.(string)
|
||||||
}
|
}
|
||||||
html := "data-url=\"" + url + "\" data-sorter=\"" + sorterField + "\"";
|
html := "data-url=\"" + url + "\" data-sorter=\"" + sorterField + "\""
|
||||||
html += " class=\"th-sortable ";
|
html += " class=\"th-sortable "
|
||||||
if sorter == sorterField + "-up" {
|
if sorter == sorterField+"-up" {
|
||||||
html += "th-sort-up\"";
|
html += "th-sort-up\""
|
||||||
} else if(sorter == sorterField + "-down") {
|
} else if sorter == sorterField+"-down" {
|
||||||
html += "th-sort-down";
|
html += "th-sort-down"
|
||||||
}
|
}
|
||||||
html += "\"";
|
html += "\""
|
||||||
return template.HTMLAttr(html)
|
return template.HTMLAttr(html)
|
||||||
}
|
}
|
||||||
|
|
||||||
// pagination
|
// pagination
|
||||||
revel.TemplateFuncs["page"] = func(urlBase string, page, pageSize, count int) template.HTML {
|
revel.TemplateFuncs["page"] = func(urlBase string, page, pageSize, count int) template.HTML {
|
||||||
if count == 0 {
|
if count == 0 {
|
||||||
return "";
|
return ""
|
||||||
}
|
}
|
||||||
totalPage := int(math.Ceil(float64(count)/float64(pageSize)))
|
totalPage := int(math.Ceil(float64(count) / float64(pageSize)))
|
||||||
|
|
||||||
preClass := ""
|
preClass := ""
|
||||||
prePage := page - 1
|
prePage := page - 1
|
||||||
@ -245,7 +246,7 @@ func init() {
|
|||||||
nextPage := page + 1
|
nextPage := page + 1
|
||||||
var preUrl, nextUrl string
|
var preUrl, nextUrl string
|
||||||
|
|
||||||
preUrl = urlBase + "?page=" + strconv.Itoa(prePage)
|
preUrl = urlBase + "?page=" + strconv.Itoa(prePage)
|
||||||
nextUrl = urlBase + "?page=" + strconv.Itoa(nextPage)
|
nextUrl = urlBase + "?page=" + strconv.Itoa(nextPage)
|
||||||
|
|
||||||
// 没有上一页了
|
// 没有上一页了
|
||||||
@ -265,47 +266,47 @@ func init() {
|
|||||||
// http://play.golang.org/p/snygrVpQva
|
// http://play.golang.org/p/snygrVpQva
|
||||||
// http://grokbase.com/t/gg/golang-nuts/142a6dhfh3/go-nuts-text-template-using-comparison-operators-eq-gt-etc-on-non-existent-variable-causes-the-template-to-stop-outputting-but-with-no-error-correct-behaviour
|
// http://grokbase.com/t/gg/golang-nuts/142a6dhfh3/go-nuts-text-template-using-comparison-operators-eq-gt-etc-on-non-existent-variable-causes-the-template-to-stop-outputting-but-with-no-error-correct-behaviour
|
||||||
/*
|
/*
|
||||||
revel.TemplateFuncs["gt"] = func(a1, a2 interface{}) bool {
|
revel.TemplateFuncs["gt"] = func(a1, a2 interface{}) bool {
|
||||||
switch a1.(type) {
|
switch a1.(type) {
|
||||||
case string:
|
|
||||||
switch a2.(type) {
|
|
||||||
case string:
|
case string:
|
||||||
return reflect.ValueOf(a1).String() > reflect.ValueOf(a2).String()
|
switch a2.(type) {
|
||||||
}
|
case string:
|
||||||
case int, int8, int16, int32, int64:
|
return reflect.ValueOf(a1).String() > reflect.ValueOf(a2).String()
|
||||||
switch a2.(type) {
|
}
|
||||||
case int, int8, int16, int32, int64:
|
case int, int8, int16, int32, int64:
|
||||||
return reflect.ValueOf(a1).Int() > reflect.ValueOf(a2).Int()
|
switch a2.(type) {
|
||||||
}
|
case int, int8, int16, int32, int64:
|
||||||
case uint, uint8, uint16, uint32, uint64:
|
return reflect.ValueOf(a1).Int() > reflect.ValueOf(a2).Int()
|
||||||
switch a2.(type) {
|
}
|
||||||
case uint, uint8, uint16, uint32, uint64:
|
case uint, uint8, uint16, uint32, uint64:
|
||||||
return reflect.ValueOf(a1).Uint() > reflect.ValueOf(a2).Uint()
|
switch a2.(type) {
|
||||||
}
|
case uint, uint8, uint16, uint32, uint64:
|
||||||
case float32, float64:
|
return reflect.ValueOf(a1).Uint() > reflect.ValueOf(a2).Uint()
|
||||||
switch a2.(type) {
|
}
|
||||||
case float32, float64:
|
case float32, float64:
|
||||||
return reflect.ValueOf(a1).Float() > reflect.ValueOf(a2).Float()
|
switch a2.(type) {
|
||||||
|
case float32, float64:
|
||||||
|
return reflect.ValueOf(a1).Float() > reflect.ValueOf(a2).Float()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
{{range $i := N 1 10}}
|
{{range $i := N 1 10}}
|
||||||
<div>{{$i}}</div>
|
<div>{{$i}}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
*/
|
*/
|
||||||
revel.TemplateFuncs["N"] = func(start, end int) (stream chan int) {
|
revel.TemplateFuncs["N"] = func(start, end int) (stream chan int) {
|
||||||
stream = make(chan int)
|
stream = make(chan int)
|
||||||
go func() {
|
go func() {
|
||||||
for i := start; i <= end; i++ {
|
for i := start; i <= end; i++ {
|
||||||
stream <- i
|
stream <- i
|
||||||
}
|
}
|
||||||
close(stream)
|
close(stream)
|
||||||
}()
|
}()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// init Email
|
// init Email
|
||||||
|
19
public/blog/themes/medium/404.html
Normal file
19
public/blog/themes/medium/404.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
|
||||||
|
<div id="posts">
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
404 NOT FOUND
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
Sorry, We can't find this page.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
38
public/blog/themes/medium/archive.html
Normal file
38
public/blog/themes/medium/archive.html
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div class="container">
|
||||||
|
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||||
|
</div>
|
||||||
|
<div id="posts">
|
||||||
|
|
||||||
|
<div class="each-post">
|
||||||
|
<ul>
|
||||||
|
{{range $.archives}}
|
||||||
|
<li><span class="archive-year">{{.Year}}</span>
|
||||||
|
<ul>
|
||||||
|
{{range .MonthAchives}}
|
||||||
|
<li>
|
||||||
|
<span class="archive-month">{{.Month}}</span>
|
||||||
|
<ul>
|
||||||
|
{{range .Posts}}
|
||||||
|
<li>
|
||||||
|
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "footer.html" .}}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
42
public/blog/themes/medium/cate.html
Normal file
42
public/blog/themes/medium/cate.html
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div class="container">
|
||||||
|
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||||
|
</div>
|
||||||
|
<div id="posts">
|
||||||
|
{{range $.posts}}
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||||
|
{{.Title}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="created-time">
|
||||||
|
<i class="fa fa-bookmark-o"></i>
|
||||||
|
{{if .Tags}}
|
||||||
|
{{blogTags $ .Tags}}
|
||||||
|
{{else}}
|
||||||
|
无
|
||||||
|
{{end}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
{{.Abstract | raw}}
|
||||||
|
</div>
|
||||||
|
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
<!-- 分页 -->
|
||||||
|
{{template "paging.html" $}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
{{template "highlight.html" $}}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
65
public/blog/themes/medium/footer.html
Normal file
65
public/blog/themes/medium/footer.html
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<div id="footerContainer">
|
||||||
|
{{$userId := $.blogInfo.UserId}}
|
||||||
|
<div class="container" id="footer">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h3>导航</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="{{$.indexUrl}}">主页</a></li>
|
||||||
|
{{range $.cates}}
|
||||||
|
<li>
|
||||||
|
<a href="{{$.cateUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
<!-- 单页 -->
|
||||||
|
{{range $.singles}}
|
||||||
|
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||||
|
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<!-- 归档 -->
|
||||||
|
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||||
|
<a href="{{$.archiveUrl}}">归档</a>
|
||||||
|
</li>
|
||||||
|
<li class="{{if $.curIsTags}}active{{end}}">
|
||||||
|
<a href="{{$.tagsUrl}}">标签</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h3>最近发表</h3>
|
||||||
|
<ul>
|
||||||
|
{{range .recentPosts}}
|
||||||
|
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a></li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h3>友情链接 </h3>
|
||||||
|
<ul>
|
||||||
|
{{if $.themeInfo.FriendLinks}}
|
||||||
|
{{range $.themeInfo.FriendLinks}}
|
||||||
|
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="{{$.jQueryUrl}}"></script>
|
||||||
|
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||||
|
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||||
|
<script>
|
||||||
|
// 搜索
|
||||||
|
function search(e) {
|
||||||
|
var keywords = $("#searchInput").val();
|
||||||
|
if(!keywords) {
|
||||||
|
location.href = "{{$.searchUrl}}";
|
||||||
|
} else {
|
||||||
|
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||||
|
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||||
|
tpl += "</form";
|
||||||
|
$(tpl).submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
122
public/blog/themes/medium/header.html
Normal file
122
public/blog/themes/medium/header.html
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="keywords" content="leanote,leanote.com">
|
||||||
|
<meta name="description" content="leanote, not only a notebook">
|
||||||
|
<meta name="author" content="leanote">
|
||||||
|
|
||||||
|
<title>
|
||||||
|
{{if $.curIsIndex}}
|
||||||
|
{{$.blogInfo.Title}}
|
||||||
|
{{else if $.curIsCate}}
|
||||||
|
分类-{{$.curCateTitle}}
|
||||||
|
{{else if $.curIsSearch}}
|
||||||
|
搜索-{{$.keywords}}
|
||||||
|
{{else if $.curIsTags}}
|
||||||
|
我的标签
|
||||||
|
{{else if $.curIsTagPosts}}
|
||||||
|
标签-{{$.curTag}}
|
||||||
|
{{else if $.curIsPost}}
|
||||||
|
{{$.post.Title}}
|
||||||
|
{{else if $.curIsSingle}}
|
||||||
|
{{$.single.Title}}
|
||||||
|
{{else if $.curIsArchive}}
|
||||||
|
归档
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
</title>
|
||||||
|
<!-- Bootstrap core CSS -->
|
||||||
|
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||||
|
<!-- 字体必须同一域 -->
|
||||||
|
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||||
|
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||||
|
<script>
|
||||||
|
function log(o) {
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="headerAndNav" >
|
||||||
|
<div id="headerContainer" class="container">
|
||||||
|
<!-- 头部可放博客名, 导航 -->
|
||||||
|
<div id="header">
|
||||||
|
|
||||||
|
{{$username := .userInfo.Username}}
|
||||||
|
<h1>
|
||||||
|
<a href="{{$.indexUrl}}" id="logo">
|
||||||
|
{{if $.blogInfo.Logo}}
|
||||||
|
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||||
|
{{else}}
|
||||||
|
{{$.blogInfo.Title | raw}}
|
||||||
|
{{end}}
|
||||||
|
</a>
|
||||||
|
</h1>
|
||||||
|
<div id="blogDesc">
|
||||||
|
{{$.blogInfo.SubTitle | raw}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Static navbar -->
|
||||||
|
<div class="navbar navbar-default">
|
||||||
|
<div class="container">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||||
|
{{if $.blogInfo.Logo}}
|
||||||
|
|
||||||
|
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||||
|
{{else}}
|
||||||
|
{{$.blogInfo.Title | raw}}
|
||||||
|
{{end}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="navbar-collapse collapse">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
|
||||||
|
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||||
|
<!-- 分类页 -->
|
||||||
|
{{range $.cates}}
|
||||||
|
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||||
|
<a href="{{$.cateUrl}}/{{.UrlTitle}}"
|
||||||
|
>{{.Title}}</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
<!-- 单页 -->
|
||||||
|
{{range $.singles}}
|
||||||
|
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||||
|
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<!-- 归档 -->
|
||||||
|
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||||
|
<a href="{{$.archiveUrl}}">归档</a>
|
||||||
|
</li>
|
||||||
|
<li class="{{if $.curIsTags}}active{{end}}">
|
||||||
|
<a href="{{$.tagsUrl}}">标签</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||||
|
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div><!--/.nav-collapse -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
6
public/blog/themes/medium/highlight.html
Normal file
6
public/blog/themes/medium/highlight.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
|
||||||
|
<script src="{{$.prettifyJsUrl}}"></script>
|
||||||
|
<script>
|
||||||
|
$("pre").addClass("prettyprint linenums");
|
||||||
|
prettyPrint();
|
||||||
|
</script>
|
BIN
public/blog/themes/medium/images/leanote-icon.jpg
Normal file
BIN
public/blog/themes/medium/images/leanote-icon.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
public/blog/themes/medium/images/loading-32.gif
Normal file
BIN
public/blog/themes/medium/images/loading-32.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
BIN
public/blog/themes/medium/images/noise.png
Normal file
BIN
public/blog/themes/medium/images/noise.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
public/blog/themes/medium/images/screenshot.png
Normal file
BIN
public/blog/themes/medium/images/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
BIN
public/blog/themes/medium/images/triangle_2x.png
Normal file
BIN
public/blog/themes/medium/images/triangle_2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 629 B |
39
public/blog/themes/medium/index.html
Normal file
39
public/blog/themes/medium/index.html
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
|
||||||
|
<div id="posts">
|
||||||
|
{{range $.posts}}
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||||
|
{{.Title}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="created-time">
|
||||||
|
<i class="fa fa-bookmark-o"></i>
|
||||||
|
{{if .Tags}}
|
||||||
|
{{blogTags $ .Tags}}
|
||||||
|
{{else}}
|
||||||
|
无
|
||||||
|
{{end}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
{{.Abstract | raw}}
|
||||||
|
</div>
|
||||||
|
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
<!-- 分页 -->
|
||||||
|
{{template "paging.html" $}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
{{template "highlight.html" $}}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
1
public/blog/themes/medium/page.html
Normal file
1
public/blog/themes/medium/page.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
aaaaaaaaaaaaaaaaaaa
|
27
public/blog/themes/medium/paging.html
Normal file
27
public/blog/themes/medium/paging.html
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{{if gt $.paging.TotalPage 1}}
|
||||||
|
|
||||||
|
<!-- 上一页 -->
|
||||||
|
{{if gt $.paging.CurPage 1}}
|
||||||
|
{{set . "prePageClass" ""}}
|
||||||
|
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||||
|
{{else}}
|
||||||
|
{{set . "prePageClass" "disabled"}}
|
||||||
|
{{set . "prePageUrl" "#"}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<!-- 下一页 -->
|
||||||
|
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||||
|
{{set . "nextPageClass" ""}}
|
||||||
|
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||||
|
{{else}}
|
||||||
|
{{set . "nextPageClass" "disabled"}}
|
||||||
|
{{set . "nextPageUrl" "#"}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||||
|
<ul class="pager">
|
||||||
|
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||||
|
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{end}}
|
143
public/blog/themes/medium/post.html
Normal file
143
public/blog/themes/medium/post.html
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div id="posts">
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
{{.post.Title}}
|
||||||
|
</div>
|
||||||
|
<div class="created-time">
|
||||||
|
<i class="fa fa-bookmark-o"></i>
|
||||||
|
{{if .post.Tags}}
|
||||||
|
{{blogTags $ .post.Tags}}
|
||||||
|
{{else}}
|
||||||
|
无
|
||||||
|
{{end}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 创建 {{$.post.CreatedTime | datetime}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 仅为移动端 -->
|
||||||
|
<div class="mobile-created-time">
|
||||||
|
{{ if $.blogInfo.UserLogo}}
|
||||||
|
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||||
|
{{end}}
|
||||||
|
{{$.blogInfo.Username}}
|
||||||
|
|
||||||
|
{{if .post.Tags}}
|
||||||
|
|
||||||
|
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||||
|
{{blogTags $ $.post.Tags}}
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="desc {{if $.post.IsMarkdown }}markdown-content{{end}}" id="content">
|
||||||
|
{{if $.post.IsMarkdown }}
|
||||||
|
<div id="markdownContent" style="display: none">
|
||||||
|
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||||
|
<textarea>{{$.post.Content | raw}}</textarea>
|
||||||
|
</div>
|
||||||
|
<div style="padding: 20px; text-align: center">
|
||||||
|
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
{{$.post.Content | raw}}
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pre-next-post">
|
||||||
|
<p>
|
||||||
|
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- share & comment -->
|
||||||
|
{{template "share_comment.html" $}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
{{template "highlight.html" $}}
|
||||||
|
|
||||||
|
<div id="blogNav">
|
||||||
|
<div id="blogNavNav">
|
||||||
|
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||||
|
<span>文档导航</span>
|
||||||
|
</div>
|
||||||
|
<div id="blogNavContent">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 一些在share_comment.js 需要使用的变量 -->
|
||||||
|
<script>
|
||||||
|
var siteUrl = "{{$.siteUrl}}"; // common.js需要
|
||||||
|
// 以下 share_comment.js需要
|
||||||
|
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
|
||||||
|
var noteId = "{{$.post.NoteId}}"; //
|
||||||
|
var preLikeNum = +"{{$.post.LikeNum}}";
|
||||||
|
var commentNum = +"{{$.post.CommentNum}}";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 共享与评论css -->
|
||||||
|
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
|
||||||
|
<!-- 一些公用的js -->
|
||||||
|
<script src="{{$.blogCommonJsUrl}}"></script>
|
||||||
|
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
|
||||||
|
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||||
|
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||||
|
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||||
|
<!-- share && comment -->
|
||||||
|
<script src="{{$.shareCommentJsUrl}}"></script>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
markdown
|
||||||
|
调用markdown来解析得到html
|
||||||
|
-->
|
||||||
|
|
||||||
|
{{if $.post.IsMarkdown }}
|
||||||
|
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||||
|
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||||
|
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||||
|
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||||
|
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||||
|
|
||||||
|
<!--mathjax-->
|
||||||
|
<script type="text/x-mathjax-config">
|
||||||
|
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||||
|
</script>
|
||||||
|
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||||
|
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||||
|
<script>
|
||||||
|
var content = $.trim($("#markdownContent textarea").val());
|
||||||
|
var converter = Markdown.getSanitizingConverter();
|
||||||
|
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||||
|
var html = converter.makeHtml(content);
|
||||||
|
$("#content").html(html);
|
||||||
|
$("pre").addClass("prettyprint linenums");
|
||||||
|
prettyPrint();
|
||||||
|
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||||
|
|
||||||
|
initNav();
|
||||||
|
weixin();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 不是markdown -->
|
||||||
|
{{else}}
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
initNav();
|
||||||
|
weixin();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
49
public/blog/themes/medium/search.html
Normal file
49
public/blog/themes/medium/search.html
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div class="container">
|
||||||
|
<h2>搜索 - {{.keywords}} </h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="posts">
|
||||||
|
{{range .posts}}
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||||
|
{{.Title}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="created-time">
|
||||||
|
<i class="fa fa-bookmark-o"></i>
|
||||||
|
{{if .Tags}}
|
||||||
|
{{blogTags $ .Tags}}
|
||||||
|
{{else}}
|
||||||
|
无
|
||||||
|
{{end}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||||
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
{{.Abstract | raw}}
|
||||||
|
</div>
|
||||||
|
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
<div class="each-post">
|
||||||
|
无
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
{{template "paging.html" $}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
{{template "highlight.html" $}}
|
||||||
|
</body>
|
||||||
|
</html>
|
172
public/blog/themes/medium/share_comment.html
Normal file
172
public/blog/themes/medium/share_comment.html
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
<!-- 赞 -->
|
||||||
|
<div class="entry-controls clearfix">
|
||||||
|
<div class="vote-section-wrapper clearfix">
|
||||||
|
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{$.post.LikeNum}}</span> 赞</button>
|
||||||
|
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
|
||||||
|
</div>
|
||||||
|
<div class="right-section">
|
||||||
|
<div id="weixinQRCode"></div>
|
||||||
|
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
|
||||||
|
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</button>
|
||||||
|
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||||
|
<!-- open -->
|
||||||
|
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||||
|
<i class="fa fa-share-square-o"></i>
|
||||||
|
更多分享
|
||||||
|
</div>
|
||||||
|
<ul class="dropdown-menu" role="menu">
|
||||||
|
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
|
||||||
|
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
|
||||||
|
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="voters clearfix" id="likers">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/x-jsrender" id="tLikers">
|
||||||
|
[[for users]]
|
||||||
|
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" target="_blank" class="voter">
|
||||||
|
[[if Logo]]
|
||||||
|
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||||
|
[[else]]
|
||||||
|
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||||
|
[[/if]]
|
||||||
|
</a>
|
||||||
|
[[/for]]
|
||||||
|
</script>
|
||||||
|
{{if and $.blogInfo.OpenComment (not (eq $.blogInfo.CommentType "disqus"))}}
|
||||||
|
|
||||||
|
<script type="text/x-jsrender" id="tComments">
|
||||||
|
[[for comments]]
|
||||||
|
<li class="comment-item">
|
||||||
|
<!-- 头像 -->
|
||||||
|
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:UserInfo.BlogUrl]]">
|
||||||
|
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||||
|
</a>
|
||||||
|
<!-- 评论 -->
|
||||||
|
<div class="comment-body">
|
||||||
|
<div class="comment-hd">
|
||||||
|
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||||
|
[[if IsAuthorComment]]
|
||||||
|
<span>(作者)</span>
|
||||||
|
[[/if]]
|
||||||
|
|
||||||
|
<!-- 回复其它人 -->
|
||||||
|
[[if ToUserInfo]]
|
||||||
|
<span class="in-reply-to">
|
||||||
|
回复
|
||||||
|
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
|
||||||
|
</span>
|
||||||
|
[[if ToUserIsAuthor]]
|
||||||
|
<span>(作者)</span>
|
||||||
|
[[/if]]
|
||||||
|
[[/if]]
|
||||||
|
</div>
|
||||||
|
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||||
|
[[html:Content]]
|
||||||
|
</div>
|
||||||
|
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||||
|
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||||
|
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
|
||||||
|
|
||||||
|
[[if ~root.visitUserInfo.UserId]]
|
||||||
|
[[if IsMyNote && !IsMyComment]]
|
||||||
|
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
|
||||||
|
[[/if]]
|
||||||
|
[[if !IsMyComment]]
|
||||||
|
<a href="javascript:;" class="comment-reply op-link ">
|
||||||
|
<i class="fa fa-reply"></i>
|
||||||
|
回复
|
||||||
|
</a>
|
||||||
|
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
|
||||||
|
[[else]]
|
||||||
|
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
|
||||||
|
[[/if]]
|
||||||
|
[[/if]]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 回复该评论 -->
|
||||||
|
[[if ~root.visitUserInfo.UserId]]
|
||||||
|
<form class="comment-form comment-box-ft">
|
||||||
|
<div class="clearfix">
|
||||||
|
<div class="avatar-wrap">
|
||||||
|
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||||
|
</div>
|
||||||
|
<div class="editor-wrap">
|
||||||
|
<textarea class="editable" id="commentContent" name="commentContent" placeholder="回复"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="command clearfix" style="display: block;">
|
||||||
|
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
|
||||||
|
<a class="cancel reply-cancel btn-link">取消</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
[[/if]]
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
[[/for]]
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 评论 -->
|
||||||
|
<div class="comment-box hide">
|
||||||
|
<form class="comment-form comment-box-ft hide" id="commentForm">
|
||||||
|
<div class="clearfix">
|
||||||
|
<div class="avatar-wrap">
|
||||||
|
<img class="avatar" id="visitUserLogo">
|
||||||
|
</div>
|
||||||
|
<div class="editor-wrap">
|
||||||
|
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="command clearfix" style="display: block;">
|
||||||
|
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="needLogin hide" id="noLoginContainer">
|
||||||
|
<a onclick="goLogin()">立即登录</a>, 发表评论.
|
||||||
|
<br />
|
||||||
|
没有帐号? <a onclick="goRegister()">立即注册</a>
|
||||||
|
</div>
|
||||||
|
<div class="box-header">
|
||||||
|
<span class="counter">
|
||||||
|
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!-- 评论列表 -->
|
||||||
|
<ul id="comments">
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 更多评论 -->
|
||||||
|
<div id="moreComments">
|
||||||
|
<div class="hide comments-more">
|
||||||
|
<a>More...</a>
|
||||||
|
</div>
|
||||||
|
<div class="comments-loading">
|
||||||
|
<img src="/images/loading-32.gif" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||||
|
|
||||||
|
<div id="disqus_thread"></div>
|
||||||
|
<!-- comment -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||||
|
var disqus_shortname = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
|
||||||
|
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.Title}}'; // 博客链接
|
||||||
|
|
||||||
|
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||||
|
(function() {
|
||||||
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||||
|
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||||
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||||
|
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||||
|
{{end}}
|
53
public/blog/themes/medium/single.html
Normal file
53
public/blog/themes/medium/single.html
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div id="posts">
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
{{.single.Title}}
|
||||||
|
</div>
|
||||||
|
<div class="created-time">
|
||||||
|
<i class="fa fa-calendar"></i> 更新 {{$.single.UpdatedTime | datetime}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 创建 {{$.single.CreatedTime | datetime}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 仅为移动端 -->
|
||||||
|
<div class="mobile-created-time">
|
||||||
|
{{ if $.blogInfo.UserLogo}}
|
||||||
|
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||||
|
{{end}}
|
||||||
|
{{$.blogInfo.Username}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="desc" id="content">
|
||||||
|
{{$.single.Content | raw}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
|
||||||
|
{{template "highlight.html" $}}
|
||||||
|
|
||||||
|
<div id="blogNav">
|
||||||
|
<div id="blogNavNav">
|
||||||
|
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||||
|
<span>文档导航</span>
|
||||||
|
</div>
|
||||||
|
<div id="blogNavContent">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 一些公用的js -->
|
||||||
|
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
initNav();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
530
public/blog/themes/medium/style.css
Normal file
530
public/blog/themes/medium/style.css
Normal file
@ -0,0 +1,530 @@
|
|||||||
|
#posts img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
#content * {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
#content h1 {
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
#content h2 {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
#content h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
#content h4 {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
@-webkit-keyframes dropdown {
|
||||||
|
0% {
|
||||||
|
margin-top: -25px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
margin-top: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@-moz-keyframes dropdown {
|
||||||
|
0% {
|
||||||
|
margin-top: -25px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
margin-top: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@-ms-keyframes dropdown {
|
||||||
|
0% {
|
||||||
|
margin-top: -25px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
margin-top: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes dropdown {
|
||||||
|
0% {
|
||||||
|
margin-top: -25px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
margin-top: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@-webkit-keyframes pulldown {
|
||||||
|
0% {
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
top: 90%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
top: 100%;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@-moz-keyframes pulldown {
|
||||||
|
0% {
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
top: 90%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
top: 100%;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@-ms-keyframes pulldown {
|
||||||
|
0% {
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
top: 90%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
top: 100%;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes pulldown {
|
||||||
|
0% {
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
90% {
|
||||||
|
top: 90%;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
top: 100%;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a,
|
||||||
|
.btn {
|
||||||
|
-webkit-transition: all 0.2s ease;
|
||||||
|
-moz-transition: all 0.2s ease;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.btn:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
ul.dropdown-menu {
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||||
|
}
|
||||||
|
ul.dropdown-menu:before {
|
||||||
|
content: "";
|
||||||
|
width: 20px;
|
||||||
|
height: 12px;
|
||||||
|
position: absolute;
|
||||||
|
top: -12px;
|
||||||
|
right: 20px;
|
||||||
|
background-image: url("images/triangle_2x.png");
|
||||||
|
background-size: 20px 12px;
|
||||||
|
}
|
||||||
|
ul.dropdown-menu {
|
||||||
|
display: block;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.open ul.dropdown-menu {
|
||||||
|
-webkit-animation: pulldown .2s;
|
||||||
|
animation: pulldown .2s;
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.created-time .fa {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
#blogNav {
|
||||||
|
display: none;
|
||||||
|
background-color: #fff;
|
||||||
|
opacity: 0.7;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 10;
|
||||||
|
padding: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
#blogNavContent {
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: 250px;
|
||||||
|
display: none;
|
||||||
|
-webkit-overflow-scrolling: touch !important;
|
||||||
|
}
|
||||||
|
#blogNavNav {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#blogNav a {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
#blogNav:hover {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
#blogNav a:hover {
|
||||||
|
color: #0fb264;
|
||||||
|
}
|
||||||
|
#blogNav ul {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
#blogNav ul .nav-h2 {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
#blogNav ul .nav-h3 {
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
#blogNav ul .nav-h4 {
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
#blogNav ul .nav-h5 {
|
||||||
|
margin-left: 50px;
|
||||||
|
}
|
||||||
|
.mobile-created-time {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.navbar-brand {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#themeList label {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
#themeList .preview {
|
||||||
|
display: block;
|
||||||
|
width: 400px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||||
|
::selection {
|
||||||
|
background: #000000;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
::-moz-selection {
|
||||||
|
background: #000000;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
::-webkit-selection {
|
||||||
|
background: #000000;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
*,
|
||||||
|
body {
|
||||||
|
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3 {
|
||||||
|
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||||
|
font-weight: 300 !important;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
#headerContainer {
|
||||||
|
height: 100px;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
#posts {
|
||||||
|
width: 845px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
#postsContainer {
|
||||||
|
background: #f5f5f5 url("images/noise.png");
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
/* header */
|
||||||
|
#header {
|
||||||
|
color: #000000;
|
||||||
|
position: relative;
|
||||||
|
padding: 0 0 20px 0;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
#header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
#header h1 a {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
#header h1 a img {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
#header #blogDesc {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.navbar {
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.navbar-collapse {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
.navbar-form {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
/* posts */
|
||||||
|
#posts {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
#posts .each-post {
|
||||||
|
border-bottom: 1px solid #ebeff2;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 30px;
|
||||||
|
background-color: #fff;
|
||||||
|
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
#posts .each-post .title {
|
||||||
|
font-size: 32px;
|
||||||
|
color: #0fb264;
|
||||||
|
padding: 0 0 15px 0;
|
||||||
|
}
|
||||||
|
#posts .each-post .title a {
|
||||||
|
font-size: 32px;
|
||||||
|
color: #0fb264;
|
||||||
|
padding: 0 0 15px 0;
|
||||||
|
}
|
||||||
|
#posts .each-post .created-time {
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
#posts .each-post .more {
|
||||||
|
background: #0fb264;
|
||||||
|
padding: 9px 10px;
|
||||||
|
border-radius: 2px;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 13px;
|
||||||
|
display: inline-block;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
#disqus_thread {
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
padding: 5px 0 0 0;
|
||||||
|
}
|
||||||
|
#search {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
#footerContainer {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
#footerContainer #footer a {
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
#footerContainer #footer ul {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: #fbfcf7;
|
||||||
|
}
|
||||||
|
* {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
#headerContainer,
|
||||||
|
#footerContainer {
|
||||||
|
background-color: #fbfcf7;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
#posts .each-post,
|
||||||
|
#postsContainer {
|
||||||
|
background-color: #fbfcf7 !important;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
#posts .each-post {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
#posts .each-post .title {
|
||||||
|
font-size: 24px;
|
||||||
|
border-left: 5px solid #65bd77;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 5px 0;
|
||||||
|
padding-left: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
padding-right: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
.created-time {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mobile-created-time {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.mobile-created-time #userLogo {
|
||||||
|
display: inline-block;
|
||||||
|
max-height: 40px;
|
||||||
|
width: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
#content {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.right-section .dropdown,
|
||||||
|
.right-section .btn {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
#blogNav {
|
||||||
|
left: initial !important;
|
||||||
|
right: 10px !important;
|
||||||
|
}
|
||||||
|
#postsContainer .container,
|
||||||
|
#footerContainer .container {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
#postsContainer {
|
||||||
|
margin: 0 !important;
|
||||||
|
max-width: 100%;
|
||||||
|
padding-top: 10px;
|
||||||
|
background: #f5f5f5 url("../../images/noise.png");
|
||||||
|
}
|
||||||
|
#posts {
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
|
#footerContainer #footer a {
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
#footerContainer #footer a:hover,
|
||||||
|
#footerContainer #footer a:focus {
|
||||||
|
color: #65bd77;
|
||||||
|
}
|
||||||
|
#headerAndNav {
|
||||||
|
position: initial;
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 2px dashed #ebeff2;
|
||||||
|
}
|
||||||
|
#headerAndNav #headerContainer {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
padding-top: 30px;
|
||||||
|
}
|
||||||
|
#headerAndNav #header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#headerAndNav #header h1 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar-collapse {
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
#headerAndNav #blogDesc {
|
||||||
|
border: none;
|
||||||
|
margin-top: 20px;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar-brand {
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 50px;
|
||||||
|
padding: 0;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar-brand img {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar .container {
|
||||||
|
width: auto;
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
background: #fbfcf7;
|
||||||
|
z-index: 1000;
|
||||||
|
border-bottom: 1px solid #DEDDDF;
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||||
|
background-color: #FDFFF5;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar-nav {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar-nav a {
|
||||||
|
padding-left: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
#headerAndNav #search {
|
||||||
|
width: 100%;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
#headerAndNav .navbar-form {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
#myTab,
|
||||||
|
.tab-content {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
table {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
table th, table td {
|
||||||
|
padding: 6px 13px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
table th {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table tr {
|
||||||
|
background-color: #fff;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
table tr:nth-child(2n) {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-collapse: collapse;
|
||||||
|
padding: 6px 13px;
|
||||||
|
}
|
47
public/blog/themes/medium/tag_posts.html
Normal file
47
public/blog/themes/medium/tag_posts.html
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div class="container">
|
||||||
|
<h2>标签 - {{.curTag}} </h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="posts">
|
||||||
|
{{range .posts}}
|
||||||
|
<div class="each-post">
|
||||||
|
<div class="title">
|
||||||
|
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||||
|
{{.Title}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="created-time">
|
||||||
|
<i class="fa fa-bookmark-o"></i>
|
||||||
|
{{if .Tags}}
|
||||||
|
{{blogTags $ .Tags}}
|
||||||
|
{{else}}
|
||||||
|
无
|
||||||
|
{{end}}
|
||||||
|
|
|
||||||
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||||
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
{{.Abstract | raw}}
|
||||||
|
</div>
|
||||||
|
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="each-post">
|
||||||
|
无
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
{{template "paging.html" $}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "footer.html" $}}
|
||||||
|
{{template "highlight.html" $}}
|
||||||
|
</body>
|
||||||
|
</html>
|
26
public/blog/themes/medium/tags.html
Normal file
26
public/blog/themes/medium/tags.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{{template "header.html" .}}
|
||||||
|
|
||||||
|
<div id="postsContainer">
|
||||||
|
<div class="container">
|
||||||
|
<h2>标签</h2>
|
||||||
|
</div>
|
||||||
|
<div id="posts">
|
||||||
|
|
||||||
|
<div class="each-post">
|
||||||
|
<ul>
|
||||||
|
{{range $.tags}}
|
||||||
|
<li>
|
||||||
|
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||||
|
{{.Tag}} {{.Count}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "footer.html" .}}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
31
public/blog/themes/medium/theme.json
Normal file
31
public/blog/themes/medium/theme.json
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
以下是本主题的配置, 采用JSON格式
|
||||||
|
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||||
|
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||||
|
|
||||||
|
注意:
|
||||||
|
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||||
|
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||||
|
|
||||||
|
请在此解析所有配置
|
||||||
|
* Name 主题名
|
||||||
|
* Version 主题版本
|
||||||
|
* Author 主题的作者
|
||||||
|
* AuthorUrl 作者的博客链接或相关链接
|
||||||
|
|
||||||
|
* FriendLinks 友情链接
|
||||||
|
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
"Name": "leanote default theme",
|
||||||
|
"Version": "1.0",
|
||||||
|
"Author": "leanote.com",
|
||||||
|
"AuthorUrl": "http://leanote.com",
|
||||||
|
"FriendLinks": [
|
||||||
|
{"Title": "我的笔记", "Url": "http://leanote.com/note"},
|
||||||
|
{"Title": "leanote home", "Url": "http://leanote.com"},
|
||||||
|
{"Title": "leanote 社区", "Url": "http://bbs.leanote.com"},
|
||||||
|
{"Title": "lea++", "Url": "http://lea.leanote.com"},
|
||||||
|
{"Title": "leanote github", "Url": "https://github.com/leanote/leanote"}
|
||||||
|
]
|
||||||
|
}
|
Reference in New Issue
Block a user