Skip to content
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
6 changes: 2 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,18 +287,16 @@ compress_html:
ignore:
envs: development


# Defaults
defaults:
# _posts
- scope:
path: ""
type: posts
values:
toc: true
layout: single
author_profile: true
show_date: true
read_time: true
comments: # true
share: true
related: true
related: true
38 changes: 38 additions & 0 deletions _includes/article-sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% if page.toc or page.author_profile %}
<div class="sidebar sticky">
<!-- Author information (displayed only on article page) -->
{% if page.author_profile or layout.author_profile %}
{% include author-profile.html %}
{% endif %}

<!-- Article contents -->
{% if page.toc %}
<div class="toc-wrapper">
<h3>目录</h3>
{% include toc.html sanitize=true html=content h_min=2 h_max=3 %}
</div>
{% endif %}

<!-- Customize sidebar content -->
{% if page.sidebar %}
{% for s in page.sidebar %}
{% if s.image %}
<img src="{{ s.image | relative_url }}"
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}"
class="sidebar-image">
{% endif %}
{% if s.title %}<h3>{{ s.title }}</h3>{% endif %}
{% if s.text %}{{ s.text | markdownify }}{% endif %}
{% if s.nav %}{% include nav_list nav=s.nav %}{% endif %}
{% endfor %}
{% endif %}

<!-- Related articles recommendations -->
{% if page.id and page.related %}
<div class="related-posts">
<h3>相关文章</h3>
{% include page__related.html posts=site.related_posts %}
</div>
{% endif %}
</div>
{% endif %}
6 changes: 3 additions & 3 deletions _layouts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div id="main" role="main">
<div class="layout-container">
<aside class="sidebar">
{% include sidebar.html %}
{% include article-sidebar.html %}
</aside>

<article class="page" itemscope itemtype="https://schema.org/CreativeWork"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>
Expand All @@ -43,14 +43,14 @@ <h1 id="page-title" class="page__title" itemprop="headline">
{% endunless %}

<section class="page__content" itemprop="text">
{% if page.toc %}
<!-- {% if page.toc %}
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
<nav class="toc">
<header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label | default: "On this page" }}</h4></header>
{% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" skip_no_ids=true %}
</nav>
</aside>
{% endif %}
{% endif %} -->
{{ content }}
{% if page.link %}<div><a href="{{ page.link }}" class="btn btn--primary">{{ site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}</a></div>{% endif %}
</section>
Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-05-17-sublime.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: article
layout: single
title: Install GoSublime and ctags on Ubuntu or Mac
category: golang
---
Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-09-01-first.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: article
layout: single
title: Go Slice Study Notes
category: golang
---
Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-09-04-first.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: article
layout: single
title: ubuntu下有线连接显示线缆已拔出
category: linux
---
Expand Down
2 changes: 1 addition & 1 deletion _posts/2016-02-02-schema-change-implement.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: article
layout: single
title: TiDB 的异步 schema 变更实现
---

Expand Down
2 changes: 1 addition & 1 deletion _posts/2017-12-24-optimize.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: article
layout: single
title: TiDB 的异步 schema 变更优化
---

Expand Down
Loading