Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and enhancements. [5] #1311

Merged
merged 19 commits into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ copyright: true
# Tips: Before you open this tag, remeber set up your URL in hexo _config.yml ( ex. url: http://yourdomain.com )
canonical: true

# Change headers hierarchy on site-subtitle (will be main site description) and on all post/pages titles for better SEO-optimization.
seo: false

# ---------------------------------------------------------------
# Menu Settings
Expand Down Expand Up @@ -211,6 +213,7 @@ auto_excerpt:

# Post meta display settings
post_meta:
item_text: true
created_at: true
updated_at: false
categories: true
Expand Down
4 changes: 2 additions & 2 deletions layout/_macro/post-collapse.swig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<article class="post post-type-{{ post.type | default('normal') }}" itemscope itemtype="http://schema.org/Article">
<header class="post-header">

<h1 class="post-title">
<{% if theme.seo %}h2{% else %}h1{% endif %} class="post-title">
{% if post.link %}{# Link posts #}
<a class="post-title-link post-title-link-external" target="_blank" href="{{ url_for(post.link) }}" itemprop="url">
{{ post.title or post.link }}
Expand All @@ -18,7 +18,7 @@
{% endif %}
</a>
{% endif %}
</h1>
</{% if theme.seo %}h2{% else %}h1{% endif %}>

<div class="post-meta">
<time class="post-time" itemprop="dateCreated"
Expand Down
26 changes: 18 additions & 8 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

{# Not to show title for quote posts that do not have a title #}
{% if not (is_index and post.type === 'quote' and not post.title) %}
<h1 class="post-title" itemprop="name headline">
<{% if theme.seo %}h2{% else %}h1{% endif %} class="post-title" itemprop="name headline">
{# Link posts #}
{% if post.link %}
{% if post.sticky > 0 %}
Expand All @@ -56,7 +56,7 @@
{{ post.title }}
{% endif %}
{% endif %}
</h1>
</{% if theme.seo %}h2{% else %}h1{% endif %}>
{% endif %}

<div class="post-meta">
Expand All @@ -65,7 +65,9 @@
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">{{ __('post.posted') }}</span>
{% if theme.post_meta.item_text %}
<span class="post-meta-item-text">{{ __('post.posted') }}</span>
{% endif %}
<time title="{{ __('post.created') }}" itemprop="dateCreated datePublished" datetime="{{ moment(post.date).format() }}">
{{ date(post.date, config.date_format) }}
</time>
Expand All @@ -79,7 +81,9 @@
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">{{ __('post.modified') }}</span>
{% if theme.post_meta.item_text %}
<span class="post-meta-item-text">{{ __('post.modified') }}</span>
{% endif %}
<time title="{{ __('post.modified') }}" itemprop="dateModified" datetime="{{ moment(post.updated).format() }}">
{{ date(post.updated, config.date_format) }}
</time>
Expand All @@ -88,11 +92,15 @@

{% if post.categories and post.categories.length and theme.post_meta.categories %}
<span class="post-category" >
{% if theme.post_meta.created_at or theme.post_meta.updated_at %}
<span class="post-meta-divider">|</span>
{% endif %}
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">{{ __('post.in') }}</span>
{% if theme.post_meta.item_text %}
<span class="post-meta-item-text">{{ __('post.in') }}</span>
{% endif %}
{% for cat in post.categories %}
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="{{ url_for(cat.path) }}" itemprop="url" rel="index">
Expand Down Expand Up @@ -157,9 +165,11 @@
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">{{__('post.visitors')}} </span>
<span class="leancloud-visitors-count"></span>
</span>
{% if theme.post_meta.item_text %}
<span class="post-meta-item-text">{{__('post.visitors')}} </span>
{% endif %}
<span class="leancloud-visitors-count"></span>
</span>
{% endif %}

{% if not is_index and theme.busuanzi_count.enable and theme.busuanzi_count.page_pv %}
Expand Down
15 changes: 9 additions & 6 deletions layout/_macro/sidebar.swig
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@
<p class="site-description motion-element" itemprop="description">{{ theme.description }}</p>
</div>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="{{ url_for(theme.menu.archives) }}">
<span class="site-state-item-count">{{ site.posts.length }}</span>
<span class="site-state-item-name">{{ __('state.posts') }}</span>
</a>
</div>

{% if config.archive_dir != '/' %}
<div class="site-state-item site-state-posts">
<a href="{{ url_for(theme.menu.archives) }}">
<span class="site-state-item-count">{{ site.posts.length }}</span>
<span class="site-state-item-name">{{ __('state.posts') }}</span>
</a>
</div>
{% endif %}

{% if site.categories.length > 0 %}
<div class="site-state-item site-state-categories">
Expand Down
6 changes: 5 additions & 1 deletion layout/_partials/header.swig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle">{{ config.subtitle }}</p>
{% if theme.seo %}
<h1 class="site-subtitle" itemprop="description">{{ config.subtitle }}</h1>
{% else %}
<p class="site-subtitle">{{ config.subtitle }}</p>
{% endif %}
</div>

<div class="site-nav-toggle">
Expand Down
5 changes: 4 additions & 1 deletion source/css/_schemes/Pisces/_brand.styl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
&:hover { color: white; }
}

.site-subtitle { margin: 0; }
.site-subtitle {
margin: 10px 10px 0;
font-family: monospace;
}

.site-search form { display: none; }
10 changes: 9 additions & 1 deletion source/css/_schemes/Pisces/_layout.styl
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@
padding: 0;
width: 240px;
background: white;
box-shadow: $box-shadow-inner;
border-radius: $border-radius-inner;

+desktop-large() {
.container & { width: 240px; }
}
+tablet() {
position: relative;
width: auto;
border-radius: initial;
}
+mobile() {
position: relative;
width: auto;
border-radius: initial;
}
}

Expand Down Expand Up @@ -60,15 +64,19 @@
width: $content-desktop;
background: white;
min-height: 700px;
box-shadow: $box-shadow-inner;
border-radius: $border-radius-inner;

+tablet() {
width: 100%;
padding: 20px;
border-radius: initial;
}
+mobile() {
width: 100%;
padding: 20px;
min-height: auto;
border-radius: initial;
}
}

Expand All @@ -77,7 +85,7 @@
float: left;
margin-top: 300px;
width: $sidebar-desktop;
background: white;
background: $body-bg-color;
box-shadow: none;

+tablet() {
Expand Down
2 changes: 2 additions & 0 deletions source/css/_schemes/Pisces/_sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
width: 240px;
color: $text-color;
background: white;
box-shadow: $box-shadow;
border-radius: $border-radius;

&.affix {
position: fixed;
Expand Down
2 changes: 0 additions & 2 deletions source/css/_schemes/Pisces/index.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
body { background: #f5f7f9; }

@import "_full-image";
@import "_layout";
@import "_brand";
Expand Down
15 changes: 15 additions & 0 deletions source/css/_variables/Pisces.styl
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// Scaffolding
// Settings for some of the most global styles.
// --------------------------------------------------
$body-bg-color = #f5f7f9


// Borders
// --------------------------------------------------
$box-shadow-inner = initial;
$box-shadow = initial;

$border-radius-inner = initial;
$border-radius = initial;


// Header
// --------------------------------------------------
$subtitle-color = $gray-lighter
Expand Down