Skip to content

Commit

Permalink
Merge pull request #1886 from Haocen/master
Browse files Browse the repository at this point in the history
Options to better control footer.
  • Loading branch information
ivan-nginx authored Sep 28, 2017
2 parents 1145c74 + 4a24e47 commit 22bbabe
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 22 deletions.
31 changes: 22 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,28 @@ keywords: "Hexo, NexT"
# Set rss to specific value if you have burned your feed already.
rss:

# Specify the date when the site was setup
#since: 2015

# icon between year and author @Footer
authoricon: heart

# Footer `powered-by` and `theme-info` copyright
copyright: true

footer:
# Specify the date when the site was setup.
# If not defined, current year will be used.
#since: 2015

# Icon between year and copyright info.
icon: user

# If not defined, will be used `author` from Hexo main config.
copyright:
# -------------------------------------------------------------
# Hexo link (Powered by Hexo).
powered: true

theme:
# Theme & scheme info link (Theme - NexT.scheme).
enable: true
# Version info of NexT after scheme info (vX.X.X).
version: true
# -------------------------------------------------------------
# Any custom text can be defined here.
#custom_text: Hosted by <a target="_blank" href="https://pages.github.com">GitHub Pages</a>

# ---------------------------------------------------------------
# SEO Settings
Expand Down
36 changes: 23 additions & 13 deletions layout/_partials/footer.swig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="copyright" >
{% set current = date(Date.now(), "YYYY") %}
&copy; {% if theme.since and theme.since != current %} {{ theme.since }} &mdash; {% endif %}
<span itemprop="copyrightYear">{{ current }}</span>
<div class="copyright">{#
#}{% set current = date(Date.now(), "YYYY") %}{#
#}&copy; {% if theme.footer.since and theme.footer.since != current %}{{ theme.footer.since }} &mdash; {% endif %}{#
#}<span itemprop="copyrightYear">{{ current }}</span>
<span class="with-love">
<i class="fa fa-{{ theme.authoricon }}"></i>
<i class="fa fa-{{ theme.footer.icon }}"></i>
</span>
<span class="author" itemprop="copyrightHolder">{{ config.author }}</span>
<span class="author" itemprop="copyrightHolder">{{ theme.footer.copyright || config.author }}</span>

{% if theme.post_wordcount.totalcount %}
<span class="post-meta-divider">|</span>
Expand All @@ -15,23 +15,33 @@
{% if theme.post_wordcount.item_text %}
<span class="post-meta-item-text">{{ __('post.totalcount') }}&#58;</span>
{% endif %}
<span title="{{ __('post.totalcount') }}">
{{ totalcount(site, '0,0.0a') }}
</span>
<span title="{{ __('post.totalcount') }}">{#
#}{{ totalcount(site, '0,0.0a') }}{#
#}</span>
{% endif %}
</div>

{% if theme.copyright %}
{% if theme.footer.powered %}
<div class="powered-by">{#
#}{{ __('footer.powered', '<a class="theme-link" href="https://hexo.io">Hexo</a>') }}{#
#}{{ __('footer.powered', '<a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a>') }}{#
#}</div>
{% endif %}

{% if theme.footer.powered and theme.footer.theme.enable %}
<span class="post-meta-divider">|</span>
{% endif %}

{% if theme.footer.theme.enable %}
<div class="theme-info">{#
#}{{ __('footer.theme') }} &mdash; {#
#}<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">{#
#}<a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">{#
#}NexT.{{ theme.scheme }}{#
#}</a> v{{ theme.version }}{#
#}</a>{% if theme.footer.theme.version %} v{{ theme.version }}{% endif %}{#
#}</div>
{% endif %}

{% if theme.footer.custom_text %}
<div class="footer-custom">{#
#}{{ theme.footer.custom_text }}{#
#}</div>
{% endif %}

0 comments on commit 22bbabe

Please sign in to comment.