Skip to content

Commit

Permalink
pjax and more
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Nov 25, 2017
1 parent d5052f8 commit df8cc74
Show file tree
Hide file tree
Showing 50 changed files with 684 additions and 1,066 deletions.
23 changes: 14 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ menu:
home: / || home
archives: /archives/ || archive
投喂: /donate/ || cutlery
后宫: /links/ || mars
后宫: /friends/ || mars
留言板: /message/ || pencil
about: /about/ || rocket

Expand Down Expand Up @@ -99,7 +99,7 @@ scheme: Pisces
social:
GitHub: https://github.com/DIYgod || github
Twitter: https://twitter.com/DIYgod || twitter
QQ 群: https://diygod.b0.upaiyun.com/qq-g.jpg || qq
QQ 群: /images/qq-g.jpg || qq || qq
Telegram Channel: https://t.me/awesomeDIYgod || telegram
更多: https://www.anotherhome.net/3163 || more

Expand Down Expand Up @@ -270,7 +270,7 @@ font:

# Global font settings used on <body> element.
global:
external: true
external: false
family: Lato
size:

Expand Down Expand Up @@ -300,6 +300,9 @@ font:
family:
size:

title:
external: true
family: Sigmar One

# ---------------------------------------------------------------
# Third Party Services Settings
Expand All @@ -326,7 +329,7 @@ han: false
# Disqus
disqus:
enable: true
shortname: DIYgod
shortname: diygod-me
count: false

# Hypercomments
Expand Down Expand Up @@ -761,10 +764,7 @@ css: css
js: js
images: images

# Theme version
version: 0.0.1

header_bg: https://diygod.b0.upaiyun.com/header-sagiri.jpg
header_bg: /images/header-sagiri.jpg

card:
avatar: /images/card.jpg
Expand Down Expand Up @@ -794,4 +794,9 @@ footer:
# Any custom text can be defined here.
custom_text: custom text
sitemap: /sitemap.xml
beian: 鲁ICP备xxxx号
beian: xxxx

online_api:

# Theme version
version: 0.0.4
1 change: 0 additions & 1 deletion layout/_layout.swig
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@

<script type="text/javascript" src="{{ url_for(theme.js) }}/sagiri.min.js?v={{ theme.version }}"></script>

{% include '_third-party/comments/index.swig' %}
{% include '_third-party/search/index.swig' %}
{% include '_third-party/seo/baidu-push.swig' %}
{% include '_third-party/needsharebutton.swig' %}
Expand Down
2 changes: 1 addition & 1 deletion layout/_macro/sidebar.swig
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
{% if theme.creative_commons in cc %}
<div class="cc-license motion-element" itemprop="license">
<a href="https://creativecommons.org/{% if theme.creative_commons === 'zero' %}publicdomain/zero/1.0{% else %}licenses/{{ theme.creative_commons }}/4.0{% endif %}/" class="cc-opacity" target="_blank">
<img src="{{ url_for(theme.images) }}/cc-{{ theme.creative_commons }}.svg" alt="Creative Commons" />
<img src="{{ url_for(theme.images) }}/cc-{{ theme.creative_commons }}.png" alt="Creative Commons" />
</a>
</div>
{% endif %}
Expand Down
5 changes: 1 addition & 4 deletions layout/_partials/comments.swig
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
<strong>Disqus 加载中...</strong>
<p>如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理</p>
</div>
<noscript>
Please enable JavaScript to view the
<a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
</div>
</div>

Expand Down Expand Up @@ -73,3 +69,4 @@
{% endif %}

{% endif %}
{% include '../_third-party/comments/index.swig' %}
1 change: 1 addition & 0 deletions layout/_partials/head.swig
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
tabs: {{ theme.tabs.enable }},
motion: {{ theme.motion | json_encode }},
since: '{{ theme.footer.since }}',
onlineAPI: '{{ theme.online_api }}',
site: {
title: '{{ theme.title }}',
subtitle: '{{ theme.subtitle }}',
Expand Down
8 changes: 8 additions & 0 deletions layout/_partials/head/external-fonts.swig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
{% set font_families += font_config.codes.family + font_styles %}
{% endif %}

{% if font_config.title.family and font_config.title.external %}
{% if font_found %}
{% set font_families += '|' %}
{% endif %}

{% set font_families += font_config.title.family + font_styles %}
{% endif %}

{% if font_families !== '' %}
{% set font_families += '&subset=latin,latin-ext' %}
{% set font_host = font_config.host | default('//fonts.googleapis.com') %}
Expand Down
20 changes: 19 additions & 1 deletion layout/_partials/header.swig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
</a>
</li>
{% endif %}
<li class="menu-item search">
<form class="search-form">
<input name="keyword" type="text" class="search-input" placeholder="站内搜索">
<button type="submit" class="search-submit"><i class="fa fa-search"></i></button>
</form>
</li>
<li class="menu-item online"><span id="online-count">?</span>人在线</li>
</ul>
{% endif %}

Expand All @@ -53,7 +60,18 @@
<div class="custom-logo-site-title">
<div class="brand">
<span class="logo-line-before"><i></i></span>
<span class="site-title"></span>
<div class="site-title">
<div id="animate" class="animate">
{% for letter in config.title %}{#
#}<span>{{ letter }}</span>{#
#}{% endfor %}
</div>
<div id="guide" class="guide">
{% for letter in config.title %}{#
#}<span>{{ letter }}</span>{#
#}{% endfor %}
</div>
</div>
<span class="logo-line-after"><i></i></span>
</div>
</div>
Expand Down
38 changes: 29 additions & 9 deletions layout/_third-party/comments/disqus.swig
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,35 @@

{% if page.comments %}
<script type="text/javascript">
var disqus_config = function () {
this.page.url = '{{ page.permalink }}';
this.page.identifier = '{{ page.path }}';
this.page.title = '{{ page.title| addslashes }}';
};
var d = document, s = d.createElement('script');
s.src = 'https://{{theme.disqus.shortname}}.disqus.com/embed.js';
s.setAttribute('data-timestamp', '' + +new Date());
(d.head || d.body).appendChild(s);
if (disqus_config) {
var disqus_config = function () {
this.page.url = '{{ page.permalink }}';
this.page.identifier = '{{ page.path }}';
this.page.title = '{{ page.title| addslashes }}';
};
if (window.DISQUS) {
$('.disqus-loading').remove();
window.DISQUS.reset({
reload: true,
config: function () {
this.page.url = '{{ page.permalink }}';
this.page.identifier = '{{ page.path }}';
this.page.title = '{{ page.title| addslashes }}';
}
});
}
}
else {
var disqus_config = function () {
this.page.url = '{{ page.permalink }}';
this.page.identifier = '{{ page.path }}';
this.page.title = '{{ page.title| addslashes }}';
};
var d = document, s = d.createElement('script');
s.src = 'https://{{theme.disqus.shortname}}.disqus.com/embed.js';
s.setAttribute('data-timestamp', '' + +new Date());
(d.head || d.body).appendChild(s);
}
</script>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion layout/category.swig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{######################}
{### CATEGORY BLOCK ###}
{######################}
<div class="post-block category">
<div class="post-block category post">

<div id="posts" class="posts-collapse">
<div class="collection-title">
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
"corner-notie": "1.2.1",
"fancybox": "3.0.0",
"fastclick": "1.0.6",
"gsap": "1.20.3",
"headroom.js": "0.9.4",
"jquery-pjax": "2.0.1",
"lazyload": "2.0.0-beta.2",
"leancloud-storage": "3.3.1",
"nprogress": "0.2.0",
"social-share.js": "1.0.16",
"typed.js": "2.0.6",
"velocity-animate": "1.5.0"
Expand Down
4 changes: 2 additions & 2 deletions source/css/_common/components/sidebar/sidebar-nav.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
&:hover { color: $sidebar-nav-hover-color; }
}

.page-post-detail .sidebar-nav-toc { padding: 0 5px; }
.sidebar-nav-toc { padding: 0 5px; }

.page-post-detail .sidebar-nav-overview { margin-left: 10px; }
.sidebar-nav-overview { margin-left: 10px; }

.sidebar-nav .sidebar-nav-active {
color: $sidebar-highlight;
Expand Down
2 changes: 1 addition & 1 deletion source/css/_common/components/tags/group-pictures.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.post .group-picture-column { float: left; }

.page-post-detail .post-body .group-picture-column {
.post-body .group-picture-column {
float: none;
margin-top: 10px;
width: auto !important;
Expand Down
1 change: 0 additions & 1 deletion source/css/_common/components/third-party/third-party.styl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
@import "algolia-search" if hexo-config('algolia_search.enable');
@import "needsharebutton" if hexo-config('needmoreshare2.enable');
@import "headroom";
@import "balloon";
2 changes: 1 addition & 1 deletion source/css/_mixins/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ desktop() {
}

desktop-large() {
@media (min-width: 1600px) {
@media (max-width: 0px) {
{block}
}
}
Expand Down
7 changes: 6 additions & 1 deletion source/css/_schemes/Pisces/_archive.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.archive {
.archive,
.category {
.posts-collapse {
z-index: 0;
}
Expand All @@ -12,3 +13,7 @@
background: none;
}
}

.category .collection-title {
margin-top: 30px;
}
16 changes: 14 additions & 2 deletions source/css/_schemes/Pisces/_brand.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
position: relative;
top: 180px;
font-size: 68px;
font-weight: 700;
text-align: center;
text-shadow: 0 1px 1px #47456d;
margin-bottom: 130px;
z-index: 1;
font-family: Optima, "PingFang SC", "Microsoft YaHei", Lato, sans-serif;
font-family: $font-family-title;
display: block;

+mobile() {
font-size: 7.8vw;
Expand All @@ -44,3 +44,15 @@
}

.site-search form { display: none; }

.site-title {
.guide {
visibility: hidden;
pointer-events: none;
}

.animate span {
position: absolute;
opacity: 0;
}
}
48 changes: 48 additions & 0 deletions source/css/_schemes/Pisces/_menu.styl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
position: relative;
text-align: left;
margin: 0 20px 0 0;
color: #fff;

+mobile() {
flex: 1;
Expand Down Expand Up @@ -82,6 +83,53 @@
}

br { display: none; }

&.online {
float: right;
font-size: 12px;
margin: 0;

+mobile() {
display: none;
}
}

&.search {
float: right;
margin: 0 0 0 20px;

&:hover {
.search-input {
padding: 3px 7px;
width: 100px;
}
}

.search-input {
border: none;
border-radius: 2px;
color: #555;
font-size: 12px;
outline: none;
width: 0;
padding: 3px 0;
transition: all 0.5s ease-in-out;
}

.search-submit {
cursor: pointer;
margin-left: 5px;
background: none;
padding: 0;
border: none;
outline: none;

i {
font-size: 17px;
margin: 0;
}
}
}
}

.btn-bar {
Expand Down
2 changes: 2 additions & 0 deletions source/css/_variables/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ $font-family-posts = get_font_family('posts'), $font-family-base if get_f
$font-family-monospace = consolas, Menlo, $font-family-chinese, monospace
$font-family-monospace = get_font_family('codes'), consolas, Menlo, $font-family-chinese, monospace if get_font_family('codes')

$font-family-title = get_font_family('title')

$font-family-icons = 'FontAwesome'


Expand Down
8 changes: 8 additions & 0 deletions source/css/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ for $mixin in $mixins
// Custom Layer
// --------------------------------------------------
@import "_custom/custom";

@import "../../node_modules/nprogress/nprogress.css"

#nprogress .bar {
background: #97dffd;
}

@import "../../node_modules/balloon-css/balloon.css"
Binary file modified source/images/card.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/cc-by-nc-nd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit df8cc74

Please sign in to comment.