Skip to content

Commit 79b06fd

Browse files
committed
style: highlight active sidebar link; use SEO title on homepage
1 parent 35f017b commit 79b06fd

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

docs/stylesheets/extra.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,39 @@
250250
fill: rgba(255,255,255,.7);
251251
}
252252

253+
/* ── Sidebar: highlight the currently opened note/page ── */
254+
.md-sidebar--primary a.md-nav__link.md-nav__link--active,
255+
.md-sidebar--primary label.md-nav__link.md-nav__link--active[for="__toc"] {
256+
margin: 0.12rem 0;
257+
padding: 0.32rem 0.55rem 0.32rem 0.7rem;
258+
border-radius: 6px;
259+
background: rgba(124, 77, 255, 0.1);
260+
box-shadow: inset 3px 0 0 var(--md-accent-fg-color);
261+
color: var(--md-accent-fg-color) !important;
262+
font-weight: 700;
263+
}
264+
265+
.md-sidebar--primary a.md-nav__link.md-nav__link--active .md-ellipsis,
266+
.md-sidebar--primary label.md-nav__link.md-nav__link--active[for="__toc"] .md-ellipsis {
267+
color: inherit;
268+
}
269+
270+
.md-sidebar--primary a.md-nav__link.md-nav__link--active:hover,
271+
.md-sidebar--primary label.md-nav__link.md-nav__link--active[for="__toc"]:hover {
272+
background: rgba(124, 77, 255, 0.16);
273+
}
274+
275+
[data-md-color-scheme="slate"] .md-sidebar--primary a.md-nav__link.md-nav__link--active,
276+
[data-md-color-scheme="slate"] .md-sidebar--primary label.md-nav__link.md-nav__link--active[for="__toc"] {
277+
background: rgba(167, 139, 250, 0.16);
278+
color: rgba(255, 255, 255, 0.95) !important;
279+
}
280+
281+
[data-md-color-scheme="slate"] .md-sidebar--primary a.md-nav__link.md-nav__link--active:hover,
282+
[data-md-color-scheme="slate"] .md-sidebar--primary label.md-nav__link.md-nav__link--active[for="__toc"]:hover {
283+
background: rgba(167, 139, 250, 0.22);
284+
}
285+
253286
/* ── Paper metadata: make arXiv/code links stand out ── */
254287
.md-content a[href*="arxiv.org"],
255288
.md-content a[href*="github.com"],

overrides/main.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
{% block htmltitle %}
44
{% if page and page.is_homepage %}
5+
{# Homepage: prefer the SEO-tuned frontmatter title so Google search results
6+
read "AI 顶会论文解读 | …" instead of the bland site_name ("📚 AI Paper Notes").
7+
Fallback to site_name when no frontmatter title is provided. #}
8+
{%- if page.meta and page.meta.title %}
9+
<title>{{ page.meta.title }}</title>
10+
{%- else %}
511
<title>{{ config.site_name }}</title>
12+
{%- endif %}
613
{% else %}
714
{{ super() }}
815
{% endif %}

0 commit comments

Comments
 (0)