├── bitcron-motify.jpg ├── template ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.woff │ └── icomoon.svg ├── show │ ├── douban.jade │ ├── indexwf.jade │ └── postwf.jade ├── 404.jade ├── admin.json ├── category.jade ├── archive.jade ├── include │ ├── douban_item_180102.js │ ├── dbapi_170805.js │ └── jquery.md5.js ├── index.jade ├── OwO │ ├── OwO.min.js │ ├── OwO.json │ └── OwO.min.css ├── base.jade ├── post.jade └── style.scss └── README.md /bitcron-motify.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmm214/Bitcron-Theme-Motify/HEAD/bitcron-motify.jpg -------------------------------------------------------------------------------- /template/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmm214/Bitcron-Theme-Motify/HEAD/template/fonts/icomoon.eot -------------------------------------------------------------------------------- /template/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmm214/Bitcron-Theme-Motify/HEAD/template/fonts/icomoon.ttf -------------------------------------------------------------------------------- /template/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmm214/Bitcron-Theme-Motify/HEAD/template/fonts/icomoon.woff -------------------------------------------------------------------------------- /template/show/douban.jade: -------------------------------------------------------------------------------- 1 | .douban_item.post-preview(id='db'+id,date-dbid=id) 2 | +h.load("/template/include/douban_item_180102.js") -------------------------------------------------------------------------------- /template/404.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block title 4 | title= "404 - " + site.title 5 | 6 | block content 7 | .posts.archive.post.hentry 8 | h1 文章归档 9 | h2 对不起,找不到该页面。 -------------------------------------------------------------------------------- /template/admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "fields": [ 3 | "footer_slogan(placeholder='重拾写作的乐趣')", 4 | "footer_slogan_font(type=font, default=hanazono)", 5 | "site_title_font(type=font, default=hanazono)" 6 | ], 7 | "i18n":{ 8 | "zh_cn": { 9 | "Footer Slogan": "页尾签名", 10 | "Footer Slogan Font": "页尾签名字体", 11 | "Site Title Font": "网站标题字体" 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /template/show/indexwf.jade: -------------------------------------------------------------------------------- 1 | album_folder = d.get_doc(path, match=True, type='folder') 2 | if album_folder 3 | dom_id = h.get_dom_id() 4 | image_sort = 'date' 5 | image_docs = d.get_data(path=path, type='image', limit=20, with_page=False, sort=sort) 6 | waterfall_dom_id = 'waterfall_%s'%dom_id 7 | .h_show_waterfall_container 8 | .humech_waterfall(id=waterfall_dom_id) 9 | for doc in image_docs 10 | cover = doc.url.resize(width=150, height=150, fixed='True') 11 | if cover!='/404': .item: .item_body 12 | +h.auto_a(title=cover, href=doc.url, alt=doc.title) 13 | div(style="clear:both;height:0") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bitcron-Theme-Motify 2 | 3 | ![screenshot.jpg](https://raw.githubusercontent.com/lmm214/Bitcron-Theme-Motify/master/bitcron-motify.jpg) 4 | 5 | ### 主题简介 6 | 7 | 自扒 WordPress 同名主题,支持: 8 | 9 | - 头部背景自定义 10 | - “相册”、“一句话”特色文章样式 11 | - 社交图标包含:Twitter、Instagram、Github、Flickr、微博、Facebook。 12 | 13 | ### 头部背景 14 | 15 | 后台 `Dashboard → Images → Default Background` 16 | 17 | ### “一句话”文章使用 18 | 19 | 在文章中加入这个 `metadate` 即可 20 | 21 | >format: chat 22 | 23 | 头像设置:`Dashboard → Images → Avatar` 24 | 25 | ### “相册”文章使用 26 | 27 | 在文章中加入以下 `metadate` 28 | 29 | >format: photo 30 | path: lxy 31 | width: 250 32 | 33 | `path: lxy` 表示此文调取的图片在根目录 `/_photos/lxy` 里。所以,需要在根目录 **新建文件夹** `_photos` 并在其中再建文件夹 `lxy`。 34 | 35 | `width: 250` 可选,文章内页瀑布流显示的 **每一列** 即每张图片的宽度。(首页默认缩略图显示,且不显示文章内容。) 36 | 37 | 注:如需更改 `_photos` 这个文件夹,相关代码在 `index.jade` 和 `post.jade` 中: 38 | 39 | ```jade 40 | - var metapath = "/_photos/"+ post.metadata.path 41 | ``` 42 | 43 | ### 社交图标使用 44 | 45 | `Dashboard → 常规`,如需增加 “Twitter、Instagram、Github、Flickr、微博、Facebook ” 之外的图标,可访问 进一步处理。 46 | -------------------------------------------------------------------------------- /template/category.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block title 4 | title= posts.category.title + " - " + site.title 5 | 6 | block content 7 | .posts.archive.post.hentry 8 | h1= posts.category.title 9 | p.all_category 10 | for category in posts.categories 11 | a.friends(href=category.url) 12 | img(src=category.cover) 13 | category.title 14 | span.postss= '此分类共计 %s 篇日志' %(d.get_data(types='post', path=posts.category.filename,return_count=true, with_page=false)) 15 | 16 | +posts.set_min_per_page(30) 17 | ul.archive-list: for post in posts: li.archive-item 18 | if post.cover 19 | post_src = post.cover.resize(48, 48, fixed=True) 20 | else 21 | post_src = post.category.cover 22 | img.archive-list-image(src=post_src+'?imageView2/1/w/96/h/96/q/75|imageslim') 23 | a(href=post.url,title=post.title)= post.title 24 | span.archive-item-meta= post.date.format('%Y-%m-%d') + " / %s 阅读 / " %(post.visits or 0) + "%s 评论" %(post.comments_count or 0) 25 | 26 | .posts-nav 27 | +h.paginator(style="simple",show_page_of="True", pre_label=' 上一页', next_label='下一页 ') -------------------------------------------------------------------------------- /template/archive.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block title 4 | title= "文章归档 - " + site.title 5 | 6 | block content 7 | .posts.archive.post.hentry 8 | h1 文章归档 9 | p.all_category 10 | for category in posts.categories 11 | a.friends(href=category.url) 12 | img(src=category.cover) 13 | category.title 14 | span.postss= '全站共计 %s 篇日志' %(d.get_data(types='post', return_count=true, with_page=false)) 15 | 16 | entries = d.get_data(types="post", limit=50, sort="desc").group("-date:year+month") 17 | 18 | for year,year_posts in entries 19 | h2.archive-year= year 20 | ul.archive-list: for post in year_posts: li.archive-item 21 | if post.cover 22 | post_src = post.cover.resize(48, 48, fixed=True) 23 | else 24 | post_src = post.category.cover 25 | img.archive-list-image(src=post_src+'?imageView2/1/w/96/h/96/q/75|imageslim') 26 | a(href=post.url,title=post.title)= post.title 27 | span.archive-item-meta= "%s 阅读 / " %(post.visits or 0) + "%s 评论" %(post.comments_count or 0) 28 | 29 | .posts-nav 30 | +h.paginator(style="simple",show_page_of="True", pre_label=' 上一页', next_label='下一页 ') -------------------------------------------------------------------------------- /template/show/postwf.jade: -------------------------------------------------------------------------------- 1 | +h.load("jquery") 2 | +h.load("/fb_static/lib/responsive_waterfall.js") 3 | album_folder = d.get_doc(path, match=True, type='folder') 4 | if album_folder 5 | dom_id = h.get_dom_id() 6 | image_sort = 'date' 7 | min_box_width = width.force_int or 250 8 | thumbnail_width = thumbnail_width or 600 9 | thumbnail_height = thumbnail_height or None 10 | image_docs = d.get_data(path=path, type='image', limit=100, with_page=False, sort=sort) 11 | waterfall_dom_id = 'waterfall_%s'%dom_id 12 | .h_show_waterfall_container 13 | .humech_waterfall(id=waterfall_dom_id) 14 | for doc in image_docs 15 | cover = doc.url.resize(width=thumbnail_width, height=thumbnail_height, fixed=thumbnail_fixed) 16 | if cover!='/404': .item: .item_body 17 | +h.auto_a(title=cover, href=doc.url, alt=doc.title) 18 | if show_title: .description 19 | span.title= doc.title 20 | span.date= doc.date 21 | script= "new Waterfall({containerSelector: '#%s', boxSelector:'.item', minBoxWidth: %s })"%(waterfall_dom_id, min_box_width) 22 | div(style="clear:both;height:0") -------------------------------------------------------------------------------- /template/include/douban_item_180102.js: -------------------------------------------------------------------------------- 1 | //By ImMmMm.com 20180102 2 | $(document).ready(function(){ 3 | $('.douban_item').each(function(){ 4 | var id = $(this).attr('date-dbid').toString() 5 | if (id.length < 9){ 6 | var url= "https://api.douban.com/v2/movie/subject/"+id 7 | $.ajax({ 8 | url: url, 9 | type: 'GET', 10 | dataType: 'JSONP', 11 | success: function (data) { 12 | var db_casts = ""; 13 | for(var i in data.casts){ 14 | db_casts += data.casts[i].name+" "; 15 | } 16 | $('#db'+id).html("

《"+data.title+"》

"+data.summary+"
"); 17 | } 18 | }); 19 | }else if (id.length > 9){ 20 | var url= "https://api.douban.com/v2/book/isbn/"+id 21 | $.ajax({ 22 | url: url, 23 | type: 'GET', 24 | dataType: 'JSONP', 25 | success: function (data) { 26 | $('#db'+id).html("

《"+data.title+"》"+data.subtitle+"

"+data.summary+"
"); 27 | } 28 | }); 29 | }else{ 30 | console.log("出错"+ id) 31 | } 32 | //alert(id) 33 | }); 34 | }); -------------------------------------------------------------------------------- /template/index.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block content 4 | .posts.index 5 | for post in posts 6 | if post.metadata.format 7 | - var formats = post.metadata.format 8 | else if post.metadata.path 9 | - var formats = "photo" 10 | else if post.category.filename == "chat" 11 | - var formats = "chat" 12 | else 13 | - var formats = "daily" 14 | 15 | - var cates = post.category.filename 16 | - var meta = "post hentry "+ cates + " format-"+ formats 17 | 18 | - var now_ym = site.now.format('%y%m').int 19 | - var now_d = site.now.format('%d').int 20 | - var now_H = site.now.format('%H').int 21 | - var now_M = site.now.format('%M').int 22 | - var post_ym = post.date.format('%y%m').int 23 | - var post_d = post.date.format('%d').int 24 | - var post_H = post.date.format('%H').int 25 | - var post_M = post.date.format('%M').int 26 | 27 | if now_ym == post_ym 28 | if now_d == post_d 29 | if now_H == post_H 30 | if now_M == post_M 31 | - var re_date = "刚刚发布" 32 | else 33 | - var re_date = "发布于 " + now_M - post_M + " 分钟前" 34 | else 35 | - var re_date = "发布于 " + now_H - post_H + " 小时前" 36 | else 37 | - var re_date = "发布于 " + now_d - post_d + " 天前" 38 | else 39 | - var re_date = post.date.format('%m月 %d日,%Y') 40 | 41 | if formats == "photo" 42 | - var metapath = "/_photos/"+ post.metadata.path 43 | article(class=meta) 44 | header: time.date: i.fa: span= re_date 45 | h1.entry-title: a(href=post.url)= post.title 46 | .post-content 47 | +h.show('indexwf',path=metapath) 48 | footer.post-footer: a(href=post.url).more-link= '发表评论 »' 49 | else if formats == "chat" 50 | article(class=meta) 51 | header: time.date: i.fa: span= re_date 52 | .post-content 53 | a(href=post.url): img(src= site.site_avatar).avatar 54 | post.content 55 | else 56 | article(class=meta) 57 | header: time.date: i.fa: span= re_date 58 | h1.entry-title: a(href=post.url)= post.title 59 | if post.content.opening 60 | .post-content= post.content.opening 61 | footer.post-footer: a(href=post.url).more-link= '阅读全文 »' 62 | else 63 | .post-content= post.content 64 | footer.post-footer: a(href=post.url+'#comments').more-link= '发表评论 »' 65 | 66 | .posts-nav 67 | +h.paginator(style="simple",show_page_of="True", pre_label=' 上一页', next_label='下一页 ') -------------------------------------------------------------------------------- /template/OwO/OwO.min.js: -------------------------------------------------------------------------------- 1 | "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var a=0;a=200&&i.status<300||304===i.status?(a.odata=JSON.parse(i.responseText),a.init(t)):console.log("OwO data request was unsuccessful: "+i.status))},i.open("get",t.api,!0),i.send(null)}return _createClass(e,[{key:"init",value:function(e){var t=this;this.area=e.target,this.packages=Object.keys(this.odata);for(var a='\n \n
',s=0;s';for(var n=this.odata[this.packages[s]].container,i=0;i'+n[i].icon+"";a+="\n "}a+='\n
\n
    ';for(var o=0;o"+this.packages[o]+"";a+="\n
\n
\n
\n ",this.container.innerHTML=a,this.logo=this.container.getElementsByClassName("OwO-logo")[0],this.logo.addEventListener("click",function(){t.toggle()}),this.container.getElementsByClassName("OwO-body")[0].addEventListener("click",function(e){var a=null;if(e.target.classList.contains("OwO-item")?a=e.target:e.target.parentNode.classList.contains("OwO-item")&&(a=e.target.parentNode),a){var s=t.area.selectionEnd,n=t.area.value;t.area.value=n.slice(0,s)+a.innerHTML+n.slice(s),t.area.focus(),t.toggle()}}),this.packagesEle=this.container.getElementsByClassName("OwO-packages")[0];for(var c=function(e){!function(a){t.packagesEle.children[e].addEventListener("click",function(){t.tab(a)})}(e)},l=0;l= 0) { 73 | domain = MapKey; 74 | _output = iconMap[MapKey]; 75 | } 76 | } 77 | } 78 | return _output; 79 | }; 80 | function addIcons() { 81 | $('.post-content a:not(:has(img))').each(function(i) { 82 | var _src = $(this).attr('href'); 83 | var tmp = document.createElement('a'); 84 | tmp.href = _src; 85 | _selfDomain = tmp.hostname; 86 | urlIconlize(_selfDomain); 87 | $(this).prepend(''); 88 | }); 89 | } 90 | addIcons(); 91 | }); -------------------------------------------------------------------------------- /template/include/dbapi_170805.js: -------------------------------------------------------------------------------- 1 | //批量读取豆瓣的图书和电影 2 | //by justin 20120316 DIY by lmm 20170807 3 | //http://www.cnblogs.com/justinw/archive/2012/03/16/2402309.html 4 | 5 | //--dbapi.begin-- 6 | var $ = jQuery; 7 | var dbapi = { 8 | appendScript:function(url){ 9 | if ((url)&&(url.length > 0)) 10 | $("