Skip to content

Commit 3eeed03

Browse files
calderbuildclaude
andcommitted
fix: Resolve 404 errors for tag archive and tags pages
- Rename archive/archive.html to archive/index.html to fix /archive/ URL - Create tags/index.html page with tag cloud and tag list - All tag archive URLs now work correctly: * /archive/ - main archive page with tag filtering * /archive/?tag=XXX - filtered by specific tag * /tags/ - dedicated tags overview page This fixes 6 URLs returning 404 in Google Search Console. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d455425 commit 3eeed03

File tree

2 files changed

+152
-0
lines changed

2 files changed

+152
-0
lines changed
File renamed without changes.

tags/index.html

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
title: Tags
3+
layout: default
4+
description: "技术标签 | 文章分类 | 主题归档"
5+
header-img: "img/bg-little-universe.jpg"
6+
---
7+
8+
<!-- Page Header -->
9+
{% include intro-header.html type='page' short=true %}
10+
11+
<!-- Main Content -->
12+
<div class="container">
13+
<div class="row">
14+
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
15+
<!-- Tags Cloud -->
16+
<div id='tag_cloud' class="tags tags-sup">
17+
{% capture tags %}
18+
{% for tag in site.tags %}
19+
<a href="{{ site.baseurl }}/archive/?tag={{ tag[0] | strip | url_encode }}"
20+
class="tag-button"
21+
title="{{ tag[0] }}"
22+
rel="{{ tag[1].size }}">
23+
{{ tag[0] }}
24+
<sup>{{tag[1].size}}</sup>
25+
</a>
26+
{% endfor %}
27+
{% endcapture %}
28+
{{ tags | split:'__SEPERATOR__' | sort }}
29+
</div>
30+
31+
<!-- Tag List -->
32+
<div class="tag-list">
33+
{% for tag in site.tags %}
34+
<div class="tag-section">
35+
<h3 id="{{ tag[0] | strip | url_encode }}" class="tag-heading">
36+
<a href="{{ site.baseurl }}/archive/?tag={{ tag[0] | strip | url_encode }}">
37+
{{ tag[0] }}
38+
</a>
39+
<span class="tag-count">({{ tag[1].size }})</span>
40+
</h3>
41+
<ul class="post-list">
42+
{% for post in tag[1] %}
43+
<li>
44+
<a href="{{ post.url | prepend: site.baseurl }}">
45+
{{ post.title }}
46+
</a>
47+
<span class="post-date">{{ post.date | date: "%Y-%m-%d" }}</span>
48+
</li>
49+
{% endfor %}
50+
</ul>
51+
</div>
52+
{% endfor %}
53+
</div>
54+
</div>
55+
</div>
56+
</div>
57+
58+
<style>
59+
.tags {
60+
margin: 30px 0;
61+
}
62+
63+
.tag-button {
64+
display: inline-block;
65+
padding: 8px 15px;
66+
margin: 5px;
67+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
68+
color: white;
69+
border-radius: 20px;
70+
text-decoration: none;
71+
font-size: 14px;
72+
transition: all 0.3s ease;
73+
}
74+
75+
.tag-button:hover {
76+
transform: translateY(-2px);
77+
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
78+
color: white;
79+
text-decoration: none;
80+
}
81+
82+
.tag-button sup {
83+
font-size: 11px;
84+
opacity: 0.8;
85+
margin-left: 3px;
86+
}
87+
88+
.tag-list {
89+
margin-top: 50px;
90+
}
91+
92+
.tag-section {
93+
margin-bottom: 40px;
94+
}
95+
96+
.tag-heading {
97+
font-size: 24px;
98+
font-weight: 600;
99+
margin-bottom: 15px;
100+
padding-bottom: 10px;
101+
border-bottom: 2px solid #667eea;
102+
}
103+
104+
.tag-heading a {
105+
color: #333;
106+
text-decoration: none;
107+
}
108+
109+
.tag-heading a:hover {
110+
color: #667eea;
111+
}
112+
113+
.tag-count {
114+
color: #999;
115+
font-size: 18px;
116+
font-weight: normal;
117+
}
118+
119+
.post-list {
120+
list-style: none;
121+
padding-left: 0;
122+
}
123+
124+
.post-list li {
125+
padding: 8px 0;
126+
border-bottom: 1px solid #eee;
127+
}
128+
129+
.post-list li a {
130+
color: #555;
131+
text-decoration: none;
132+
font-size: 16px;
133+
}
134+
135+
.post-list li a:hover {
136+
color: #667eea;
137+
}
138+
139+
.post-date {
140+
float: right;
141+
color: #999;
142+
font-size: 14px;
143+
}
144+
145+
@media (max-width: 768px) {
146+
.post-date {
147+
float: none;
148+
display: block;
149+
margin-top: 5px;
150+
}
151+
}
152+
</style>

0 commit comments

Comments
 (0)