Skip to content

Commit daa13d0

Browse files
authored
Merge pull request #137 from AdingApkgg/next
Add SearchGal button to single.html for enhanced resource search func…
2 parents 176cbce + 3e3b45c commit daa13d0

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

assets/sass/_searchgal.scss

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// ==========================================
2+
// SearchGal 一键搜索按钮样式
3+
// ==========================================
4+
5+
.searchgal-btn-wrapper {
6+
display: flex;
7+
justify-content: center;
8+
margin: 28px 0 20px;
9+
}
10+
11+
.searchgal-btn {
12+
display: inline-flex;
13+
align-items: center;
14+
gap: 10px;
15+
padding: 12px 28px;
16+
background: linear-gradient(135deg, #ff1493, #ff69b4);
17+
color: #fff !important;
18+
border: none;
19+
border-radius: 50px;
20+
font-size: 1.05rem;
21+
font-weight: 600;
22+
text-decoration: none !important;
23+
cursor: pointer;
24+
box-shadow: 0 4px 15px rgba(255, 20, 147, 0.35);
25+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
26+
letter-spacing: 0.5px;
27+
28+
i {
29+
font-size: 1.1rem;
30+
}
31+
32+
&:hover {
33+
transform: translateY(-3px);
34+
box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
35+
opacity: 1 !important;
36+
background: linear-gradient(135deg, #e0117f, #ff1493);
37+
}
38+
39+
&:active {
40+
transform: translateY(-1px);
41+
box-shadow: 0 3px 10px rgba(255, 20, 147, 0.35);
42+
}
43+
}
44+
45+
// 响应式
46+
@media (max-width: 768px) {
47+
.searchgal-btn {
48+
padding: 10px 22px;
49+
font-size: 0.95rem;
50+
}
51+
}

assets/sass/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
@use "./links";
1212
@use "./rank";
1313
@use "./ai-review";
14+
@use "./searchgal";

layouts/single.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ <h1 data-pagefind-body>
4747
{{ end }}
4848

4949
<div class="content" data-pagefind-body>{{ .Content }}</div>
50+
51+
{{ if eq .Section "p" }}
52+
<!-- SearchGal 一键搜索按钮 -->
53+
{{ $parts := split .Title "/" }}
54+
{{ $searchQuery := index $parts 0 }}
55+
<div class="searchgal-btn-wrapper">
56+
<a class="searchgal-btn" href="https://www.searchgal.top/?s={{ urlquery $searchQuery }}" target="_blank" rel="noopener noreferrer">
57+
<i class="fas fa-globe"></i> 点我立即聚搜全网资源
58+
</a>
59+
</div>
60+
{{ end }}
61+
5062
{{ partial "terms.html" (dict "taxonomy" "categories" "page" .) }} {{ partial
5163
"terms.html" (dict "taxonomy" "tags" "page" .) }}
5264
</article>

0 commit comments

Comments
 (0)