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

Add more seo things #85

Merged
merged 3 commits into from Jan 24, 2018

Conversation

@wafer-li
Copy link
Member

commented Jan 24, 2018

Port from https://github.com/wafer-li/hexo-theme-next-reloaded/commit/ec845557e0e34948ef18b72cb9216eb9c934b10e

Add external+nofollow for social and powered when seo on

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe: Enhancement

What is the current behavior?

The social links and the powered links don't have rel="external nofollow"

What is the new behavior?

Add rel="external nofollow" to social links and powered links, when seo enable

How to use?

In NexT _config.yml:

No change to config

Does this PR introduce a breaking change?

  • Yes.
  • No.
wafer-li added 2 commits Jan 24, 2018
Port from https://github.com/wafer-li/hexo-theme-next-reloaded/commit/ec845557e0e34948ef18b72cb9216eb9c934b10e
Add external+nofollow for social and powered when seo on
<div class="powered-by">{#
#}{{ __('footer.powered', '<a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a>') }}{#

This comment has been minimized.

Copy link
@ivan-nginx

ivan-nginx Jan 24, 2018

Member

Can u here do like above, without hexo_link_tag variable?

This comment has been minimized.

Copy link
@wafer-li

wafer-li Jan 24, 2018

Author Member

I have no idea about whether the {% if %} tags works within the __() as a string.

It is not autocompleted by Atom when I type if in the string.

This comment has been minimized.

Copy link
@ivan-nginx

ivan-nginx Jan 24, 2018

Member

Ok, i'll see it later, don't merge.

@@ -34,9 +34,13 @@
{% endif %}
</div>

{% if theme.seo %}
{% set nofollow = ' rel="external nofollow"' %}

This comment has been minimized.

Copy link
@ivan-nginx

ivan-nginx Jan 24, 2018

Member

Just like this.

This comment has been minimized.

Copy link
@wafer-li

wafer-li Jan 24, 2018

Author Member

OK, I will adopt it in sidebar.swig

This comment has been minimized.

Copy link
@ivan-nginx

ivan-nginx Jan 24, 2018

Member

No, there is no needed because there are single conditions.

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

This comment has been minimized.

Copy link
@ivan-nginx

ivan-nginx Jan 24, 2018

Member

I mean here like this.
U insert any variable into __lang with single quote delimeter.

This comment has been minimized.

Copy link
@wafer-li

wafer-li Jan 24, 2018

Author Member

OK.
Merge it now.

@wafer-li wafer-li added this to the v6.0.3 milestone Jan 24, 2018
@wafer-li wafer-li merged commit 7bb669f into master Jan 24, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@ivan-nginx ivan-nginx deleted the add-more-seo branch Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.