Skip to content

Commit a6d83fb

Browse files
jokester-zzzclaude
andcommitted
feat: add Featured Papers section to homepage via JS + separate config
- Add _data/featured_papers.yml to maintain featured arXiv IDs independently of papers.json sync - Add assets/js/featured-papers.js to fetch and render featured papers dynamically - Homepage order: Research Directions → Latest News → Featured Papers - Add featured papers CSS styles Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 52b098c commit a6d83fb

5 files changed

Lines changed: 167 additions & 2 deletions

File tree

_data/featured_papers.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 精选论文 arXiv ID 列表,与 data/papers.json 解耦
2+
# 每次 papers.json 更新不影响此文件
3+
# 格式:- "arxiv_id"
4+
- "2510.08002"
5+
- "2601.08173"
6+
- "2506.18385"
7+
- "2509.24709"

assets/css/main.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,53 @@ img { max-width: 100%; height: auto; display: block; }
541541
.icon-link:hover { color: var(--accent); background: var(--accent-light); }
542542
.icon-link .ai { font-size: 1.05rem; }
543543

544+
/* ── FEATURED PAPERS (homepage) ── */
545+
.featured-papers { display: flex; flex-direction: column; gap: 12px; }
546+
.featured-paper {
547+
padding: 18px 20px;
548+
border: 1px solid var(--border);
549+
border-radius: var(--radius);
550+
background: var(--bg-card);
551+
border-left: 3px solid var(--accent);
552+
transition: box-shadow 0.2s;
553+
}
554+
.featured-paper:hover { box-shadow: var(--shadow-sm); }
555+
.featured-paper-meta { margin-bottom: 4px; }
556+
.featured-paper-venue {
557+
font-size: 0.7rem; font-weight: 600;
558+
letter-spacing: 0.08em; text-transform: uppercase;
559+
color: var(--accent-text);
560+
background: var(--accent-light);
561+
border: 1px solid var(--accent-border);
562+
border-radius: var(--radius-full);
563+
padding: 2px 8px;
564+
}
565+
.featured-paper-title {
566+
font-family: var(--font-display);
567+
font-size: 1.05rem; font-weight: 600;
568+
line-height: 1.4; margin-bottom: 4px;
569+
}
570+
.featured-paper-title a { color: var(--text-primary); }
571+
.featured-paper-title a:hover { color: var(--accent); }
572+
.featured-paper-authors {
573+
font-size: 0.8rem; color: var(--text-secondary);
574+
margin-bottom: 10px;
575+
}
576+
.featured-paper-links { display: flex; gap: 12px; }
577+
.paper-link {
578+
display: inline-flex; align-items: center; gap: 4px;
579+
font-size: 0.75rem; font-weight: 500;
580+
color: var(--text-secondary);
581+
text-decoration: none;
582+
transition: color 0.15s;
583+
}
584+
.paper-link:hover { color: var(--accent); }
585+
.view-all-link {
586+
font-size: 0.8125rem; font-weight: 500;
587+
color: var(--accent-text);
588+
}
589+
.view-all-link:hover { text-decoration: underline; }
590+
544591
/* ── PUBLICATIONS PAGE ── */
545592
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
546593
.filter-btn {

assets/js/featured-papers.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// assets/js/featured-papers.js
2+
// Renders featured papers on the homepage by matching arXiv IDs
3+
// against data/papers.json. Featured IDs are injected by Jekyll
4+
// via window.FEATURED_IDS (from _data/featured_papers.yml).
5+
6+
(function () {
7+
'use strict';
8+
9+
function extractUrl(v) {
10+
if (!v) return '';
11+
if (typeof v === 'string') return v;
12+
if (Array.isArray(v)) { var f = v[0]; return f ? (f.link || f.url || f.text || '') : ''; }
13+
if (typeof v === 'object') return v.link || v.url || v.text || '';
14+
return '';
15+
}
16+
17+
function cleanAuthors(raw) {
18+
if (!raw) return '';
19+
return raw.split(/[\n;]+/)
20+
.map(function (a) { return a.replace(/\s*\d+[,\d]*\s*/g, ' ').replace(/[*^]/g, '').trim(); })
21+
.filter(Boolean).join(', ');
22+
}
23+
24+
function extractArxivId(v) {
25+
var url = extractUrl(v);
26+
var m = url.match(/(\d{4}\.\d{4,5})/);
27+
return m ? m[1] : '';
28+
}
29+
30+
function esc(s) {
31+
return String(s)
32+
.replace(/&/g, '&amp;').replace(/</g, '&lt;')
33+
.replace(/>/g, '&gt;').replace(/"/g, '&quot;');
34+
}
35+
36+
function normalise(raw) {
37+
var authors = raw['作者信息(每人一行,分号换行,数字表示单位信息,*表示Equal Contribution, ^表示通讯作者)'] || raw['作者'] || '';
38+
return {
39+
title: raw['论文标题'] || '',
40+
authors: cleanAuthors(typeof authors === 'string' ? authors : extractUrl(authors)),
41+
venue: raw['期刊/会议'] || '',
42+
pdf: extractUrl(raw['arXiv主页']),
43+
code: extractUrl(raw['Github仓库链接']),
44+
project: extractUrl(raw['刊印链接']),
45+
thumbnail: raw['_thumbnail'] || '',
46+
arxivId: extractArxivId(raw['arXiv主页'])
47+
};
48+
}
49+
50+
function render(papers) {
51+
var container = document.getElementById('featured-papers-list');
52+
if (!container) return;
53+
54+
var ids = window.FEATURED_IDS || [];
55+
// Preserve order from FEATURED_IDS
56+
var map = {};
57+
papers.forEach(function (p) { if (p.arxivId) map[p.arxivId] = p; });
58+
var featured = ids.map(function (id) { return map[id]; }).filter(Boolean);
59+
60+
if (!featured.length) {
61+
container.innerHTML = '';
62+
return;
63+
}
64+
65+
var html = '<div class="featured-papers">';
66+
featured.forEach(function (p) {
67+
html += '<div class="featured-paper">';
68+
html += '<div class="featured-paper-meta"><span class="featured-paper-venue">' + esc(p.venue) + '</span></div>';
69+
html += '<div class="featured-paper-title">';
70+
if (p.pdf) {
71+
html += '<a href="' + esc(p.pdf) + '" target="_blank" rel="noopener">' + esc(p.title) + '</a>';
72+
} else {
73+
html += esc(p.title);
74+
}
75+
html += '</div>';
76+
if (p.authors) html += '<div class="featured-paper-authors">' + esc(p.authors) + '</div>';
77+
html += '<div class="featured-paper-links">';
78+
if (p.pdf) html += '<a href="' + esc(p.pdf) + '" target="_blank" rel="noopener" class="paper-link"><i class="fas fa-file-pdf"></i> PDF</a>';
79+
if (p.code) html += '<a href="' + esc(p.code) + '" target="_blank" rel="noopener" class="paper-link"><i class="fab fa-github"></i> Code</a>';
80+
if (p.project) html += '<a href="' + esc(p.project) + '" target="_blank" rel="noopener" class="paper-link"><i class="fas fa-newspaper"></i> Paper</a>';
81+
html += '</div>';
82+
html += '</div>';
83+
});
84+
html += '</div>';
85+
html += '<div style="text-align:right;margin-top:12px;"><a href="/publications/" class="view-all-link">View all publications →</a></div>';
86+
container.innerHTML = html;
87+
}
88+
89+
document.addEventListener('DOMContentLoaded', function () {
90+
var container = document.getElementById('featured-papers-list');
91+
if (!container) return;
92+
93+
fetch('/data/papers.json')
94+
.then(function (res) { return res.json(); })
95+
.then(function (data) {
96+
var papers = data.filter(function (p) { return p['论文标题']; }).map(normalise);
97+
render(papers);
98+
})
99+
.catch(function () { container.innerHTML = ''; });
100+
});
101+
})();

contact.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ description: Get in touch with KnowledgeXLab — collaborations, student applica
3737
<h3>🎓 Open Positions</h3>
3838
<p>
3939
We are looking for self-motivated PhD students and research interns with interests in
40-
continual learning, knowledge reasoning, or foundation models for vertical domains.
40+
continuous learning, knowledge reasoning, or foundation models for vertical domains.
4141
Send your CV and a brief research statement to our email.
4242
</p>
4343
<a href="mailto:{{ site.lab_email }}" class="btn btn-primary">Send Application →</a>

index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: Home
44
research_directions:
55
- icon: "🤖"
6-
title: "Continual Learning & Autonomous Agent Evolution"
6+
title: Continuous Learning & Autonomous Agent Evolution"
77
description: "Designing agents that accumulate knowledge over time, adapt to non-stationary environments, and self-improve across tasks — without catastrophic forgetting or human intervention."
88
- icon: "🧠"
99
title: "Knowledge Reasoning, Representation & Utilization"
@@ -53,3 +53,13 @@ research_directions:
5353
</div>
5454
{% endfor %}
5555
</div>
56+
57+
<hr class="divider">
58+
59+
<!-- Featured Papers -->
60+
<div class="section-label">Featured Papers</div>
61+
<div id="featured-papers-list"><p style="color:var(--text-muted);font-size:0.875rem;">Loading…</p></div>
62+
<script>
63+
window.FEATURED_IDS = [{% for id in site.data.featured_papers %}"{{ id }}"{% unless forloop.last %},{% endunless %}{% endfor %}];
64+
</script>
65+
<script src="{{ '/assets/js/featured-papers.js' | relative_url }}"></script>

0 commit comments

Comments
 (0)