Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f278ddc
feat: infer content path from route path in CommonContent
SkyBird233 Aug 2, 2025
da17e64
chore: relnotes to md files
SkyBird233 Aug 2, 2025
32d80ad
fix: asahi relnote path
SkyBird233 Aug 2, 2025
d6c07f3
feat: replace about page with md file
SkyBird233 Aug 3, 2025
3e51056
chore: copy ProseH2
SkyBird233 Aug 3, 2025
dca8275
feat: replace afterglow index with md file
SkyBird233 Aug 3, 2025
5c1a887
feat: implement anchor scrolling and highlighting for async components
SkyBird233 Aug 3, 2025
b4cd20c
feat: replace afterglow pages with md files
SkyBird233 Aug 4, 2025
33caf4f
feat: replace AOSC OS pages with md files
SkyBird233 Aug 4, 2025
d684088
feat: replace contact page with md file
SkyBird233 Aug 4, 2025
e379342
fix: exclude unnecessary files in content config
SkyBird233 Aug 4, 2025
3042c47
feat: update styles in crowdsourcing page
SkyBird233 Aug 4, 2025
7dd0975
feat: replace events page with md file
SkyBird233 Aug 4, 2025
643d136
feat: replace guidelines page with md file
SkyBird233 Aug 4, 2025
5b930b0
feat: replace internship page with md file
SkyBird233 Aug 4, 2025
58149e4
feat: replace l10n page with md file
SkyBird233 Aug 4, 2025
d03360f
feat: replace liblol page with md file
SkyBird233 Aug 4, 2025
3d275eb
feat: replace oma page with md file
SkyBird233 Aug 4, 2025
a0641b1
fix: strange anchor behavior in Chrome
SkyBird233 Aug 11, 2025
831757d
chore: 清理过时的组件
HouLiXieBuRou Aug 11, 2025
0e8d1e0
chore: 清理无用代码
HouLiXieBuRou Aug 14, 2025
0b84738
chore: 统一 md 生成页面路由入口并清理无用文件
HouLiXieBuRou Aug 14, 2025
8c776e9
fix: 修复侧栏自动展开 bug
HouLiXieBuRou Aug 14, 2025
ce62333
fix: 导航栏切换语言后自动折叠 bug 修复,连续点击展开 bug 修复
HouLiXieBuRou Aug 15, 2025
bda91ce
fix(layout): restore bottom padding
SkyBird233 Aug 17, 2025
fcd6419
fix: 修复/更新 barleft 行为
HouLiXieBuRou Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,21 @@ router.afterEach((to, _from) => {
});

const { $mitt } = useNuxtApp();
const bodyRef = useTemplateRef('mainBody');
const mainRef = useTemplateRef('mainBody');
const heightRef = useTemplateRef('dMainBody');
onMounted(() => {
const mutationObserver =
window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver;
const observer = new mutationObserver(() => {
$mitt.emit('routeSwitching');
});
observer.observe(bodyRef.value, {
childList: true
});
new ResizeObserver(() => {
$mitt.emit('mainDomChange', mainRef.value.clientHeight);
}).observe(heightRef.value);
});
</script>

<template>
<NuxtLayout>
<div ref="mainBody" class="flex-1 pl-[1px]"><NuxtPage /></div>
<div ref="mainBody" class="flex-1 pl-[1px]">
<div ref="dMainBody">
<NuxtPage />
</div>
</div>
</NuxtLayout>
</template>
9 changes: 9 additions & 0 deletions app/router.options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { RouterConfig } from '@nuxt/schema';
import { useScrollStore } from '~/stores/scroll';

export default <RouterConfig>{
scrollBehavior(to, _from, savedPosition) {
if (savedPosition) return savedPosition;
else if (to.hash) useScrollStore().scrollOrSet(to.hash);
}
};
3 changes: 2 additions & 1 deletion assets/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $common-margin: 24px;
margin-bottom: $common-margin;

h2 {
margin-bottom: $common-margin;
margin-block: $common-margin;
}

h2,
Expand Down Expand Up @@ -70,6 +70,7 @@ $common-margin: 24px;

table {
max-width: calc(100% - 2 * $common-margin);
table-layout: auto;
}
}

Expand Down
49 changes: 36 additions & 13 deletions components/CommonContent.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
<script lang="ts" setup>
const props = defineProps<{ category: string }>();
import { useScrollStore } from '~/stores/scroll';

const props = defineProps<{ path?: string }>();

const route = useRoute();
const { locale } = useI18n();
const scrollStore = useScrollStore();
const contentRef = useTemplateRef('contentRef');


const contentPath = computed(() => {
if (props.path) return props.path;

const { data: page } = await useAsyncData(
computed(() => `${locale.value}:${props.category}:${route.params.slug}`),
() => {
return queryCollection(locale.value)
.path(`/${props.category}/${route.params.slug}`)
.first();
}
// For `prefix_except_default`
const prefix = `/${locale.value}`;
return route.path.startsWith(prefix)
? route.path.substring(prefix.length) || '/'
: route.path;
});

const { data: page, error } = await useAsyncData(
computed(() => `${locale.value}:${contentPath.value}`),
() => queryCollection(locale.value).path(contentPath.value).first()
);
useHead({ title: page.value?.title });

if (error.value || !page.value) {
throw createError({
statusCode: 404,
statusMessage: 'Page Not Found',
fatal: true
});
}

watch(contentRef, () => {
if (route.hash) scrollStore.scrollAndClear();
});
</script>

<template>
<article v-if="page">
<category-second
v-if="page?.body.value[0][0] !== 'h2'"
:id="page?.title"
:title="page?.title"
:right-text="page?.date.substring(0, 10)"
v-if="page.body.value[0][0] !== 'h2'"
:id="page.title"
:title="page.title"
:right-text="page.date?.substring(0, 10)"
:title-url="`${route.path}#${page.title}`" />
<ContentRenderer :value="page" class="heti" />
<ContentRenderer ref="contentRef" :value="page" class="heti" />
</article>
</template>
38 changes: 0 additions & 38 deletions components/app/AppSupport.vue

This file was deleted.

Loading