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
7 changes: 7 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ post_copyright:
enable: false
license: <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 4.0</a>

# Post edit
# Dependencies: https://github.com/hexojs/hexo-deployer-git
post_edit:
enable: true
url: https://github.com/theme-next/theme-next.org/_posts/tree/master/ # Link for view source.
# url: https://github.com/theme-next/theme-next.org/_posts/edit/master/ # Link for fork & edit.


# ---------------------------------------------------------------
# Misc Theme Settings
Expand Down
1 change: 1 addition & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sidebar:
post:
created: Post created
modified: Post modified
edit: Edit this post
sticky: Sticky
posted: Posted on
in: In
Expand Down
1 change: 1 addition & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sidebar:
overview: 站点概览
toc: 文章目录
post:
edit: 编辑
created: 创建于
modified: 更新于
sticky: 置顶
Expand Down
19 changes: 13 additions & 6 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,19 @@
<i class="fa fa-thumb-tack"></i>
</span>
{% endif %}
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">{#
#}{{ post.title | default(__('post.untitled'))}}{#
#}</a>{#
#}{% else %}{{ post.title }}{% endif %}{#
#}{% endif %}{#
#}</{% if theme.seo %}h2{% else %}h1{% endif %}>
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">
{{ post.title | default(__('post.untitled'))}}
</a>
{% else -%}
{{- post.title -}}
{% if theme.post_edit.enable -%}
<a href="{{ theme.post_edit.url }}{{ post.source.slice(7) }}" class="post-edit-link" title="{{ __('post.edit') }}" target="_blank">
<i class="fa fa-pencil"></i>
</a>
{%- endif %}
{% endif %}
{% endif %}
</{% if theme.seo %}h2{% else %}h1{% endif %}>
{% endif %}

<div class="post-meta">
Expand Down
15 changes: 14 additions & 1 deletion source/css/_common/components/post/post-title.styl
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
.posts-expand .post-title {
text-align: center;
word-break: break-word;
font-weight: $posts-expand-title-font-weight
font-weight: $posts-expand-title-font-weight;

.post-edit-link {
color: #bbb;
display: block;
float: right;
border-bottom: none;
the-transition-ease-in();

&:hover {
color: black;
}
}
}

.posts-expand .post-title-link {
display: inline-block;
position: relative;
Expand Down