Skip to content

Commit

Permalink
added: new comment changyan.
Browse files Browse the repository at this point in the history
  • Loading branch information
Longlongyu committed Jul 16, 2018
1 parent c699f81 commit 8ac1789
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
.vscode
_config_.yml
_config__.yml
_config.yml
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hexo-theme-Cxo
# hexo-theme-Cxo
A cool ,simple & beautiful theme for Hexo. 🍄

<img src="./source/img/demo/demo.png"/>
Expand Down Expand Up @@ -70,7 +70,6 @@ subtitle:
# 显示在网站的上banner图,如果不设置,默认都为site_header_image,site_header_image为必选项
site_header_image:
post_header_image:
_404_image:
about_header_image:
# —————————— Indivdual —————————— #
Expand Down Expand Up @@ -98,7 +97,10 @@ comment:
# Livere site: https://livere.com/
livere_uid:
# Disqus site: https://disqus.com/
disqus_shortname: longlongyu
disqus_shortname:
# Changyan site: http://changyan.kuaizhan.com/
changyan_appid:
changyan_conf:
```

## License
Expand Down
6 changes: 3 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ subtitle: Welcome to my Blog!
site_header_image: '/img/intro/index-bg.png'
# post haeder image
post_header_image:
# 404 image
_404_image:
# about image
about_header_image:

# —————————— Indivdual —————————— #
# Miscelaneous
favicon: /img/assets/favicon.ico

# —————————— Option —————————— #
# truncate length of abstracts in index page (the default is 300, there will be no abstruct if you input 0)
truncate_length:
Expand All @@ -63,6 +60,9 @@ comment:
livere_uid:
# Disqus site: https://disqus.com/
disqus_shortname:
# Changyan site: http://changyan.kuaizhan.com/
changyan_appid:
changyan_conf:

# —————————— Others —————————— #
# main menu navigation
Expand Down
5 changes: 5 additions & 0 deletions layout/includes/comment/changyan.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if(theme.comment && theme.comment.changyan_appid && theme.comment.changyan_conf)
#SOHUCS(sid=url_for(page.path))
script(charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/changyan.js")
script.
window.changyan.api.config({appid: theme.comment.changyan_appid, conf: theme.comment.changyan_conf});
9 changes: 3 additions & 6 deletions layout/includes/partial/header.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ if (is_home())
- bgURL = theme.site_header_image
else if (is_post())
- bgURL = theme.post_header_image || theme.site_header_image
else if (page.layout === '404')
- bgURL = theme._404_image || theme.site_header_image
else if (is_tag())
- bgURL = theme.tag_header_image || theme.site_header_image
else if (page.layout === 'about')
- bgURL = theme.about_header_image || theme.site_header_image
else if (is_archive())
- bgURL = theme.about_header_image || theme.site_header_image
- bgURL = theme.archive_header_image || theme.site_header_image
else
- bgURL = theme.site_header_image
- let bgStyle = `background-image: url(${bgURL});`
header#cxo-intro(style= introStyle + bgStyle)
include nav.pug
- if (is_post()){
h1.post-title= page.title
- } else if (page.layout === '404') {
h1= page.title || '[404]'
h5= page.description
- } else {
h1= theme.main_title || config.title
h5= theme.subtitle
Expand Down
1 change: 1 addition & 0 deletions layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ block content
#comment
include includes/comment/livere.pug
include includes/comment/disqus.pug
include includes/comment/changyan.pug

0 comments on commit 8ac1789

Please sign in to comment.