Skip to content

Commit 1f0f3f7

Browse files
authored
Merge pull request #1649 from future-architect/feature
ブラウザのタブに、タグ一覧、カテゴリ一覧、著者一覧を正しく表示
2 parents ef0aa5b + 8a4f1ec commit 1f0f3f7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

scripts/tags.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ hexo.extend.helper.register('count_tags', function() {
1515
});
1616

1717
hexo.extend.helper.register('ranking_tags', function() {
18-
1918
const tagPosts = this.site.tags.map(tag => ({tag:tag, posts:tag.posts, count:tag.posts.length, shareCount:totalCount(tag.posts)}));
2019

2120
const compareFunc = (a, b) => (b.shareCount + b.count)/b.count - (a.shareCount + a.count)/a.count;
@@ -67,8 +66,6 @@ function customTagCloudHelper(options) {
6766
let result = '';
6867

6968
tags.forEach(tag => {
70-
// ▼▼▼ フォントサイズ計算ロジックの変更箇所 ▼▼▼
71-
7269
// 1. 基本となる線形の比率(0.0 〜 1.0)を算出
7370
const ratio = spread === 0 ? 0.5 : (tag.length - minSize) / spread;
7471

@@ -79,8 +76,6 @@ function customTagCloudHelper(options) {
7976
// 3. 調整後の比率を元にフォントサイズを決定
8077
const fontSize = minFont + (maxFont - minFont) * adjustedRatio;
8178

82-
// ▲▲▲ ここまで ▲▲▲
83-
8479
const tagName = tag.name.replace(/ /g, '-');
8580
const tagLink = hexo.url_for(tag.path);
8681

themes/future/layout/_partial/head.ejs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,24 @@
4141
title = page.category + ' の記事一覧';
4242
description = page.category + ' カテゴリの記事一覧 | ' + config.description
4343
keywords = keywords + ',' + page.category;
44+
} else if (page.path === 'categories/index.html') {
45+
title = 'カテゴリ一覧';
46+
description = 'カテゴリ一覧 | ' + config.description;
4447
} else if (is_tag()){
4548
title = page.tag + ' の記事一覧';
4649
description = page.tag + ' タグの記事一覧 | ' + config.description
4750
keywords = keywords + ',' + page.tag;
51+
} else if (page.path === 'tags/index.html') {
52+
title = 'タグ一覧';
53+
description = 'タグ一覧 | ' + config.description;
4854
} else if (path.indexOf('authors/' + page.author) >= 0) {
4955
title = page.author;
5056
description = page.author + ' が執筆した記事一覧 | ' + config.description
5157
keywords = keywords + ',' + page.author;
5258
author = page.author;
59+
} else if (page.path === 'authors/index.html') {
60+
title = '著者一覧';
61+
description = '著者一覧 | ' + config.description;
5362
}
5463
5564
if (title) {

0 commit comments

Comments
 (0)