Permalink
Browse files

Typography comes into being.

  • Loading branch information...
SumiMakito committed Sep 22, 2017
0 parents commit 1a65fff78e3a01935a0816522e4725f0c68a3b69
Showing with 27,233 additions and 0 deletions.
  1. +7 −0 LICENSE
  2. +116 −0 README.md
  3. +15 −0 _config.yml
  4. +14 −0 languages/en.yml
  5. +14 −0 languages/zh-cn.yml
  6. +14 −0 languages/zh-tw.yml
  7. +17 −0 layout/archive.jade
  8. +15 −0 layout/category.jade
  9. +9 −0 layout/index.jade
  10. +83 −0 layout/mixins.jade
  11. +14 −0 layout/page.jade
  12. +62 −0 layout/partial/comments.jade
  13. +12 −0 layout/partial/footer.jade
  14. +26 −0 layout/partial/head.jade
  15. +23 −0 layout/partial/layout.jade
  16. +33 −0 layout/partial/nav.jade
  17. +9 −0 layout/partial/sidebar.jade
  18. +42 −0 layout/post.jade
  19. +15 −0 layout/tag.jade
  20. +32 −0 package.json
  21. +260 −0 raw/scss/animation.scss
  22. +524 −0 raw/scss/style.scss
  23. +492 −0 source/css/blog_basic.css
  24. +6 −0 source/css/bootstrap.min.css
  25. +4 −0 source/css/font-awesome.min.css
  26. +54 −0 source/css/jquery.simplyscroll.css
  27. +377 −0 source/css/lightslider.css
  28. +607 −0 source/css/style.css
  29. BIN source/fonts/fontawesome-webfont.eot
  30. +520 −0 source/fonts/fontawesome-webfont.svg
  31. BIN source/fonts/fontawesome-webfont.ttf
  32. BIN source/fonts/fontawesome-webfont.woff
  33. BIN source/images/favicon.png
  34. +51 −0 source/images/pigeon.svg
  35. +12 −0 source/images/test.html
  36. +2,377 −0 source/js/bootstrap.js
  37. +7 −0 source/js/bootstrap.min.js
  38. +1,504 −0 source/js/duoshuo.js
  39. +14 −0 source/js/google-analytics.js
  40. +4 −0 source/js/jquery-3.1.0.min.js
  41. +2 −0 source/js/jquery-migrate-1.2.1.min.js
  42. +101 −0 source/js/jquery.appear.js
  43. +9,555 −0 source/js/jquery.js
  44. +27 −0 source/js/jquery.simplyscroll.min.js
  45. +16 −0 source/js/jquery.slimscroll.min.js
  46. +4 −0 source/js/lightslider.min.js
  47. +13 −0 source/js/npm.js
  48. +46 −0 source/js/typography.js
  49. +10,078 −0 source/js/vue.js
  50. +6 −0 source/js/vue.min.js
@@ -0,0 +1,7 @@
Copyright 2017 Makito <master@keep.moe>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
116 README.md
@@ -0,0 +1,116 @@
hexo-theme-Typography
======
Typography – Rediscover the beauty of typography.
## Install
### Install dependencies
```bash
cd hexo # cd into the root directory of your Hexo blog
npm install --save hexo-renderer-jade hexo-generator-archive
git clone https://github.com/SumiMakito/hexo-theme-typography themes/typography
cd theme/typography
npm install
```
> You can skip the second line provided you have already installed `hexo-renderer-jade` and `hexo-generator-archive` in your Hexo blog's root directory.
### Modify the config file
Find `theme:` in your `_config.yml` at the root directory of your Hexo blog, and change that line into `theme: typography`, then add these lines:
```yaml
archive_generator:
per_page: 0
```
## Update
```bash
cd themes/typography
git pull
```
> You may encounter the error `modified: themes/typography` if you are managing the whole blog with `git`. In that case, instead of using `git push`, we recommend you to download the zip and update the theme manually.
## Customize
Typography has packed up several labor-saving functions, thus you can easily make any change at any time in the `_config.yml` file located in the root directory of the theme.
### Change the language
Modify the `.yml` files in `themes/typography/languages` or add new files according to your need.
### Auto truncate
It is possible to control the length for all the summaries on the index page by setting a value for `truncate_len`. The default length is 160.
e.g. `truncate_len: 160`
### Set up the comment service
The comment box is a place for readers to exchange their ideas with the author. Typography has integrated two 3rd-party comment services, and they are ready to use at any time.
Currently, Typography supports comment services provided by [Disqus](https://disqus.com/) and [LiveRe](https://livere.com/). The only thing you need to do is to set the corresponding key for the comment service that you would like to use.
e.g. `disqus: disqus_shortname` OR `livere: livere_data_uid`
> Do not use two comment services at the same time, or the post will be followed by two comment boxes. Just leave blank for the rest of the comment service-related options.
### SEO-friendly meta description tag
Typography gives you the chance to insert unique SEO-friendly meta description tags for different posts. Also, it is handy. Just add a new line in the head section of your post:
```yaml
title: Another post
date: 1970-01-01 00:00
desc: Description to be inserted into the metadata of the post page.
---
```
Then the generated HTML file will contain:
```html
<meta name="description" content="Description to be inserted into the metadata of the post page.">
```
> If `desc` is not specified, the first 140 words of the post will be used as the description.
### Icons for social network accounts
Typography natively supports the following social network accounts:
- Twitter
- GitHub
- Instagram
- Sina Weibo
To use light up those icons, just simply set the values for the corresponding options.
```yaml
twitter: user_name
weibo: user_id/permanent_name
instagram: user_name
github: user_name
```
> Tips: leave blanks to remove the icons from the site.
## Customize<sup>2</sup>
Typography uses `node-sass` and `scss-compile` to generate `.css` files for styling. We have provided several options such as background and foreground colors for you to choose. When your editing is finished, don't forget to run the commands below to re-generate the `.css` files:
```bash
cd theme/typography
node scss-compile
```
## Customize<sup>3</sup>
As for the jade templates inside `theme/typography/layout`, just edit them and remember to add some pepper as you like it.
## License
Typography is released under the MIT license.
@@ -0,0 +1,15 @@
title_primary: "活版印字" # the bigger text
title_secondary: "Typography" # the smaller text
keywords:
twitter: # user_name
rss: atom.xml
weibo: # user_id/permanent_name
instagram: # user_name
github: # user_name
# Choose the comment service according to your need.
# Please do not use the two services at the same time.
livere: # [data-uid] on livere.com
disqus: # [short_name] on disqus.com
dove: # For fun ONLY. Set to true to 'disable' comments on your site.
@@ -0,0 +1,14 @@
share: Share
prev: Previous
next: Next
prev_post: Previous post
next_post: Next post
Home: Home
Albums: Albums
Categories: Categories
Archive: Archive
Tags: Tags
About: About
Links: Links
Comments: Comments
posted_at: Posted at
@@ -0,0 +1,14 @@
share: 分享到
prev: 上一页
next: 下一页
prev_post: 上一篇
next_post: 下一篇
Home: 首页
Albums: 相册
Categories: 分类
Archive: 归档
Tags: 标签
About: 关于
Links: 链接
Comments: 评论
posted_at: 发布于
@@ -0,0 +1,14 @@
share: 分享到
prev: 上一頁
next: 下一頁
prev_post: 上一篇
next_post: 下一篇
Home: 首頁
Albums: 相簿
Categories: 分類
Archive: 歸檔
Tags: 標籤
About: 關於
Links: 連結
Comments: 評論
posted_at: 發佈於
@@ -0,0 +1,17 @@
extends partial/layout
block site_title
!= __("Archive") + " · " + config.title
block description
- var desc = __("Archive") +' - ' + config.title;
meta(name="description", content=desc)
block content
.autopagerize_page_element: .content
.archive.animated.fadeInDown
ul.list-with-title
include mixins
+postList()
include mixins
+make_pager(__('prev'), __('next'))
@@ -0,0 +1,15 @@
extends partial/layout
block site_title
!= page.category + " · " + config.title
block description
- var desc = __("Categories")+': ' + page.category + ' - ' + config.title;
meta(name="description", content=desc)
block content
.autopagerize_page_element: .content
.archive.animated.fadeInDown
ul.list-with-title
include mixins
+postList()
@@ -0,0 +1,9 @@
extends partial/layout
block content
.autopagerize_page_element: .content
- page.posts.each(function (item) {
include mixins
+make_post(item, false)
- })
include mixins
+make_pager(__('prev'), __('next'))
@@ -0,0 +1,83 @@
mixin make_post(item, is_detail)
div.post-container
p.post-title
if is_detail
a= item.title
else
a(href= url_for(item.path))= item.title
p.post-meta
span.date.meta-item!=__("posted_at")+"&nbsp;" + date(item.date, 'YYYY-MM-DD')
if !is_detail
if theme.duoshuo || theme.disqus
span.meta-item
i.fa.fa-comment-o
span &nbsp;
a(href= url_for(item.path + "#comments"))= __('Comments')
if item.tags.length > 0
span.meta-item
i.fa.fa-tag
span &nbsp;
- item.tags.sort('posts').each(function(item) {
a.a-tag(href=config.root + item.path, title= item.name)= item.name
span &nbsp;
- });
if is_detail
p.post-abstract!= item.content
else
p.post-abstract!= truncate(strip_html(item.content), {length: 160})
mixin make_page_links()
if site.pages
- site.pages.each(function (page) {
li
if is_current(page.path)
a.current(href=config.root+page.path)= page.title
else
a(href=config.root+page.path)= page.title
- });
mixin make_pager()
- var prev = page.prev_link
- var next = page.next_link
.pagination.no-margin-bottom
p.clearfix
if page.prev
span.pre.pagbuttons
i.fa.fa-angle-double-right
| &nbsp;
a(role="navigation",href=url_for(prev))= __('prev')
span &nbsp;
if page.next
span.next.pagbuttons
a(role="navigation",href=url_for(next))= __('next')
| &nbsp;
i.fa.fa-angle-double-right
mixin postList()
.archive
- var year = 0;
- var change = false;
- var firstYear = true;
- page.posts.each(function (item) {
- var itemYear = date(item.date, 'YYYY') - 0;
- change = year !== itemYear;
- year = change ? itemYear : year;
if change
if firstYear
| <div class="listing-title">
h4.ar-year!= year
| </div><ul class="listing">
- firstYear = false;
else
| </ul><div class="listing-title">
h4.ar-year!= year
| </div><ul class="listing">
.listing-item
.listing-post
p.post-title
a(href= url_for(item.path), title= item.title)= item.title
div.post-time
span.ar-date= date(item.date, 'MM-DD')
- })
@@ -0,0 +1,14 @@
extends partial/layout
block site_title
!= page.title + " · " + config.title
block description
- var desc = page.desc || strip_html(page.content).replace(/^\s*/, '').replace(/\s*$/, '').substring(0, 150);
meta(name="description", content=desc)
block content
.autopagerize_page_element: .content: .post-page
include mixins
+make_post(page, true)
include partial/comments
@@ -0,0 +1,62 @@
if theme.disqus
a#comments
#disqus_thread
script.
var disqus_shortname = '#{theme.disqus}';
var disqus_identifier = '#{page.path}';
var disqus_title = '#{page.title}';
var disqus_url = '#{config.url}/#{page.path}';
(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(id='dsq-count-scr' src='//#{theme.disqus}.disqus.com/count.js' async)
if theme.livere
#lv-container(data-id='city', data-uid='#{theme.livere}')
script(type='text/javascript').
(function (d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') {
return;
}
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');
noscript Please activate JavaScript for write a comment in LiveRe
if theme.dove
if theme.dove === true
- var domain = "Null";
- var matches = /https?:\/\/([^\/]+)/.exec(config.url);
- if(matches!==null&&matches.length>=2){
- var hostname = matches[1].split(":")[0].split(".");
- if(hostname.length>=2){
- domain = hostname[hostname.length-2] + "." + hostname[hostname.length-1];
- }else if(hostname.length==1){
- domain = hostname[hostname.length-1];
- }
- }
div.foreground.background-text(style="color: #fff; padding: 10px 25px; width: 100%")
div(style="vertical-align: middle;display: table-cell!important;")
div.visible-lg.visible-sm.visible-md(style="vertical-align: middle;text-align:center;margin-right:15px")
img(src="/images/pigeon.svg", width="150px", style="padding: 15px; vertical-align: middle;")
p(style="font-size: 55%;vertical-align: middle;text-align:center;margin: 0") 咕咕咕, 就快送到了
div(style="padding: 15px 0;vertical-align: middle;display: table-cell;")
p(style="font-size: 115%") 哎呀,似乎评论系统在您的地区都无法正常工作。
p(style="margin:0;") 不过不要担心,来看看我们为您准备的备用方案 ——
br
| 1. 将您的评论用信封装好
br
| 2. 使用信鸽函至&nbsp;
!= domain
br
| 3. 我们在收到您的评论后将立即审核并更新至网站
br
i
small 评论一经采用,信函恕不退还,信鸽也不退还,请知悉。
Oops, something went wrong.

0 comments on commit 1a65fff

Please sign in to comment.