Skip to content

Commit 7e7c60e

Browse files
author
Fine yq
committed
Add Chinese pages and update site content
1 parent b0f1e5d commit 7e7c60e

33 files changed

Lines changed: 5164 additions & 334 deletions

_config.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
title: Yuanqing Feng (冯园庆)
22
email: Fengyuanqing2010@gmail.com
33
description: >-
4-
Research Associate at University of Pennsylvania, focusing on genetic mechanisms underlying human evolution, phenotypic diversity, and disease susceptibility.
4+
Research Associate at China Pharmaceutical University, focusing on genetic mechanisms underlying human evolution, phenotypic diversity, and disease susceptibility.
55
baseurl: "" # the subpath of your site, e.g. /blog
66
url: "https://fengyq.github.io" # the base hostname & protocol for your site, e.g. http://example.com
77

@@ -28,6 +28,23 @@ navigation:
2828
- title: Contact
2929
url: /contact/
3030

31+
# Chinese Navigation
32+
navigation_cn:
33+
- title: 主页
34+
url: /cn/
35+
- title: 研究
36+
url: /cn/research/
37+
- title: 发表论文
38+
url: /cn/publications/
39+
- title: 团队成员
40+
url: /cn/people/
41+
- title: 新闻
42+
url: /cn/news/
43+
- title: 招聘
44+
url: /cn/jobs/
45+
- title: 联系方式
46+
url: /cn/contact/
47+
3148
# Social links
3249
social_links:
3350
google_scholar: nWYWiVUAAAAJ
@@ -38,4 +55,4 @@ social_links:
3855

3956
# Other settings
4057
show_excerpts: true
41-
permalink: /:categories/:year/:month/:day/:title/
58+
permalink: /:categories/:year/:month/:day/:title/

_layouts/default.html

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="{% if page.url contains '_cn' %}zh{% else %}en{% endif %}">
2+
<html lang="{% if page.url contains '_cn' or page.url contains '/cn/' %}zh{% else %}en{% endif %}">
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -12,10 +12,28 @@
1212
<header class="site-header">
1313
<div class="header-container">
1414
<nav class="main-nav">
15-
{% for item in site.navigation %}
15+
{% if page.url contains '/cn/' and site.navigation_cn %}
16+
{% assign nav_items = site.navigation_cn %}
17+
{% else %}
18+
{% assign nav_items = site.navigation %}
19+
{% endif %}
20+
{% for item in nav_items %}
1621
<a href="{{ site.baseurl }}{{ item.url }}" {% if page.url == item.url %}class="active"{% endif %}>{{ item.title }}</a>
1722
{% endfor %}
1823
</nav>
24+
<div class="lang-toggle">
25+
{% if page.url contains '/cn/' %}
26+
{% assign english_url = page.url | replace_first: '/cn', '' %}
27+
<a href="{{ site.baseurl }}{{ english_url }}" class="lang-btn">English</a>
28+
{% else %}
29+
{% if page.url == '/' %}
30+
{% assign chinese_url = '/cn/' %}
31+
{% else %}
32+
{% assign chinese_url = '/cn' | append: page.url %}
33+
{% endif %}
34+
<a href="{{ site.baseurl }}{{ chinese_url }}" class="lang-btn">Chinese</a>
35+
{% endif %}
36+
</div>
1937
</div>
2038
</header>
2139

@@ -60,4 +78,4 @@
6078
});
6179
</script>
6280
</body>
63-
</html>
81+
</html>

_site/README.md

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

33
Static academic website for Yuanqing Feng’s lab, built with Jekyll and deployed via GitHub Pages.
44

5-
Live site: <https://fengyq.github.io>
5+
Live site: <fenglab-cpu.github.io>
66

77
---
88

@@ -21,8 +21,8 @@ Prerequisites: Ruby, Bundler, Git.
2121

2222
1. **Clone the repo**
2323
```bash
24-
git clone https://github.com/fengyq/fengyq.github.io.git
25-
cd fengyq.github.io
24+
git clone https://github.com/fenglab-cpu/fenglab-cpu.github.io/.git
25+
cd fenglab-cpu.github.io
2626
```
2727
2. **Install dependencies**
2828
```bash

_site/assets/css/main.css

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ h2 {
8484

8585
h3 {
8686
color: var(--heading-accent);
87+
font-size: 2.5rem;
8788
}
8889

8990
h4 {
@@ -213,6 +214,35 @@ a:hover::after {
213214
box-shadow: var(--shadow-medium);
214215
}
215216

217+
/* Global language toggle */
218+
.lang-toggle {
219+
margin-left: auto;
220+
}
221+
222+
.lang-btn {
223+
padding: 0.5rem 1rem;
224+
border: 2px solid var(--border-color);
225+
background: #ffffff;
226+
color: var(--text-color);
227+
text-decoration: none;
228+
border-radius: 9999px;
229+
font-size: 0.9rem;
230+
font-weight: 500;
231+
transition: all 0.3s ease;
232+
}
233+
234+
.lang-btn:hover {
235+
background: var(--gradient-secondary);
236+
color: #ffffff;
237+
border-color: transparent;
238+
transform: translateY(-2px);
239+
box-shadow: var(--shadow-light);
240+
}
241+
242+
.lang-btn::after {
243+
display: none;
244+
}
245+
216246
/* Content styles */
217247
.content {
218248
flex: 1;
@@ -491,4 +521,4 @@ a:hover::after {
491521
h1, h2, h3 {
492522
page-break-after: avoid;
493523
}
494-
}
524+
}

0 commit comments

Comments
 (0)