├── .github └── ISSUE_TEMPLATE │ └── issues-template.md ├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── languages ├── default.yml ├── fr.yml ├── it.yml ├── nl.yml ├── no.yml ├── ru.yml ├── zh-CN.yml └── zh-TW.yml ├── layout ├── _partial │ ├── categories.ejs │ ├── google-analytics.ejs │ ├── head.ejs │ ├── list.ejs │ ├── mathjax.ejs │ ├── menu.ejs │ ├── pagination.ejs │ ├── photoswipe.ejs │ ├── post │ │ ├── article.ejs │ │ ├── copyright.ejs │ │ ├── date.ejs │ │ ├── gitalk.ejs │ │ ├── header.ejs │ │ ├── item.ejs │ │ ├── tag.ejs │ │ └── title.ejs │ ├── screen.ejs │ ├── scripts.ejs │ ├── search.ejs │ └── tags.ejs ├── archive.ejs ├── category.ejs ├── index.ejs ├── layout.ejs ├── page.ejs ├── post.ejs └── tag.ejs ├── scripts └── page_title.js └── source ├── css └── diaspora.css ├── img ├── cover.jpg ├── favicon.png ├── logo.png └── welcome-cover.jpg ├── js ├── diaspora.js ├── jquery.min.js ├── plugin.js └── typed.js └── photoswipe ├── default-skin ├── default-skin.css ├── default-skin.png ├── default-skin.svg └── preloader.gif ├── photoswipe-ui-default.js ├── photoswipe-ui-default.min.js ├── photoswipe.css ├── photoswipe.js └── photoswipe.min.js /.github/ISSUE_TEMPLATE/issues-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Issues Template 3 | about: description 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | URL: 11 | Description: 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | node_modules 3 | .idea 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Fechin Li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hexo-theme-diaspora 2 | 3 | 4 | **[在线预览 | PREVIEW ](http://fech.in)** 5 | 6 | 一款基于WP移植的Hexo主题,适合喜欢摄影,影评,乐评和玩弄文字的你,干净,清新; 响应式,Ajax,更多好玩的等你来发现。 7 | 8 | > 再次感谢原作者创作出这么精美的主题 [@Loeify](https://github.com/LoeiFy/Diaspora) 。如果你喜欢,请捐助原作者。 9 | 10 | ![cover](https://fech.in/static/images/Diaspora.jpg) 11 | 12 | 13 | ### 安装主题 14 | 15 | ``` bash 16 | $ git clone https://github.com/Fechin/hexo-theme-diaspora.git themes/diaspora 17 | ``` 18 | 19 | 20 | ### 启用主题 21 | 22 | 修改Hexo配置文件 `_config.yml` 主题项设置为diaspora 23 | 24 | 25 | ``` yaml 26 | 27 | ... 28 | theme: diaspora 29 | ... 30 | ``` 31 | ### 更新主题 32 | 33 | 注意:请在更时主题时备份`_config.yml`配置文件 34 | 35 | ``` bash 36 | cd themes/diaspora 37 | git pull 38 | ``` 39 | 40 | 41 | ### 新建文章模板 42 | 43 | ``` markdown 44 | --- 45 | title: My awesome title 46 | date: 2016-10-12 18:38:45 47 | categories: 48 | - 分类1 49 | - 分类2 50 | tags: 51 | - 标签1 52 | - 标签2 53 | mp3: http://domain.com/awesome.mp3 54 | cover: http://domain.com/awesome.jpg 55 | --- 56 | ``` 57 | 58 | ### 创建分类页 59 | 1 新建一个页面,命名为 categories 。命令如下: 60 | ``` 61 | hexo new page categories 62 | ``` 63 | 2 编辑刚新建的页面,将页面的类型设置为 categories 64 | ``` 65 | title: categories 66 | date: 2014-12-22 12:39:04 67 | type: "categories" 68 | --- 69 | ``` 70 | 主题将自动为这个页面显示所有分类。 71 | 72 | ### 创建标签页 73 | 1 新建一个页面,命名为 tags 。命令如下: 74 | ``` 75 | hexo new page tags 76 | ``` 77 | 2 编辑刚新建的页面,将页面的类型设置为 tags 78 | ``` 79 | title: tags 80 | date: 2014-12-22 12:39:04 81 | type: "tags" 82 | --- 83 | ``` 84 | 主题将自动为这个页面显示所有标签。 85 | 86 | ### 创建搜索页 87 | 88 | 1 需要安装hexo的搜索插件 89 | ``` 90 | npm install hexo-generator-searchdb --save 91 | ``` 92 | 93 | 2 配置hexo全局配置文件(请将生成的索引文件放在网站根目录或修改主题js文件的path值) 94 | ```yml 95 | search: 96 | path: search.xml 97 | field: post 98 | format: html 99 | limit: 10000 100 | ``` 101 | 102 | 3 新建一个页面,命名为 search 。命令如下: 103 | ``` 104 | hexo new page search 105 | ``` 106 | 4 编辑刚新建的页面,将页面的类型设置为 search 107 | ``` 108 | title: search 109 | date: 2014-12-22 12:39:04 110 | type: "search" 111 | --- 112 | ``` 113 | 114 | 5 在主题配置文件启用本地搜索 115 | ```yml 116 | #本地搜索,请将索引文件放在网站根目录 117 | local_search: 118 | #是否启用 119 | enable: true 120 | 121 | ``` 122 | 123 | 主题将自动为这个页面显示搜索功能。 124 | 125 | 126 | 127 | ### 主题配置 128 | ```yml 129 | # 头部菜单,title: link 130 | menu: 131 | 首页: / 132 | 分类: /categories 133 | 标签: /tags 134 | 归档: /archives 135 | 关于: /about 136 | 137 | # 是否显示目录 138 | TOC: false 139 | 140 | # 是否自动播放音乐 141 | autoplay: false 142 | 143 | # 默认音乐(随机播放) 144 | mp3: 145 | - http://link.hhtjim.com/163/425570952.mp3 146 | - http://link.hhtjim.com/163/425570952.mp3 147 | 148 | # 首页封面图, 为空时取文章的cover作为封面(注意跨域问题,建议使用同源图片) 149 | welcome_cover: /img/welcome-cover.jpg 150 | 151 | 152 | # 默认文章封面图(随机调用,支持外链) 153 | cover: 154 | - /img/cover.jpg 155 | - /img/welcome-cover.jpg 156 | 157 | # 是否显示Twitter分享卡片图像(图像尺寸要求:1200*600,creatorid不需要带@符号。注意:链接必须是完整url,否则Twitter将无法读取图片信息) 158 | twitterpic: 159 | enable: false 160 | src: https://bangdream.moe/img/ident.png 161 | creatorid: yourtwitteridhere 162 | 163 | # 是否关闭默认滚动条 164 | scrollbar: true 165 | 166 | # 本地搜索,请将索引文件放在网站根目录,或修改主题js文件的path值 167 | local_search: 168 | # 是否启用 169 | enable: false 170 | 171 | # 是否显示 一言(hitokoto) 172 | hitokoto: true 173 | 174 | # 链接(可选:facebook,twitter,github,wechat,email) 175 | links: 176 | facebook: / 177 | twitter: / 178 | github: / 179 | wechat: /img/logo.png 180 | email: mailto:xxxx@gmail.com 181 | 182 | # 备案 183 | beian: 184 | # 是否显示备案信息 185 | enable: true 186 | # 是否在主页面最底下显示备案信息(虽然丑,但是完全满足规定要求) 187 | enableFooter: false 188 | # 备案号 189 | beianInfo: 冀ICP备xxxxxxx号 190 | # 链接地址 191 | link: http://www.beian.miit.gov.cn 192 | 193 | # 是否使用mathjax 194 | mathjax: false 195 | 196 | # Gitalk 评论插件(https://github.com/gitalk/gitalk) 197 | gitalk: 198 | # 是否启用评论功能 199 | enable: false 200 | # 是否自动展开评论框 201 | autoExpand: false 202 | # 应用编号 203 | clientID: '' 204 | # 应用秘钥 205 | clientSecret: '' 206 | # issue仓库名 207 | repo: '' 208 | # Github名 209 | owner: '' 210 | # Github名 211 | admin: [''] 212 | # Ensure uniqueness and length less than 50 213 | id: location.pathname 214 | # Facebook-like distraction free mode 215 | distractionFreeMode: false 216 | 217 | # 网站关键字 218 | keywords: Fechin 219 | 220 | # 要使用google_analytics进行统计的话,这里需要配置ID 221 | google_analytics: 222 | 223 | # 网站ico 224 | favicon: /img/favicon.png 225 | 226 | # rss文件 227 | rss: atom.xml 228 | 229 | # 版权信息,要使用版权信息可以在这配置并设定许可方式,可以从 https://creativecommons.org/about/cclicenses/ 查询 230 | copyright: 231 | enable: false 232 | license: "CC BY-NC-ND" 233 | 234 | ``` 235 | 236 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # 头部菜单,title: link 2 | menu: 3 | 首页: / 4 | 分类: /categories 5 | 标签: /tags 6 | 归档: /archives 7 | 关于: /about 8 | 9 | # 是否显示目录 10 | TOC: false 11 | 12 | # 是否自动播放音乐 13 | autoplay: false 14 | 15 | # 默认音乐(随机播放) 16 | mp3: 17 | - http://link.hhtjim.com/163/425570952.mp3 18 | - http://link.hhtjim.com/163/425570952.mp3 19 | 20 | # 首页封面图, 为空时取文章的cover作为封面(注意跨域问题,建议使用同源图片) 21 | welcome_cover: /img/welcome-cover.jpg 22 | 23 | # 默认文章封面图(随机调用,支持外链) 24 | cover: 25 | - /img/cover.jpg 26 | - /img/welcome-cover.jpg 27 | 28 | # 是否显示Twitter分享卡片图像(图像尺寸要求:1200*600,creatorid不需要带@符号。注意:链接必须是完整url,否则Twitter将无法读取图片信息) 29 | twitterpic: 30 | enable: false 31 | src: https://bangdream.moe/img/ident.png 32 | creatorid: yourtwitteridhere 33 | 34 | # 是否使用mathjax 35 | mathjax: false 36 | 37 | 38 | # 是否关闭默认滚动条 39 | scrollbar: true 40 | 41 | # 本地搜索,请将索引文件放在网站根目录,或修改主题js文件的path值 42 | local_search: 43 | # 是否启用 44 | enable: false 45 | 46 | # 是否显示 一言(hitokoto) 47 | hitokoto: true 48 | 49 | # 链接(可选:facebook,twitter,github,wechat,email) 50 | links: 51 | facebook: / 52 | twitter: / 53 | github: / 54 | wechat: /img/logo.png 55 | email: mailto:xxxx@gmail.com 56 | 57 | # 备案 58 | beian: 59 | # 是否显示备案信息 60 | enable: true 61 | # 是否在主页面最底下显示备案信息(虽然丑,但是完全满足规定要求) 62 | enableFooter: false 63 | # 备案号 64 | beianInfo: 冀ICP备xxxxxxx号 65 | # 链接地址 66 | link: http://www.beian.miit.gov.cn 67 | 68 | # Gitalk 评论插件(https://github.com/gitalk/gitalk) 69 | gitalk: 70 | # 是否启用评论功能 71 | enable: false 72 | # 是否自动展开评论框 73 | autoExpand: false 74 | # 应用编号 75 | clientID: '' 76 | # 应用秘钥 77 | clientSecret: '' 78 | # issue仓库名 79 | repo: '' 80 | # Github名 81 | owner: '' 82 | # Github名 83 | admin: [''] 84 | # Ensure uniqueness and length less than 50 85 | id: location.pathname 86 | # Facebook-like distraction free mode 87 | distractionFreeMode: false 88 | 89 | # 网站关键字 90 | keywords: Fechin 91 | 92 | # 要使用google_analytics进行统计的话,这里需要配置ID 93 | google_analytics: 94 | 95 | # 网站ico 96 | favicon: /img/favicon.png 97 | 98 | # rss文件 99 | rss: atom.xml 100 | 101 | # 要使用版权信息可以在这配置并设定许可方式,可以从 https://creativecommons.org/about/cclicenses/ 查询 102 | copyright: 103 | enable: false 104 | license: "CC BY-NC-ND" 105 | -------------------------------------------------------------------------------- /languages/default.yml: -------------------------------------------------------------------------------- 1 | categories: Categories 2 | search: Search 3 | tags: Tags 4 | tagcloud: Tag Cloud 5 | tweets: Tweets 6 | prev: Prev 7 | next: Next 8 | comment: Comments 9 | archive_a: Archives 10 | archive_b: "Archives: %s" 11 | page: Page %d 12 | recent_posts: Recent Posts 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag 20 | nav.category: Category 21 | nav.tag: Tag 22 | nav.archive: Archive 23 | copyright: 24 | author: "Author: " 25 | title: "title: " 26 | link: "Link: " 27 | license_title: "License: " 28 | -------------------------------------------------------------------------------- /languages/fr.yml: -------------------------------------------------------------------------------- 1 | categories: Catégories 2 | search: Rechercher 3 | tags: Mot-clés 4 | tagcloud: Nuage de mot-clés 5 | tweets: Tweets 6 | prev: Précédent 7 | next: Suivant 8 | comment: Commentaires 9 | archive_a: Archives 10 | archive_b: "Archives: %s" 11 | page: Page %d 12 | recent_posts: Articles récents 13 | newer: Récent 14 | older: Ancien 15 | share: Partager 16 | powered_by: Propulsé by 17 | rss_feed: Flux RSS 18 | category: Catégorie 19 | tag: Mot-clé 20 | -------------------------------------------------------------------------------- /languages/it.yml: -------------------------------------------------------------------------------- 1 | categories: Categorie 2 | search: Cerca 3 | tags: Tag 4 | tagcloud: Tag Cloud 5 | tweets: Tweet 6 | prev: Prec 7 | next: Succ 8 | comment: Commenti 9 | archive_a: Archivio 10 | archive_b: "Archivio: %s" 11 | page: Pagina %d 12 | recent_posts: Post Recenti 13 | newer: Recenti 14 | older: Passati 15 | share: Condividi 16 | powered_by: Powered by 17 | rss_feed: Feed RSS 18 | category: Categoria 19 | tag: Tag 20 | -------------------------------------------------------------------------------- /languages/nl.yml: -------------------------------------------------------------------------------- 1 | 2 | categories: Categorieën 3 | search: Zoeken 4 | tags: Labels 5 | tagcloud: Tag Cloud 6 | tweets: Tweets 7 | prev: Vorige 8 | next: Volgende 9 | comment: Commentaren 10 | archive_a: Archieven 11 | archive_b: "Archieven: %s" 12 | page: Pagina %d 13 | recent_posts: Recente berichten 14 | newer: Nieuwer 15 | older: Ouder 16 | share: Delen 17 | powered_by: Powered by 18 | rss_feed: RSS Feed 19 | category: Categorie 20 | tag: Label 21 | -------------------------------------------------------------------------------- /languages/no.yml: -------------------------------------------------------------------------------- 1 | categories: Kategorier 2 | search: Søk 3 | tags: Tags 4 | tagcloud: Tag Cloud 5 | tweets: Tweets 6 | prev: Forrige 7 | next: Neste 8 | comment: Kommentarer 9 | archive_a: Arkiv 10 | archive_b: "Arkiv: %s" 11 | page: Side %d 12 | recent_posts: Siste innlegg 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag -------------------------------------------------------------------------------- /languages/ru.yml: -------------------------------------------------------------------------------- 1 | categories: Категории 2 | search: Поиск 3 | tags: Метки 4 | tagcloud: Облако меток 5 | tweets: Твиты 6 | prev: Назад 7 | next: Вперед 8 | comment: Комментарии 9 | archive_a: Архив 10 | archive_b: "Архив: %s" 11 | page: Страница %d 12 | recent_posts: Недавние записи 13 | newer: Следующий 14 | older: Предыдущий 15 | share: Поделиться 16 | powered_by: Создано с помощью 17 | rss_feed: RSS-каналы 18 | category: Категория 19 | tag: Метка -------------------------------------------------------------------------------- /languages/zh-CN.yml: -------------------------------------------------------------------------------- 1 | categories: 分类 2 | search: 搜索 3 | tags: 标签 4 | tagcloud: 标签云 5 | tweets: 推文 6 | prev: 上一页 7 | next: 下一页 8 | comment: 留言 9 | archive_a: 归档 10 | archive_b: 归档:%s 11 | page: 第 %d 页 12 | recent_posts: 最新文章 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag 20 | nav.category: 分类 21 | nav.tag: 标签 22 | nav.archive: 归档 23 | copyright: 24 | author: "作者: " 25 | title: "标题: " 26 | link: "链接: " 27 | license_title: "版权声明: " 28 | -------------------------------------------------------------------------------- /languages/zh-TW.yml: -------------------------------------------------------------------------------- 1 | categories: 分類 2 | search: 搜尋 3 | tags: 標籤 4 | tagcloud: 標籤雲 5 | tweets: 推文 6 | prev: 上一頁 7 | next: 下一頁 8 | comment: 留言 9 | archive_a: 彙整 10 | archive_b: 彙整:%s 11 | page: 第 %d 頁 12 | recent_posts: 最新文章 13 | newer: 較新 14 | older: 較舊 15 | share: 分享 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: 分類 19 | tag: 標籤 20 | nav.category: 分類 21 | nav.tag: 標籤 22 | nav.archive: 彙整 23 | copyright: 24 | author: "作者: " 25 | title: "文章標題: " 26 | link: "文章連結: " 27 | license_title: "版權聲明: " 28 | -------------------------------------------------------------------------------- /layout/_partial/categories.ejs: -------------------------------------------------------------------------------- 1 |
2 |

分类

3 | <%- list_categories({orderby: "length", order: -1}) %> 4 |
5 | -------------------------------------------------------------------------------- /layout/_partial/google-analytics.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.google_analytics){ %> 2 | 3 | 4 | 5 | 12 | 13 | <% } %> 14 | -------------------------------------------------------------------------------- /layout/_partial/head.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | var keywords = ''; 3 | var description = ''; 4 | (function() { 5 | if (theme.keywords) { 6 | keywords += theme.keywords; 7 | keywords += ','; 8 | } 9 | if (page.keywords) { 10 | keywords += page.keywords; 11 | } 12 | if (config.description) { 13 | description += config.description; 14 | description += ','; 15 | } 16 | if (is_post()) { 17 | description += truncate(strip_html(page.content), {length: 100, omission: ','}); 18 | } 19 | })(); 20 | %> 21 | 22 | 23 | 24 | 25 | 26 | 27 | <%= page_title() %> 28 | 29 | 30 | 31 | <% if (keywords) { %> <% } %> 32 | <% if (description) { %> <% } %> 33 | <% if (config.author){ %> <% } %> 34 | <% if (theme.rss){ %> <% } %> 35 | <% if (theme.favicon){ %> <% } %> 36 | <% if (theme.gitalk.enable){ %><%- css(['//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css'])%><%}%> 37 | <% if(theme.twitterpic.enable){ %><%}%> 38 | <% if(theme.twitterpic.enable){ %><%}%> 39 | <% if(theme.twitterpic.enable){ %><%} else {%><%}%> 40 | 41 | <% if (description) { %><%}%> 42 | <% if(theme.twitterpic.enable){ %><%}%> 43 | <% if (description && theme.twitterpic.enable) { %><% } %> 44 | <% if(theme.twitterpic.enable){ %><% } %> 45 | <% if(theme.twitterpic.enable){ %><% } %> 46 | 47 | 48 | 49 | <% if (description) { %><%}%> 50 | <%- css(['css/diaspora.css'])%> 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /layout/_partial/list.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | page.posts.sort("date", "desc").each(function(post, i){ 3 | if (page.prev == 0 && i < start) { 4 | return true; 5 | } 6 | %> 7 | <%- partial('post/item', {post: post}) %> 8 | <% }) %> -------------------------------------------------------------------------------- /layout/_partial/mathjax.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.mathjax){ %> 2 | 9 | 17 | 18 | 20 | <% } %> 21 | -------------------------------------------------------------------------------- /layout/_partial/menu.ejs: -------------------------------------------------------------------------------- 1 | 33 | -------------------------------------------------------------------------------- /layout/_partial/pagination.ejs: -------------------------------------------------------------------------------- 1 | <% if (page.total > 1) { %> 2 | 12 | <% } %> 13 | -------------------------------------------------------------------------------- /layout/_partial/photoswipe.ejs: -------------------------------------------------------------------------------- 1 | <%- css(['/photoswipe/photoswipe.css', '/photoswipe/default-skin/default-skin.css']) %> 2 | <%- js(['/photoswipe/photoswipe.min.js', '/photoswipe/photoswipe-ui-default.min.js']) %> 3 | 4 | 5 | 51 | -------------------------------------------------------------------------------- /layout/_partial/post/article.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

<%- page.title %>

4 |
5 | <%- page.date.locale("zh-cn").format("MMMM DD, YYYY") %> 6 | <%- partial('_partial/post/tag', {post: page}) %> 7 |
8 |
9 | <%- page.content %> 10 | 11 | 14 | <% if (page.mp3 == '' | page.mp3 == null){%> 15 | 24 | <%}%> 25 |
26 | <% if (theme.copyright.enable){ %> 27 | <%- partial("_partial/copyright") %> 28 | <% } %> 29 | <%- partial('gitalk', {post: page}) %> 30 |
31 | <% if (theme.TOC == true){ %> 32 |
33 | <%- toc(page.content, {list_number: true}) %> 34 |
35 | <%}%> 36 |
37 | 38 | -------------------------------------------------------------------------------- /layout/_partial/post/copyright.ejs: -------------------------------------------------------------------------------- 1 |
2 | 75 |
76 | -------------------------------------------------------------------------------- /layout/_partial/post/date.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.date) { %> 2 |
3 | <% if (is_post()) { %> 4 | 5 | <% if (theme.post.show_updated && post.date !== post.updated) { %> 6 | (Updated: ) 7 | <% } %> 8 | <% } else { %> 9 | <% if (is_home() && theme.posts_overview.sort_updated || is_archive() && theme.archive.sort_updated ) { %> 10 | 11 | <% } else { %> 12 | 13 | <% } %> 14 | <% } %> 15 |
16 | <% } %> 17 | -------------------------------------------------------------------------------- /layout/_partial/post/gitalk.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.gitalk != undefined){ %> 2 | 12 | <%}%> 13 | -------------------------------------------------------------------------------- /layout/_partial/post/header.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |

<%- page.title %>

6 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /layout/_partial/post/item.ejs: -------------------------------------------------------------------------------- 1 |
2 | "> 3 | <%- image_tag(post.cover || theme.cover[Math.floor(Math.random() * theme.cover.length)], {class: "cover", width: 680, height: 440}) %> 4 | 5 |
6 |

<%- post.date.locale("zh-cn").format("MMMM DD, YYYY") %>

7 |

<%- link_to(post.path, post.title || "Untitled", {class: "posttitle"}) %>

8 |

<%- truncate(strip_html(post.content), {length: 80, omission: '...'}) %>

9 |
10 |
11 | -------------------------------------------------------------------------------- /layout/_partial/post/tag.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.tags && post.tags.length){ %> 2 | <%- list_tags(post.tags, { 3 | show_count: false, 4 | class: 'post-tags' 5 | }) %> 6 | <% } %> 7 | -------------------------------------------------------------------------------- /layout/_partial/post/title.ejs: -------------------------------------------------------------------------------- 1 | <% if (index) { %> 2 | <% if (post.link) { %> 3 | 4 | <% } else if (post.title) { %> 5 | <%= post.title %> 6 | <% } else { %> 7 | Untitled 8 | <% } %> 9 | <% } else { %> 10 |

11 | <%= post.title %> 12 |

13 | <% } %> 14 | -------------------------------------------------------------------------------- /layout/_partial/screen.ejs: -------------------------------------------------------------------------------- 1 | <% var first = page.posts.sort("date", "desc").eq(0); %> 2 |
3 |
4 |
5 | <%- image_tag(theme.welcome_cover || first.cover || "/img/welcome-cover.jpg", {id: "cover", crossorigin: "anonymous", width: 1920, height: 1080}) %> 6 |
7 |
8 |
9 | 10 | 11 | 12 |
13 |
14 | 23 | <% if ( first ) { %> 24 |
25 |

<%- first.date.locale("zh-cn").format("MMMM DD, YYYY") %>

26 |

<%- link_to(first.path, first.title || config.title, {class: "posttitle"}) %>

27 |

<%- truncate(strip_html(first.content), {length: 60, omission: '...'}) %>

28 |
29 | <% } %> 30 |
31 | -------------------------------------------------------------------------------- /layout/_partial/scripts.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.gitalk.enable){ %><%- js(['//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js'])%><%}%> 2 | <%- js(['//lib.baomitu.com/jquery/1.8.3/jquery.min.js', 'js/plugin.js', 'js/typed.js', 'js/diaspora.js'])%> 3 | <%- partial('photoswipe') %> 4 | -------------------------------------------------------------------------------- /layout/_partial/search.ejs: -------------------------------------------------------------------------------- 1 |
2 |

搜索

3 | 7 |
8 | -------------------------------------------------------------------------------- /layout/_partial/tags.ejs: -------------------------------------------------------------------------------- 1 |
2 |

标签

3 | <%- tagcloud({min_font: 14, max_font: 36, amount: 200, color: true, start_color: '#9E9E9E', end_color: 'gray'}) %> 4 |
5 | -------------------------------------------------------------------------------- /layout/archive.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 |
8 |
9 |
10 |

归档: <%= site.posts.length %>篇


11 | <% var posts = site.posts.sort('date', 'desc'); %> 12 | <% for(let i = 0, year = -1; i < posts.data.length; ++i) { %> 13 | <% 14 | const psg = posts.data[i]; 15 | if(psg.date.year() !== year) { 16 | year = psg.date.year(); 17 | %> 18 |

<%= year %>

19 | <% } %> 20 |
21 | 22 | <%= psg.title %> 23 |
24 | <% } %> 25 |
26 |
27 |
28 |
29 |
30 |
31 | -------------------------------------------------------------------------------- /layout/category.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('index', {pagination: config.tag, index: false}) %> 2 | -------------------------------------------------------------------------------- /layout/index.ejs: -------------------------------------------------------------------------------- 1 | <%- partial("_partial/menu", null, {cache: true}) %> 2 |
3 | <%- partial("_partial/screen", null, {cache: false}) %> 4 |
5 | <%- partial('_partial/list', {start: 1}) %> 6 |
7 | <% if (page.total > 1 && page.next_link){ %> 8 | 9 | <% } %> 10 |
11 |
12 | <% if (theme.beian.enable && theme.beian.enableFooter){ %> 13 |
<%=theme.beian.beianInfo%>
14 | <%}%> 15 | 16 | -------------------------------------------------------------------------------- /layout/layout.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/head') %> 2 | 3 | 4 |
5 | <%- body %> 6 | 7 | <%- partial('_partial/scripts', null, {cache: true}) %> 8 | <%- partial('_partial/mathjax', null, {cache: true}) %> 9 | <%- partial("_partial/google-analytics", {cache: true}) %> 10 | 11 | -------------------------------------------------------------------------------- /layout/page.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 |
7 |
8 |
9 | <% if (page.search || page.type === "search") { %> 10 | <%- partial('_partial/search') %> 11 | <% } else if (page.type === "tags") { %> 12 | <%- partial('_partial/tags') %> 13 | <% } else if (page.type === 'categories') { %> 14 | <%- partial('_partial/categories') %> 15 | <% } else { %> 16 | <%- page.content %> 17 | <% } %> 18 |
19 |
20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /layout/post.ejs: -------------------------------------------------------------------------------- 1 |
2 | <%- partial("_partial/post/header")%> 3 |
4 | <%- partial("_partial/post/article")%> 5 |
6 |
-------------------------------------------------------------------------------- /layout/tag.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('index', {pagination: config.tag, index: false}) %> -------------------------------------------------------------------------------- /scripts/page_title.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Page Title Helper 3 | * @description Generate page title. 4 | * @example 5 | * <%- page_title() %> 6 | */ 7 | hexo.extend.helper.register("page_title", function () { 8 | var title = this.config.title 9 | if (this.config.subtitle) { 10 | title += ' - ' + this.config.subtitle; 11 | } 12 | 13 | if (this.is_archive()) { 14 | title = this.__("nav.archive"); 15 | 16 | if (this.is_month()) { 17 | title += ": " + this.page.year + "/" + this.page.month; 18 | } else if (this.is_year()) { 19 | title += ": " + this.page.year; 20 | } 21 | } else if (this.is_category()) { 22 | title = this.__("nav.category") + ": " + this.page.category + ' - ' + this.config.title; 23 | } else if (this.is_tag()) { 24 | title = this.__("nav.tag") + ": " + this.page.tag + ' - ' + this.config.title; 25 | } else if (this.is_post()) { 26 | title = this.page.title + ' - ' + this.config.title; 27 | } 28 | 29 | return title; 30 | }); 31 | -------------------------------------------------------------------------------- /source/css/diaspora.css: -------------------------------------------------------------------------------- 1 | body,div,h1,h2,h3,h4,h5,p,ul,li {margin:0;padding:0;font-weight:normal;list-style:none;} 2 | html {-webkit-text-size-adjust:100%;} 3 | html,body {-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;background:#fff;} 4 | body {font-family:'PingFang SC','Hiragino Sans GB','Microsoft Yahei','WenQuanYi Micro Hei',sans-serif;font-size:14px;position:relative;overflow-x:hidden;} 5 | body:before {background:grey;position:absolute;content:'';display:block;width:14px;height:14px;left:50%;top:50%;margin-left:-7px;margin-top:-7px;border-radius:50%;-webkit-border-radius:50%;-moz-border-radius:50%;-webkit-animation:loading 2s ease-out forwards infinite;-moz-animation:loading 2s ease-out forwards infinite;display:none;} 6 | body.loading:before {display:block;} 7 | @-webkit-keyframes loading { 8 | 0% {-webkit-transform:scale(0.3);} 9 | 50% {-webkit-transform:scale(1.0);} 10 | 100% {-webkit-transform:scale(0.3);} 11 | } 12 | @-moz-keyframes loading { 13 | 0% {-moz-transform:scale(0.3);} 14 | 50% {-moz-transform:scale(1.0);} 15 | 100% {-moz-transform:scale(0.3);} 16 | } 17 | body.loading #container,body.loading #single,body.loading .nav {opacity:0;} 18 | html.loading,body.loading {height:100%;overflow:hidden;} 19 | a,a:hover {text-decoration:none;} 20 | img {display:block;max-width:100%;height:auto;} 21 | audio {display:none;visibility:hidden;opacity:0;width:0;height:0;} 22 | #screen {position:relative;} 23 | #mark {width:100%;height:560px;overflow:hidden;} 24 | .layer {position:relative;} 25 | #cover {position:absolute;max-width:none;} 26 | #header {position:absolute;top:70px;width:100%;} 27 | #header > div {margin:0 60px;position:relative;} 28 | .icon-menu {font-size:20px;padding:6px 6px 5px;border-radius:2px;cursor:pointer;position:absolute;z-index:4;right:0;top:0;margin-top:-3px;background:rgba(255,255,255,.9);} 29 | .icon-search {font-size:20px;padding:6px 6px 5px;border-radius:2px;cursor:pointer;position:absolute;z-index:4;right:40px;top:0;margin-top:-3px;background:rgba(255,255,255,.9);} 30 | .image-logo {z-index:4;position:relative;display:inline-block;-webkit-background-size:75px 32px;-moz-background-size:75px 32px;background-size:75px 32px;background-repeat:no-repeat;background-position:center center;-webkit-mask-box-image:url("/img/logo.png");background-color:white;width:75px;height:32px;mask-image:url("/img/logo.png");mask-size:contain;transition: background-color 0.5s ease-in-out;} 31 | body.mu .image-logo {background-color:black;} 32 | #vibrant {position:absolute;top:0;left:0;width:100%;height:100%;} 33 | #vibrant div {position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;background-color:#000;} 34 | #post0 {width:28%;position:absolute;top:42%;left:10%;} 35 | #post0 p:first-child {color:#fff;font-size:12px;} 36 | #post0 h2 {font-size:28px;margin-top:15px;} 37 | #post0 h2 a {color:#fff;} 38 | #post0 h2 + p {color:#fff;font-size:14px;margin-top:30px;} 39 | .post {margin:100px auto 0;width:1200px;position:relative;} 40 | .post > a {display:inline-block;width:680px;height:440px;overflow:hidden;position:relative;z-index:3;} 41 | .else {position:absolute;background:#fff;text-align:left;top:20px;height:398px;width:498px;border:1px solid #eaeaea;} 42 | .post:nth-child(odd) {text-align:left;} 43 | .post:nth-child(even) {text-align:right;} 44 | .post:nth-child(odd) .else {left:660px;} 45 | .post:nth-child(even) .else {right:660px;} 46 | .else p:first-child {color:#999;font-size:12px;margin:80px 0 0 80px;} 47 | .else h3 {font-size:30px;line-height:1.1;margin:10px 100px 0 80px;} 48 | .else h3 a {color:#333;} 49 | .else h3 + p {color:#555;margin:10px 100px 0 80px;font-size:14px;line-height:1.8;} 50 | .here {position:absolute;left:80px;bottom:80px;color:#999;font-size:13px;} 51 | .here span {display:inline-block;vertical-align:middle;margin-right:10px;font-family:"icomoon","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;} 52 | .here span:before {display:inline-block;vertical-align:top;margin-right:7px;font-size:16px;} 53 | .here a {display:inline-block;cursor:default;} 54 | #pager {text-align:center;margin:70px 0 0;position:relative;} 55 | #pager a {font-size:14px;letter-spacing:5px;color:#666;border:1px solid #dadada;padding:10px 40px;background:#fff;} 56 | #loader {display:none;position:fixed;top:0;width:100%;height:3px;z-index:100;background-image:-webkit-linear-gradient(left,#F16F5C 0%,#F16F5C 12.5%,#5B56DD 12.5%,#5B56DD 25%,#E15CED 25%,#E15CED 37.5%,#27E559 37.5%,#27E559 50%,#18C8C9 50%,#18C8C9 62.5%,#DC8987 62.5%,#DC8987 75%,#BB83D6 75%,#BB83D6 87.5%,#E774BD 87.5%,#E774BD 100%);background-image:-moz-linear-gradient(left,#F16F5C 0%,#F16F5C 12.5%,#5B56DD 12.5%,#5B56DD 25%,#E15CED 25%,#E15CED 37.5%,#27E559 37.5%,#27E559 50%,#18C8C9 50%,#18C8C9 62.5%,#DC8987 62.5%,#DC8987 75%,#BB83D6 75%,#BB83D6 87.5%,#E774BD 87.5%,#E774BD 100%);} 57 | #top {height:50px;text-align:center;border-bottom:1px solid #f7f7f7;background:#fefefe;width:100%;position:fixed;top:0;z-index:10;display:none;} 58 | body.touch #top {position:relative;} 59 | .icon-icon {color:#333;font-size:20px;position:absolute;left:14px;top:16px;} 60 | .image-icon {-webkit-background-size:24px 24px;-moz-background-size:24px 24px;background-size:24px 24px;background-position:center center;background-repeat:no-repeat;width:24px;height:24px;position:absolute;left:14px;top:15px;color:#333;} 61 | .image-icon:hover {color:black;} 62 | .subtitle {color:#666;font-size:14px;margin-top:16px;display:none;} 63 | .icon-play,.icon-pause,.icon-images {position:absolute;left:70px;color:#666;top:17px;font-size:18px;cursor:pointer;} 64 | .icon-images {left:100px;} 65 | .icon-images.active {color:#EF6D57;} 66 | #top .count {display:none;} 67 | .social {position:absolute;right:0;height:30px;top:12px;} 68 | .share a {display:inline-block;color:#666;margin-right:15px;} 69 | .share a:hover {color:#333;} 70 | .share {position:relative;} 71 | .social > div {display:inline-block;font-size:20px;color:#666;cursor:pointer;margin-left:15px;} 72 | #qr {z-index:10;display:none;position:absolute;background:#fff;padding:16px;border:1px solid #f7f7f7;right:10px;top:50px;} 73 | .bar {position:absolute;height:100%;background:rgba(0,0,0,.07);z-index:-1;width:0;-webkit-transition:width .5s ease;-moz-transition:width .5s ease;transition:width .5s ease;} 74 | .scrollbar {position:absolute;height:2px;width:10px;top:0;background-color:#50bcb6;-webkit-transition:width .5s ease;-moz-transition:width .5s ease;transition:width .5s ease;} 75 | body.touch .scrollbar {display:none;} 76 | .nav {position:fixed;height:100%;width:100%;background:rgba(255,255,255,.97);z-index:3;top:-100%;-webkit-transition:top 0.3s cubic-bezier(0.4,0,0.2,1);-moz-transition:top 0.3s cubic-bezier(0.4,0,0.2,1);transition:top 0.3s cubic-bezier(0.4,0,0.2,1);} 77 | body.mu {overflow:hidden;height:100%;} 78 | html.mu {height:100%;} 79 | body.mu .icon-menu {color:#333;background: none;} 80 | body.mu .icon-search {color:#333;background: none;} 81 | body.mu .icon-menu:before {content:"\e689";} 82 | body.mu .nav {top:0;} 83 | body.mu .icon-logo {color:#333;} 84 | .menu {text-align:center;margin-top:200px;} 85 | .menu ul {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-ms-flex-wrap: wrap;flex-wrap: wrap;list-style-type: none;padding: 0;} 86 | .menu li {font-size:18px;display:inline-block;margin:0 2px 2px 0;} 87 | .menu li:not(:last-child) {margin-right: 5px;} 88 | .menu a {display: block;font-size: 20px;color: #666;text-decoration: none;padding: 5px;margin: auto 10px;border-bottom: .1em solid transparent;} 89 | .menu a:hover {color:#333; border-bottom: .1em solid #9e1900; padding-bottom: .15em; transition: 150ms ease-in-out;} 90 | .nav p {color:#999;font-size:12px;position:absolute;width:100%;text-align:center;bottom:30px;} 91 | .nav p a {color:#999;text-decoration:underline;} 92 | .nav p:first-letter {font-family:sans-serif;} 93 | .nav .hitokoto {text-align:center;font-size: 16px;margin: 10% auto 10px;padding: 10px 20px 10px;color: darkgray;max-width:800;} 94 | .nav .footerlinks {font-size: 45px; margin: 20px 1px 30px;padding: 10px 1px 10px;} 95 | .nav .footerlinks a {font-size: 35px; text-decoration:none;} 96 | .nav .footerlinks a:hover { color: #737373;}/* 鼠标移动到链接上 */ 97 | 98 | .set {display:block;max-width:768px;margin:0 auto 30px;line-height:2;padding-left:30px} 99 | .set h3 {font-size:22px;font-weight:500;margin:15px 0 20px} 100 | .set a {display:inline-block;position:relative;color:#424242;padding:5px 5px;} 101 | .set a::before {content:"";position:absolute;width:0;right:0;bottom:0;height:2px;background:#2196F3} 102 | .set a:hover {color:#2196F3!important} 103 | .set .category-list-item,.set .tag-list-item {display:inline-block;font-size:17px;text-align:left} 104 | .set .category-list-item .category-list-count,.set .category-list-item .tag-list-count,.set .tag-list-item .category-list-count,.set .tag-list-item .tag-list-count {color:#9E9E9E;font-style:normal} 105 | .set .category-list-item .category-list-count::before,.set .category-list-item .tag-list-count::before,.set .tag-list-item .category-list-count::before,.set .tag-list-item .tag-list-count::before {content:"["} 106 | .set .category-list-item .category-list-count::after,.set .category-list-item .tag-list-count::after,.set .tag-list-item .category-list-count::after,.set .tag-list-item .tag-list-count::after {content:"]"} 107 | .set .category-list-item {width:30%;margin:5px 0}@media screen and (max-width:768px) {.set .category-list-item {width:100%}} 108 | .set .tag-list-item {margin:10px 20px} 109 | .set .search .search-input {width: 100%;height: 42px;background: transparent;border: 0px;border-bottom:2px solid #6558BC;font-size:20px;padding-top: 20px;} 110 | .set .search .search-input[type=text]:focus{outline: none;border: 0px;border-bottom:2px solid #6558BC;} 111 | .set .search .local-search-result {margin-top:30px;} 112 | .set .search .search-result-list {padding:0;margin: 0;} 113 | .set .search .search-result-title {font-size:23px;} 114 | .set .search .search-result {} 115 | .set .search .search-keyword {background:yellow;padding:2px auto 2px;} 116 | .set .search li {list-style: none; margin: 0;border-bottom:1px dashed #E3E3E3;} 117 | .timeline {display:block;max-width:768px;margin:30px auto 40px;padding-left:30px;border-left:3px solid #B0BEC5} 118 | .timeline .timeline-title::before,.timeline .timeline-subtitle::before,.timeline .timeline-item::before {position:absolute;top:50%;transform:translateY(-50%);border-style:solid;border-color:#B0BEC5;border-radius:50%;background:white;content:"";transition:all .3s ease} 119 | .timeline-title,.timeline-subtitle,.timeline-item {position:relative;margin-bottom:25px;line-height:32px} 120 | .timeline-title:hover::before,.timeline-subtitle:hover::before,.timeline-item:hover::before {border-color:#2196F3} 121 | .timeline-title:hover a,.timeline-subtitle:hover a,.timeline-item:hover a {color:#2196F3} 122 | .timeline-title {font-size:28px} 123 | .timeline-title::before {width:12px;height:12px;border-width:4px;left:-42px} 124 | .timeline-subtitle {font-weight:400;font-size:22px} 125 | .timeline-subtitle::before {width:11px;height:11px;border-width:3px;left:-40px} 126 | .timeline-item {font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;position:relative;padding-left:100px} 127 | .timeline-item time {position:absolute;left:0;top:50%;transform:translateY(-50%);display:inline-block;font-weight:300;color:#616161;width:100px} 128 | .timeline-item a {color:#212121;font-weight:400;transition:all .3s ease} 129 | .timeline-item::before {width:9px;height:9px;border-width:2px;left:-38px} 130 | #container {padding-bottom:100px;overflow:hidden;position:relative;} 131 | #container:before {content:'';display:block;width:1px;height:200%;position:absolute;left:50%;background:#eaeaea;top:-50%;z-index:0;} 132 | #primary {position:relative;} 133 | #single {background:#fff;position:relative;overflow-x:hidden;} 134 | .section {position:relative;width:100%;overflow:hidden;-webkit-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);-moz-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);} 135 | body.touch,body.touch .article {margin-top:0;} 136 | .zoom:before {opacity:0;color:#fff;font-size:20px;display:block;z-index:3;left:50%;top:70%;padding:5px;margin-top:-15px;margin-left:-15px;position:absolute;background:rgba(0,0,0,.7);-webkit-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);-moz-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);} 137 | .zoom:hover:before {opacity:1;top:50%;} 138 | .touch .zoom:hover:before {opacity:0;} 139 | .icon-arrow-left:before {content:'\e606';position:absolute;left:0;top:50%;margin-top:-30px;color:#666;} 140 | .icon-arrow-right:before {content:'\e605';position:absolute;right:0;top:50%;margin-top:-30px;color:#666;} 141 | h1.title {font-size:30px;color:#333;line-height:1.3;position:relative;font-weight:bold;} 142 | .page .content:before {display:none;} 143 | .stuff {margin-top:20px;color:#666;font-size:13px;} 144 | .stuff span {display:inline-block;margin-right:20px;} 145 | .stuff .likeThis {pointer-events:none;} 146 | .stuff .icon-like {display:none;} 147 | .stuff .count {color:#666;} 148 | .comment {margin:50px auto;} 149 | .comment.link,.downloadlink {cursor:pointer;letter-spacing:5px;border:1px solid #dadada;width:170px;text-align:center;color:#666;font-size:14px;padding:10px 0;} 150 | .comment .gt-comments-null{display:none;} 151 | .comment .gt-header-textarea{border-radius:0;background: white;} 152 | .comment .gt-popup{margin-top:8px;} 153 | .comment .gt-counts a{color:black;border-bottom:0;pointer-events:none;} 154 | .comment .gt-avatar-github{display:none;} 155 | .comment .gt-header-avatar{display:none;} 156 | .comment .gt-header-comment{margin-left: 0;!important;} 157 | .comment .gt-header-preview{border-radius:0;} 158 | .comment .gt-btn-public{border-radius:0;} 159 | .comment .gt-btn-preview{border-radius:0;} 160 | .comment .gt-btn-login{border-radius:0;} 161 | .comment .gt-ico-tip{display:none;} 162 | .comment .gt-btn-public .gt-btn-text:after{content:"(Cmd | Ctrl + Enter)";} 163 | .comment .gt-meta{margin:0; border:0;} 164 | #preview {position:fixed;top:0;width:100%;height:100%;z-index:5;background:#fff;left:100%;-moz-transition:all 0.3s cubic-bezier(0,0,0.2,1);-webkit-transition:all 0.3s cubic-bezier(0,0,0.2,1);transition:all 0.3s cubic-bezier(0,0,0.2,1);overflow-y:scroll;} 165 | #preview.show {left:0;} 166 | #preview + canvas {display:none;} 167 | .article {width:70%;margin:0 auto;margin-top:50px;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-start;justify-content:flex-start;} 168 | .article > div {width:100%;padding:30px 0;margin:0 auto;} 169 | .article .main {width:700px;} 170 | .article .side {align-self:flex-start;flex:0 0 220px;} 171 | .article .toc {width:200px;height:100%;/*position:fixed;*/top:60px;right:100px;padding:1em;line-height:2.3;overflow-y:auto;} 172 | .article .toc .toc-item:hover {font-weight:900;} 173 | .article .toc li a {display:inline-block;color:#737373;text-decoration:none;transition:color,padding 0.2s ease-in-out;} 174 | .article .toc li a:hover {padding-left:8px;border-left:3px solid black;} 175 | .page .main{padding:0px;} 176 | 177 | /* Icon font style */ 178 | @font-face{font-family:"iconfont";src:url(//at.alicdn.com/t/font_1679264_tle9h9614mq.eot?t=1583722241347);src:url(//at.alicdn.com/t/font_1679264_tle9h9614mq.eot?t=1583722241347#iefix) format("embedded-opentype"),url(data:application/x-font-woff2;charset=utf-8;base64,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) format("woff2"),url(//at.alicdn.com/t/font_1679264_tle9h9614mq.woff?t=1583722241347) format("woff"),url(//at.alicdn.com/t/font_1679264_tle9h9614mq.ttf?t=1583722241347) format("truetype"),url(//at.alicdn.com/t/font_1679264_tle9h9614mq.svg?t=1583722241347#iconfont) format("svg")} 179 | .iconfont{font-family:"iconfont"!important;font-size:22px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} 180 | .icon-close:before{content:"\e689"} 181 | .icon-play:before{content:"\e65d"} 182 | .icon-menu:before{content:"\e623"} 183 | .icon-home:before{content:"\e612"} 184 | /*.icon-facebook:before{content:"\e632"}*/ 185 | /*.icon-twitter:before{content:"\e659"}*/ 186 | /*.icon-github:before{content:"\e64a"}*/ 187 | .icon-pause:before{content:"\e64c"} 188 | .icon-scan:before{content:"\e600"} 189 | .icon-search:before{content:"\e601"} 190 | /*.icon-email:before{content:"\e62d"}*/ 191 | .icon-like:before{content:"\e602"} 192 | /*.icon-wechat:before{content:"\e603"}*/ 193 | .icon-left:before{content:"\e604"} 194 | 195 | @font-face { 196 | font-family: "iconfont"; /* Project id 2609542 */ 197 | src: url('//at.alicdn.com/t/font_2609542_9phvm77zuvw.woff2?t=1623581069201') format('woff2'), 198 | url('//at.alicdn.com/t/font_2609542_9phvm77zuvw.woff?t=1623581069201') format('woff'), 199 | url('//at.alicdn.com/t/font_2609542_9phvm77zuvw.ttf?t=1623581069201') format('truetype'); 200 | } 201 | 202 | .iconfont { 203 | font-family: "iconfont" !important; 204 | font-size: 22px; 205 | font-style: normal; 206 | -webkit-font-smoothing: antialiased; 207 | -moz-osx-font-smoothing: grayscale; 208 | } 209 | 210 | .icon-github:before { 211 | content: "\e7d1"; 212 | } 213 | 214 | .icon-email:before { 215 | content: "\e6da"; 216 | } 217 | 218 | .icon-wechat:before { 219 | content: "\e7e3"; 220 | } 221 | 222 | .icon-twitter:before { 223 | content: "\e7e2"; 224 | } 225 | 226 | 227 | /* tags style */ 228 | .post-tags-list {margin-top:10px;display:table;} 229 | .post-tags-list-item {float:left;margin-right:10px;background:rgba(102,128,153,0.075);border-radius:0;padding:2px 5px;} 230 | .post-tags-list-link {color:rgba(44,63,81,0.5);} 231 | 232 | /* Post or Page content style */ 233 | .content {margin-top:50px;font-size:15px;line-height:2;color:#232323;} 234 | .content h1 {font-size:39px} 235 | .content h2 {font-size:32px} 236 | .content h3 {font-size:26px} 237 | .content h4 {font-size:19px} 238 | .content h5 {font-size:15px} 239 | .content h6 {font-size:13px} 240 | .content strong {font-weight:500;} 241 | .content a {background:transparent;color:#1980e6;text-decoration:none;} 242 | .content a:hover {color:#518dca;} 243 | .content hr {margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid rgba(102,128,153,0.1)} 244 | .content p {margin:0 0 .8em;} 245 | .content ul,.content ol {margin:10px 0;padding-left:20px;} 246 | .content ul li {list-style:disc;margin:5px 0;} 247 | .content ol li {list-style:decimal;margin:5px 0;} 248 | .content > h1,.content > h2,.content > h3,.content > h4,.content > h5,.content > h6 {margin-top:2rem;margin-bottom:0.8rem;color:#000;} 249 | .content > h1:first-child,.content > h2:first-child,.content > h3:first-child,.content > h4:first-child,.content > h5:first-child,.content > h6:first-child {margin-top:0;} 250 | .content img {cursor:pointer;} 251 | .content pre,.content .highlight {background:#2d2d2d;margin:1.6rem 0;padding:0.8rem 0.8rem;border-style:solid;border-width:1px 0;overflow:auto;color:#ccc;line-height:20px;} 252 | .content .gutter {display:none;} 253 | .content .highlight .gutter pre {color:#666;font-size:0.9rem;} 254 | .content code,.content pre {font-family:"Source Code Pro",monospace} 255 | .content code {background:rgba(99,99,99,0.07);color:#ef459c;padding:1px 2px;border-radius:2px;} 256 | .content pre code {background:none;text-shadow:none;padding:0;} 257 | .content blockquote {color:#656565;margin:0 0 1.1em;border-left:3px solid #efefef;border-left-width:6px;background-color:rgba(119,119,119,0.05);border-top-right-radius:5px;border-bottom-right-radius:5px;padding:15px 20px;} 258 | .content blockquote p {margin:0;} 259 | .content table {margin:15px 0;border-collapse:collapse;display:table;width:100%;table-layout:fixed;word-wrap:break-word;} 260 | .content table tr {border-top:1px solid #ccc;background-color:#fff;} 261 | .content table th,.content table td {border:1px solid #ddd;padding:6px 13px;} 262 | .content .highlight pre {border:none;margin:0;padding:0;} 263 | .content .highlight table {margin:0;width:auto;} 264 | .content .highlight td {border:none;padding:0;} 265 | .content .highlight tr {border:0;} 266 | .content .highlight figcaption {font-size:0.85em;color:#999;line-height:1em;margin-bottom:1em;} 267 | .content .highlight figcaption a {float:right;} 268 | .content .highlight .gutter pre {text-align:right;padding-right:20px;} 269 | .content .highlight .line {height:20px;} 270 | .content .video-container {position:relative;padding-bottom:56.25%;padding-top:25px;height:0;} 271 | .content .video-container iframe {position:absolute;top:0;left:0;width:100%;height:100%;} 272 | pre .comment,pre .title {color:#999;} 273 | pre .variable,pre .attribute,pre .tag,pre .regexp,pre .ruby .constant,pre .xml .tag,pre .title,pre .xml .pi,pre .xml .doctype,pre .html .doctype,pre .css .id,pre .css .class,pre .css .pseudo {color:#f2777a;} 274 | pre .number,pre .preprocessor,pre .built_in,pre .literal,pre .params,pre .constant {color:#f99157;} 275 | pre .class,pre .ruby .class .title,pre .css .rules .attribute {color:#99cc99;} 276 | pre .string,pre .value,pre .inheritance,pre .header,pre .ruby .symbol,pre .xml .cdata {color:#99cc99;} 277 | pre .css .hexcolor {color:#66cccc;} 278 | pre .function,pre .python .decorator,pre .python .title,pre .ruby .function .title,pre .ruby .title .keyword,pre .perl .sub,pre .javascript .title,pre .coffeescript .title {color:#6699cc;} 279 | pre .keyword,pre .javascript .function {color:#cc99cc;} 280 | 281 | /* Responsive style */ 282 | @media screen and (max-width:1200px) { 283 | #header > div {width:900px;margin:0 auto;} 284 | #post0 {width:32%;} 285 | #post0 h2 {font-size:24px;} 286 | .post {width:900px;} 287 | .post > a {width:480px;height:310px;} 288 | .else {top:10px;width:420px;height:290px;} 289 | .post:nth-child(odd) .else {left:450px;} 290 | .post:nth-child(even) .else {right:450px;} 291 | .else p:first-child {font-size:12px;margin:50px 0 0 60px;} 292 | .else h3 {font-size:24px;margin:10px 60px 0 60px;} 293 | .else h3 + p {margin:10px 60px 0 60px;} 294 | .here {left:60px;bottom:50px;} 295 | .article{width:100%;} 296 | .article .main{width:94%;} 297 | .article .side {display:none} 298 | .comment .gt-btn-public .gt-btn-text:after{content:"";} 299 | } 300 | @media screen and (max-width:900px) { 301 | #mark {height:480px;} 302 | #header > div {width:90%;} 303 | #vibrant polygon {transform:translateX(-10%);-moz-transform:translateX(-10%);-webkit-transform:translateX(-10%);} 304 | #post0 {width:40%;} 305 | #post0 h2 {font-size:20px;} 306 | .post {width:100%;margin-top:60px;background:#fff;padding-bottom:30px;border-bottom:1px solid #eaeaea;} 307 | .post > a {display:block;margin:0 auto;width:100%;height:auto;} 308 | .post > a img {margin:0 auto;} 309 | .else {height:auto;position:static;width:100%;margin:0 auto;background:transparent;border:none;} 310 | .else p:first-child {margin:30px 0 0 20px;} 311 | .else h3 {font-size:24px;margin:10px 30px 0 20px;} 312 | .else h3 + p {margin:10px 30px 0 20px;} 313 | .here {position:static;margin:20px 0 20px 20px;} 314 | .article{width:100%;} 315 | .article .main{width:94%;} 316 | .article .side {display:none} 317 | .comment .gt-btn-public .gt-btn-text:after{content:"";} 318 | } 319 | @media screen and (max-width:780px) { 320 | #header {top:40px;} 321 | #vibrant svg {display:none;} 322 | #vibrant div {opacity:0.3;} 323 | #container {padding-bottom:50px;} 324 | #post0 {bottom:60px;top:auto;width:70%;left:5%;} 325 | .menu {width:90%;margin:160px auto 0;} 326 | .menu li {font-size:16px;} 327 | #pager {margin:30px 0 0;} 328 | h1.title {font-size:24px;} 329 | .tab {display:none;} 330 | .icon-scan {display:none!important;} 331 | .icon-images {left:80px;} 332 | .icon-pause,.icon-play {left:50px;} 333 | .comment.link {width:140px;padding:5px 0;} 334 | .article{width:100%;} 335 | .article .main{width:94%;} 336 | .article .side {display:none} 337 | .comment .gt-btn-public .gt-btn-text:after{content:"";} 338 | } 339 | @media screen and (max-width:480px) { 340 | #post0 p:first-child {display:block;} 341 | #container:before {display:none;} 342 | #post0 h2 {text-align:left;margin:0 10px 0 0;} 343 | #post0 h2 + p {text-align:left;margin:10px 20px 0 0;color:#f2f2f2;font-size:14px;} 344 | #post0 h2 a {color:#fff;} 345 | #post0 .summary {display:none;} 346 | .stuff span {margin-right:10px;} 347 | .stuff span:first-child {display:none;} 348 | .content table {font-size:smaller;} 349 | .content table tr td {padding:6px;} 350 | .article {width:100%;} 351 | .article .main{width:94%;} 352 | .article .side {display:none} 353 | .comment .gt-btn-public .gt-btn-text:after{content:"";} 354 | } 355 | -------------------------------------------------------------------------------- /source/img/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/cover.jpg -------------------------------------------------------------------------------- /source/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/favicon.png -------------------------------------------------------------------------------- /source/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/logo.png -------------------------------------------------------------------------------- /source/img/welcome-cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/welcome-cover.jpg -------------------------------------------------------------------------------- /source/js/diaspora.js: -------------------------------------------------------------------------------- 1 | var Home = location.href, 2 | Pages = 4, 3 | xhr, 4 | xhrUrl = ''; 5 | 6 | var Diaspora = { 7 | L: function(url, f, err) { 8 | if (url == xhrUrl) { 9 | return false; 10 | } 11 | xhrUrl = url; 12 | if (xhr) { 13 | xhr.abort(); 14 | } 15 | xhr = $.ajax({ 16 | type: 'GET', 17 | url: url, 18 | timeout: 10000, 19 | success: function(data) { 20 | f(data); 21 | xhrUrl = ''; 22 | }, 23 | error: function(a, b, c) { 24 | if (b == 'abort') { 25 | err && err() 26 | } else { 27 | window.location.href = url; 28 | } 29 | xhrUrl = ''; 30 | } 31 | }); 32 | }, 33 | P: function() { 34 | return !!('ontouchstart' in window); 35 | }, 36 | PS: function() { 37 | if (!(window.history && history.pushState)){ 38 | return; 39 | } 40 | history.replaceState({u: Home, t: document.title}, document.title, Home); 41 | window.addEventListener('popstate', function(e) { 42 | var state = e.state; 43 | if (!state) return; 44 | document.title = state.t; 45 | 46 | if (state.u == Home) { 47 | $('#preview').css('position', 'fixed'); 48 | setTimeout(function() { 49 | $('#preview').removeClass('show'); 50 | $('#container').show(); 51 | window.scrollTo(0, parseInt($('#container').data('scroll'))); 52 | setTimeout(function() { 53 | $('#preview').html(''); 54 | $(window).trigger('resize'); 55 | }, 300); 56 | }, 0); 57 | } else { 58 | Diaspora.loading(); 59 | Diaspora.L(state.u, function(data) { 60 | document.title = state.t; 61 | $('#preview').html($(data).filter('#single')); 62 | Diaspora.preview(); 63 | setTimeout(function() { Diaspora.player(); }, 0); 64 | }); 65 | } 66 | }); 67 | }, 68 | HS: function(tag, flag) { 69 | var id = tag.data('id') || 0, 70 | url = tag.attr('href'), 71 | title = tag.attr('title') + " - " + $("#config-title").text(); 72 | 73 | if (!$('#preview').length || !(window.history && history.pushState)) location.href = url; 74 | Diaspora.loading() 75 | var state = {d: id, t: title, u: url}; 76 | Diaspora.L(url, function(data) { 77 | if (!$(data).filter('#single').length) { 78 | location.href = url; 79 | return 80 | } 81 | switch (flag) { 82 | case 'push': 83 | history.pushState(state, title, url) 84 | break; 85 | case 'replace': 86 | history.replaceState(state, title, url) 87 | break; 88 | } 89 | document.title = title; 90 | $('#preview').html($(data).filter('#single')) 91 | switch (flag) { 92 | case 'push': 93 | Diaspora.preview() 94 | break; 95 | case 'replace': 96 | window.scrollTo(0, 0) 97 | Diaspora.loaded() 98 | break; 99 | } 100 | setTimeout(function() { 101 | Diaspora.player(); 102 | $('#top').show(); 103 | comment = $("#gitalk-container"); 104 | if (comment.data('ae') == true){ 105 | comment.click(); 106 | } 107 | }, 0) 108 | if (window.MathJax) { 109 | var math = document.getElementById("single") 110 | MathJax.Hub.Queue(["Typeset", MathJax.Hub, math]) 111 | } 112 | }) 113 | }, 114 | preview: function() { 115 | // preview toggle 116 | $("#preview").one('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function() { 117 | var previewVisible = $('#preview').hasClass('show'); 118 | if (!!previewVisible) { 119 | $('#container').hide(); 120 | }else{ 121 | $('#container').show(); 122 | } 123 | Diaspora.loaded(); 124 | }); 125 | setTimeout(function() { 126 | $('#preview').addClass('show'); 127 | $('#container').data('scroll', window.scrollY); 128 | setTimeout(function() { 129 | $('#preview').css({ 130 | 'position': 'static', 131 | 'overflow-y': 'auto' 132 | }); 133 | }, 500); 134 | }, 0); 135 | }, 136 | player: function() { 137 | var p = $('#audio'); 138 | if (!p.length) { 139 | $('.icon-play').css({ 140 | 'color': '#dedede', 141 | 'cursor': 'not-allowed' 142 | }) 143 | return 144 | } 145 | var sourceSrc= $("#audio source").eq(0).attr('src') 146 | if (sourceSrc == '' && p[0].src == ''){ 147 | audiolist = $('#audio-list li'); 148 | mp3 = audiolist.eq([Math.floor(Math.random() * audiolist.size())]) 149 | p[0].src = mp3.data('url') 150 | } 151 | 152 | if (p.eq(0).data("autoplay") == true) { 153 | p[0].play(); 154 | } 155 | 156 | p.on({ 157 | 'timeupdate': function() { 158 | var progress = p[0].currentTime / p[0].duration * 100; 159 | $('.bar').css('width', progress + '%'); 160 | if (progress / 5 <= 1) { 161 | p[0].volume = progress / 5; 162 | }else { 163 | p[0].volume = 1; 164 | } 165 | }, 166 | 'ended': function() { 167 | $('.icon-pause').removeClass('icon-pause').addClass('icon-play') 168 | }, 169 | 'playing': function() { 170 | $('.icon-play').removeClass('icon-play').addClass('icon-pause') 171 | } 172 | }) 173 | }, 174 | loading: function() { 175 | var w = window.innerWidth; 176 | var css = ''; 181 | $('.loaderstyle').remove() 182 | $('head').append(css) 183 | $('#loader').removeClass().addClass('loader'+ w).show() 184 | }, 185 | loaded: function() { 186 | $('#loader').removeClass().hide() 187 | }, 188 | F: function(id, w, h) { 189 | var _height = $(id).parent().height(), 190 | _width = $(id).parent().width(), 191 | ratio = h / w; 192 | if (_height / _width > ratio) { 193 | id.style.height = _height +'px'; 194 | id.style.width = _height / ratio +'px'; 195 | } else { 196 | id.style.width = _width +'px'; 197 | id.style.height = _width * ratio +'px'; 198 | } 199 | id.style.left = (_width - parseInt(id.style.width)) / 2 +'px'; 200 | id.style.top = (_height - parseInt(id.style.height)) / 2 +'px'; 201 | } 202 | }; 203 | 204 | $(function() { 205 | if (Diaspora.P()) { 206 | $('body').addClass('touch') 207 | } 208 | if ($('#preview').length) { 209 | var cover = {}; 210 | cover.t = $('#cover'); 211 | cover.w = cover.t.attr('width'); 212 | cover.h = cover.t.attr('height'); 213 | ;(cover.o = function() { 214 | $('#mark').height(window.innerHeight) 215 | })(); 216 | if (cover.t.prop('complete')) { 217 | // why setTimeout ? 218 | setTimeout(function() { cover.t.load() }, 0) 219 | } 220 | cover.t.on('load', function() { 221 | ;(cover.f = function() { 222 | var _w = $('#mark').width(), _h = $('#mark').height(), x, y, i, e; 223 | e = (_w >= 1000 || _h >= 1000) ? 1000 : 500; 224 | if (_w >= _h) { 225 | i = _w / e * 50; 226 | y = i; 227 | x = i * _w / _h; 228 | } else { 229 | i = _h / e * 50; 230 | x = i; 231 | y = i * _h / _w; 232 | } 233 | $('.layer').css({ 234 | 'width': _w + x, 235 | 'height': _h + y, 236 | 'marginLeft': - 0.5 * x, 237 | 'marginTop': - 0.5 * y 238 | }) 239 | if (!cover.w) { 240 | cover.w = cover.t.width(); 241 | cover.h = cover.t.height(); 242 | } 243 | Diaspora.F($('#cover')[0], cover.w, cover.h) 244 | })(); 245 | setTimeout(function() { 246 | $('html, body').removeClass('loading') 247 | }, 1000) 248 | $('#mark').parallax() 249 | var vibrant = new Vibrant(cover.t[0]); 250 | var swatches = vibrant.swatches() 251 | if (swatches['DarkVibrant']) { 252 | $('#vibrant polygon').css('fill', swatches['DarkVibrant'].getHex()) 253 | $('#vibrant div').css('background-color', swatches['DarkVibrant'].getHex()) 254 | } 255 | if (swatches['Vibrant']) { 256 | $('.icon-menu').css('color', swatches['Vibrant'].getHex()) 257 | $('.icon-search').css('color', swatches['Vibrant'].getHex()) 258 | } 259 | }) 260 | if (!cover.t.attr('src')) { 261 | alert('Please set the post thumbnail') 262 | } 263 | $('#preview').css('min-height', window.innerHeight) 264 | Diaspora.PS() 265 | $('.pview a').addClass('pviewa') 266 | var T; 267 | $(window).on('resize', function() { 268 | clearTimeout(T) 269 | T = setTimeout(function() { 270 | if (!Diaspora.P() && location.href == Home) { 271 | cover.o() 272 | cover.f() 273 | } 274 | if ($('#loader').attr('class')) { 275 | Diaspora.loading() 276 | } 277 | }, 500) 278 | }) 279 | } else { 280 | $('#single').css('min-height', window.innerHeight) 281 | setTimeout(function() { 282 | $('html, body').removeClass('loading') 283 | }, 1000) 284 | window.addEventListener('popstate', function(e) { 285 | if (e.state) location.href = e.state.u; 286 | }) 287 | Diaspora.player(); 288 | $('.icon-icon, .image-icon').attr('href', '/') 289 | $('#top').show() 290 | } 291 | $(window).on('scroll', function() { 292 | if ($('.scrollbar').length && !Diaspora.P() && !$('.icon-images').hasClass('active')) { 293 | var wt = $(window).scrollTop(), 294 | tw = $('#top').width(), 295 | dh = document.body.scrollHeight, 296 | wh = $(window).height(); 297 | var width = tw / (dh - wh) * wt; 298 | $('.scrollbar').width(width) 299 | if (wt > 80 && window.innerWidth > 800) { 300 | $('.subtitle').fadeIn() 301 | } else { 302 | $('.subtitle').fadeOut() 303 | } 304 | } 305 | }) 306 | $(window).on('touchmove', function(e) { 307 | if ($('body').hasClass('mu')) { 308 | e.preventDefault() 309 | } 310 | }) 311 | 312 | //搜搜 313 | var searchFunc = function(path, search_id, content_id) { 314 | 'use strict'; //使用严格模式 315 | $.ajax({ 316 | url: path, 317 | dataType: "xml", 318 | success: function( xmlResponse ) { 319 | // 从xml中获取相应的标题等数据 320 | var datas = $( "entry", xmlResponse ).map(function() { 321 | return { 322 | title: $( "title", this ).text(), 323 | content: $("content",this).text(), 324 | url: $( "url" , this).text() 325 | }; 326 | }).get(); 327 | //ID选择器 328 | var $input = document.getElementById(search_id); 329 | var $resultContent = document.getElementById(content_id); 330 | $input.addEventListener('input', function(){ 331 | var str='