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

Fixes and enhancements. [5] #1311

Merged
merged 19 commits into from
Dec 20, 2016
Merged

Fixes and enhancements. [5] #1311

merged 19 commits into from
Dec 20, 2016

Conversation

ivan-nginx
Copy link
Collaborator

@ivan-nginx ivan-nginx commented Dec 14, 2016

Part 1. Some small fixes.

Files modified:

  • Fix: categories divider in posts. 56347e4
    image

  • Fix: hide archives in sidebar if in main hexo config archive_dir set to /. ed64a99

#archive_dir: archives
archive_dir: /
...
archive_generator:
per_page: 0
  yearly: false
  monthly: false
  daily: false

This mean what archives will generate in public root dir by hexo, so, state item in sidebar is no needed.

  • Add: css style for best look for site-subtitle (only for Pisces style). e88a214, 823d0de
    image

Part 2. SEO enhancement.

Files modified:

  1. SEO: add seo variable in config. 3f002c8
  2. SEO: add h1 and itemprop="description" on site-subtitle (defined in config.subtitle variable). 7a2a4ea
  3. SEO: add h1-h2 switcher in post. f8f69ad
  4. SEO: add h1-h2 switcher in post-collapse. 6a97fdf

Why this need?

This option change headers hierarchy, basic on most popular search engines. Headers hierarchy very important for structured optimization data. Reference for post about headers structure there.

If SEO is false then:

<p>Site description</p>
<h1>Post title</h1>
<h2>## Post subtitle 2</h2>
<h3>### Post subtitle 3</h3>
<h4>#### Post subtitle 4</h3>

If SEO is true then:

<h1>Site description</h1>
<h2>Post title</h2>
<h3>### Post subtitle 3</h3>
<h4>#### Post subtitle 4</h4>
<h5>##### Post subtitle 5</h5>

How to use?

  1. In main Hexo _config.yml:
subtitle: Your site main description here (~100 symbols will be nice).
  1. In _config.yml of Next theme:
# Change headers hierarchy on site-subtitle (will be main site description) and on all post/pages titles for better SEO-optimization.
seo: true

Default is false.

  1. In all posts switch down all headers hierarchy. If your subtitles in posts was h2, need to change them to h3, if h3 — to h4, etc.

Part 3. Post Meta Item Text option.

Files modified:

  1. Meta-Item-Text: add item_text variable. fb8f989
  2. Meta-Item-Text: add e/d switchers. c6c9cea

This option is enabled by default and mean to appear meta item text on elements:

  1. Created date.
  2. Updated date.
  3. Categories.
  4. Leancloud visitors count.

If set to false text after the icon of this elements will not show. Keep it mind — this text always is index by search engines and for seo is good idea to disable it. Looks like this:
image

Part 4. CSS variables enhancements.

1. For support background color variable.

Note: useful for Pisces scheme.

Files modified:

  • CSS: remove body background variable. e8b4ffd
  • CSS: add body background variable. (2) 50c94c3

How to use?

Simply add variable in source/css/_variables/custom.styl like:

$body-bg-color = #ededed;

2. For support box-shadow (borders) variables.

Note: only work for Pisces scheme.
By default is no box-shadow (borders) present.

Files modified:

  • CSS: add box-shadow variable. 760dcd0
  • CSS: add box-shadow variable. (2) b96ffcd
  • CSS: add box-shadow variables. (3) 3d36174

How to use?

Simply add variables in source/css/_variables/custom.styl like:

$box-shadow-inner		= -1px 0px 0px 0px #ddd, 1px 0px 0px 0px #ddd, 0px 1px 0px 0px #ddd;
$box-shadow			= -1px 0px 0px 0px #ddd, 1px 0px 0px 0px #ddd, 0px 1px 0px 0px #ddd, 0px -1px 0px 0px #ddd;

Where

  • $box-shadow-inner — borders for header and content (without top border line).
  • $box-shadow — borders for sidebar (4 border lines on all sides, comma-separated: top, right, bottom, left).

3. For support border-radius variables.

Note: only work for Pisces scheme.
By default is no border-radius present.

Files modified:

  • CSS: add border-radius variable. (4) d902d02
  • CSS: add border-radius variable. (5) e92abae
  • CSS: add border-radius variables. (6) b377344

How to use?

Simply add variables in source/css/_variables/custom.styl like:

$border-radius-inner = 0 0 3px 3px;
$border-radius = 3px;

Where

  • $border-radius-inner — border angles for header and content (without top-left and top-right border angles).
  • $border-radius — border angles for sidebar (4 border angles: top-left, top-right, bottom-right, bottom-left).

How it looks?

Before:
image
After:
image

Happy New Year! :)

@iissnan iissnan merged commit eb3ac63 into iissnan:master Dec 20, 2016
@iissnan
Copy link
Owner

iissnan commented Dec 20, 2016

Thanks. 👍

And Happy New Year!

habren pushed a commit to habren/hexo-theme-next that referenced this pull request Apr 9, 2017
habren pushed a commit to habren/hexo-theme-next that referenced this pull request Apr 9, 2017
If `seo` is true main site description will be passed by `config.subtitle` option in main Hexo config.
But, there is duplicate of description by sidebar code (author & description).
So, we will separate main site description and author description and u may use `theme.signature` option for author description (signature).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants