Skip to content

Commit 0536849

Browse files
SkyBird233MingcongBai
authored andcommitted
feat(aoscc): restyle articles to render h2 as category-second and add AOSCC 2025 pages
1 parent 02e7122 commit 0536849

File tree

9 files changed

+112
-41
lines changed

9 files changed

+112
-41
lines changed

src/components/CategorySecond.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const props = defineProps({
88
</script>
99
<template>
1010
<div
11-
class="theme-bg-color-secondary-static m-p flex h-[2rem] items-center justify-between px-[10px] py-[5px] leading-none text-white select-none">
11+
class="theme-bg-color-secondary-static m-p category-second">
1212
<span>
1313
{{ props.title }}
1414
</span>

src/css/index.scss

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
$line-space: 22px;
1+
$line-space: 8px;
2+
$space-lg: $line-space * 3;
23
$bg-color: rgba(224, 224, 224, 0.1);
34
$th-bg-color: rgba(224, 224, 224, 0.3);
45
$blue: #37b2ff;
@@ -13,12 +14,6 @@ $bg-secondary: #3f6075;
1314
'DejaVu Sans Mono', -apple-system, monospace;
1415
}
1516

16-
@media (min-width: 1280px) {
17-
.vuepress-markdown-body {
18-
padding: 2rem 10% !important;
19-
}
20-
}
21-
2217
.theme-bg-color-secondary-static {
2318
background-color: var(--secondary);
2419
}
@@ -55,9 +50,43 @@ $bg-secondary: #3f6075;
5550
color: var(--primary);
5651
}
5752

53+
// h2 == category-second in md context
54+
.category-second,
55+
.vuepress-markdown-body h2 {
56+
font-size: 1em !important;
57+
font-weight: normal !important;
58+
background-color: var(--secondary);
59+
display: flex !important;
60+
height: 2rem !important;
61+
align-items: center !important;
62+
justify-content: space-between !important;
63+
padding-left: 10px !important;
64+
padding-right: 10px !important;
65+
padding-top: 5px !important;
66+
padding-bottom: 5px !important;
67+
line-height: normal !important;
68+
color: #fff !important;
69+
user-select: none !important;
70+
}
71+
5872
.vuepress-markdown-body {
5973
background: none;
6074
background-color: #fafafa !important;
75+
margin-bottom: $space-lg;
76+
77+
> * {
78+
margin-bottom: $line-space;
79+
}
80+
81+
// Left and right margin for every direct child except 'category-second'
82+
> *:not(h2) {
83+
margin-inline: $space-lg !important;
84+
}
85+
86+
// Override the default article paddings
87+
&:not(.custom) {
88+
padding: 0 !important;
89+
}
6190

6291
h1 {
6392
background-color: $bg-secondary;
@@ -71,11 +100,18 @@ $bg-secondary: #3f6075;
71100

72101
h2 {
73102
border-bottom-width: 0;
103+
// Vuepress' CSS has already removed the top margin for the first child
104+
// so the top margin here works as expected
105+
margin-top: $space-lg !important;
106+
margin-bottom: $space-lg !important;
107+
}
108+
109+
h3 {
110+
font-size: 1.2rem !important;
74111
}
75112

76113
p {
77-
line-height: inherit;
78-
margin-bottom: $line-space;
114+
line-height: inherit !important;
79115
}
80116

81117
img {
@@ -139,6 +175,7 @@ $bg-secondary: #3f6075;
139175
transition: 300ms;
140176
display: inline-block;
141177
vertical-align: bottom;
178+
color: var(--color-link) !important;
142179

143180
&::before {
144181
content: 'READ MORE +';
@@ -178,9 +215,10 @@ $bg-secondary: #3f6075;
178215
ol,
179216
ul {
180217
padding-left: 28px;
218+
line-height: inherit !important;
181219

182220
li {
183-
line-height: 2em;
221+
// line-height: 2em;
184222
margin-bottom: 0;
185223
list-style: inherit;
186224

src/pages/aoscc/AosccDetail.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup>
2-
import CategorySecond from '../../components/CategorySecond.vue';
32
import PageNotFound from '../../components/PageNotFound.vue';
43
import { useRoute } from 'vue-router';
54
import { ref, defineAsyncComponent, watch } from 'vue';
@@ -28,8 +27,6 @@ watch(() => route.params.slug.split('#')[0], loadArticle);
2827
<page-not-found />
2928
</template>
3029
<template v-else>
31-
<div class=""></div>
32-
<category-second v-if="!error" title="AOSCC" />
3330
<component class="vuepress-markdown-body" :is="articleComponent" />
3431
</template>
3532
</div>

src/pages/aoscc/AosccIndex.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
<script setup lang="ts">
2+
import { defineAsyncComponent, ref } from 'vue';
23
import AosccLinkButton from './components/AosccLinkButton.vue';
4+
5+
const error = ref();
6+
const articleComponent = ref();
7+
8+
articleComponent.value = defineAsyncComponent(() =>
9+
//@ts-ignore
10+
import('./articles/2025-info.zh.md').catch((err) => {
11+
console.error('Article not found:', err);
12+
error.value = err;
13+
})
14+
);
315
</script>
416

517
<template>
618
<div>
7-
<category-second title="AOSCC" />
19+
<category-second title="AOSCC:社区年度聚会" id="aoscc" />
820
<div class="aoscc-banner-bg relative h-[280px] px-10 py-6 text-white">
921
<div class="absolute bottom-0 mb-10 ml-1">
1022
<AosccLinkButton to="https://aoscc.aosc.io" class="mr-4"
@@ -13,7 +25,21 @@ import AosccLinkButton from './components/AosccLinkButton.vue';
1325
<AosccLinkButton to="/aoscc/2025">实用信息</AosccLinkButton>
1426
</div>
1527
</div>
16-
<category-second title="AOSCC:社区年度聚会" id="aoscc" />
28+
<div class="vuepress-markdown-body">
29+
<h2>AOSCC 简介</h2>
30+
<p>
31+
AOSCC
32+
是我社每年一度的线下聚会,公开邀请社区好友参与。活动期间,社区邀请社区贡献者、高校社团成员和行业代表等分享、交流工作,并组织抽奖、代号投票等趣味活动。近年来,AOSCC
33+
均由中国高校社团协办,每年吸引超过 100 来自与会者参与。
34+
</p>
35+
</div>
36+
<template v-if="error">
37+
<page-not-found />
38+
</template>
39+
<template v-else>
40+
<category-second v-if="!error" title="AOSCC 2025" class="mb-6" />
41+
<component class="vuepress-markdown-body" :is="articleComponent" />
42+
</template>
1743
</div>
1844
</template>
1945

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## 协议住宿
2+
3+
经 SJTUG 志愿者实地洽谈,位于沪闵路 213 号的 **「汉庭江川路地铁站新店」** 提供协议住宿,酒店房量有限,如需下榻协议酒店,请**尽早**完成会议注册、预订与支付,协议住宿详情如下。
4+
5+
- **价格**:标准间或大床房每晚 280 元
6+
- **拼房**:可以单独入住、按性别随机分配拼房、或指定同住人拼房
7+
- **早餐**:酒店 07:00-10:00 开设自助早餐,价格 20/位,可洽前台购买
8+
- **签到**:我们将于 25 日在酒店大堂设置签到处,提前抵达的与会者可先行签到和领取物资
9+
- **未成年人**:未成年人入住需现场电话联系监护人,取得知情同意方可入住,原则上不安排未成年人随机拼房入住
10+
11+
酒店距离校园有一定距离,建议骑行单车或搭乘公交前往校园。
12+
13+
协议酒店附近另有一家「汉庭江川路地铁站**二店**」,请注意区分。
14+
15+
## 交通信息
16+
17+
稍后补充。

src/pages/aoscc/articles/2025.zh.md renamed to src/pages/aoscc/articles/2025-info.zh.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ AOSCC 2025 年度线下聚会将于 7 月 26-27 日在上海交通大学举行
5555
5. 会场设有多个垃圾桶,请注意卫生,不要乱丢垃圾
5656
6. 请听从志愿者的现场管理,会务志愿者可在必要的情况要求特定与会者离开会场及校园
5757

58-
## 会议日程
59-
60-
AOSCC 2025 为期两日,我们已收到近 20 份讲者选题,具体日程将于六月底公布。
61-
6258
### 自由活动/消磨时间
6359

6460
在聚会前后、休息时间及不感兴趣的议程中,如下项目可供您消磨时间:
@@ -68,24 +64,6 @@ AOSCC 2025 为期两日,我们已收到近 20 份讲者选题,具体日程
6864
- 在上交大校园内、上海市区游览观光
6965
- 爱干啥干啥去(雾)
7066

71-
## 协议住宿
72-
73-
经 SJTUG 志愿者实地洽谈,位于沪闵路 213 号的 **「汉庭江川路地铁站新店」** 提供协议住宿,酒店房量有限,如需下榻协议酒店,请**尽早**完成会议注册、预订与支付,协议住宿详情如下。
74-
75-
- **价格**:标准间或大床房每晚 280 元
76-
- **拼房**:可以单独入住、按性别随机分配拼房、或指定同住人拼房
77-
- **早餐**:酒店 07:00-10:00 开设自助早餐,价格 20/位,可洽前台购买
78-
- **签到**:我们将于 25 日在酒店大堂设置签到处,提前抵达的与会者可先行签到和领取物资
79-
- **未成年人**:未成年人入住需现场电话联系监护人,取得知情同意方可入住,原则上不安排未成年人随机拼房入住
80-
81-
酒店距离校园有一定距离,建议骑行单车或搭乘公交前往校园。
82-
83-
协议酒店附近另有一家「汉庭江川路地铁站**二店**」,请注意区分。
84-
85-
## 交通信息
86-
87-
稍后补充。
88-
8967
## 联系方式
9068

9169
与会者注册、协议酒店预订等会务问题,请联系会务组:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 会议日程
2+
3+
AOSCC 2025 为期两日,我们已收到近 20 份讲者选题,具体日程将于六月底公布。

src/pages/home/components/LeftBar.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ const linkArr = reactive([
2222
],
2323
show: true
2424
},
25+
{
26+
title: 'AOSCC 2025',
27+
children: [
28+
{ title: '会议信息', link: '/aoscc' },
29+
{ title: '会议日程', link: '/aoscc/2025-schedule' },
30+
{ title: '交通和住宿', link: '/aoscc/2025-guide' },
31+
{ title: '往届 AOSCC', link: '/events#aoscc' }
32+
],
33+
show: true
34+
},
2535
{
2636
title: '资讯与支持',
2737
children: [
2838
{ title: '新闻资讯', link: '/news' },
2939
{ title: '社区活动', link: '/events' },
30-
{ title: 'AOSCC', link: '/aoscc' },
3140
{ title: '活动相册', link: '/gallery' },
3241
{ title: '联系方式', link: '/contact' },
3342
{ title: '参考文档 (Wiki)', link: 'https://wiki.aosc.io/zh/' }
@@ -53,7 +62,10 @@ const linkArr = reactive([
5362
{ title: '社区论坛', link: 'https://bbs.aosc.io/' },
5463
{ title: '代码仓库', link: 'https://github.com/AOSC-Dev' },
5564
{ title: '贡献者邮箱', link: 'https://mail20.mymailcheap.com/' },
56-
{ title: '构建服务器', link: 'https://wiki.aosc.io/developer/infrastructure/buildbots/' },
65+
{
66+
title: '构建服务器',
67+
link: 'https://wiki.aosc.io/developer/infrastructure/buildbots/'
68+
},
5769
{ title: '自动化设施', link: 'https://buildit.aosc.io/' },
5870
{ title: '软件包查询站', link: 'https://packages.aosc.io/' }
5971
],

src/pages/news/NewsDetail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const newsDate = ref('');
3232
<category-second
3333
:title="yamlDoc['title']"
3434
:right-text="newsDate"
35-
class="sticky top-0 z-1" />
35+
class="sticky top-0 z-1 mb-6" />
3636
<v-md-preview :text="mdRes" @copy-code-success="handleCopyCodeSuccess" />
3737
</div>
3838
</template>

0 commit comments

Comments
 (0)