Skip to content

Commit db9f5f3

Browse files
committed
Merge branch 'website-nuxt/main' into website-nuxt
2 parents 5b2316c + f2ac6bd commit db9f5f3

File tree

1,256 files changed

+26155
-15778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,256 files changed

+26155
-15778
lines changed

.gitignore

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1-
# Binary assets
2-
public/assets/gallery/
3-
public/assets/news/
4-
public/assets/coffee-break/
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
58

6-
# Runtime files
7-
auto-imports.d.ts
8-
components.d.ts
9+
# Node dependencies
10+
node_modules
911

1012
# Logs
1113
logs
1214
*.log
13-
npm-debug.log*
14-
yarn-debug.log*
15-
yarn-error.log*
16-
pnpm-debug.log*
17-
lerna-debug.log*
18-
19-
node_modules
20-
dist
21-
dist-ssr
22-
website
23-
website.zip
24-
deply/website.zip
25-
public/newsCategories
26-
*.local
2715

28-
# Editor directories and files
29-
.vscode/*
30-
!.vscode/extensions.json
31-
.idea
16+
# Misc
3217
.DS_Store
33-
*.suo
34-
*.ntvs*
35-
*.njsproj
36-
*.sln
37-
*.sw?
38-
pasteServer/paste/*
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pasteServer/*
44
makeCategory/*
55
deploy/*
66
website/*
7-
utils/*
87
auto-imports.d.ts
98
components.d.ts
9+
content/*
10+
fileServe/*

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"semi": true,
33
"bracketSameLine": true,
44
"arrowParens": "always",
5-
"htmlWhitespaceSensitivity": "strict",
5+
"htmlWhitespaceSensitivity": "ignore",
66
"vueIndentScriptAndStyle": false,
77
"singleQuote": true,
88
"trailingComma": "none",
99
"printWidth": 80,
1010
"plugins": ["prettier-plugin-tailwindcss"],
11-
"tailwindStylesheet": "./src/style.css"
11+
"tailwindStylesheet": "./assets/css/main.css"
1212
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"commentTranslate.hover.enabled": true
3+
}

README.md

Lines changed: 50 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,75 @@
1-
AOSC Portal
2-
===
1+
# Nuxt 3 Minimal Starter
32

4-
[简体中文自述文件 >>](/README.zh-cn.md)
3+
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
54

6-
The Portal website for AOSC since 2024 (designed in 2023, hence the name),
7-
built using Vue.js.
5+
## Setup
86

9-
At a glance
10-
---
7+
Make sure to install the dependencies:
118

12-
The main design goal for this new website is to maximise information density
13-
on a single screen space, utilising both multi-column and conventional
14-
navigation systems. It also seeks to depart from a conventional "FOSS
15-
community" aesthetic by emphasizing vivid and product-oriented presentation
16-
for prospective and current users.
9+
```bash
10+
# npm
11+
npm install
1712

18-
In terms of visual styling, this website intentionally seeks to re-create a
19-
2000s Web 1.0 aesthetic (whilst adopting modern technological frameworks and
20-
layout optimisations). Inspiration for the site layout comes from Microsoft's
21-
Windows home page from 2001 - 2004:
13+
# pnpm
14+
pnpm install
2215

23-
- [Reference 1, Windows XP home from late 2001](https://web.archive.org/web/20011211230629/http://microsoft.com/windowsxp/default.asp)
24-
- [Reference 2, Windows XP mid-cycle home from 2004](https://web.archive.org/web/20040204080626/http://www.microsoft.com/china/windows/default.mspx)
16+
# yarn
17+
yarn install
2518

26-
Technically speaking, this website is built as a client-side rendered Web
27-
application. In the near future, we plan to refactor this website into one
28-
that is powered by server-side rendering or static site generator to help
29-
with performance and indexability.
19+
# bun
20+
bun install
21+
```
3022

31-
This website is not yet optimised for mobile, legacy (Afterglow-targeted),
32-
and functionally-limited browsers. We are currently evaluating plans to
33-
implement a purpose-specific site to help with these scenarios.
23+
## Development Server
3424

35-
Deployment and testing
36-
---
25+
Start the development server on `http://localhost:3000`:
3726

38-
This website is deployed to our Web server using a GitHub workflow. It should
39-
also be deployed in conjunction with [website-2023-utils](https://github.com/AOSC-Dev/website-2023-utils).
40-
Please follow also the instructions there.
27+
```bash
28+
# npm
29+
npm run dev
4130

42-
To test the website locally, you would need a Node.js + NPM toolchain and a
43-
deployment of the aforementioned [website-2023-utils](https://github.com/AOSC-Dev/website-2023-utils).
44-
To install Node.js + NPM on AOSC OS:
31+
# pnpm
32+
pnpm run dev
4533

46-
```
47-
oma install nodejs
34+
# yarn
35+
yarn dev
36+
37+
# bun
38+
bun run dev
4839
```
4940

50-
Then, build and serve the website locally:
41+
## Production
5142

52-
```
53-
npm i
54-
npm run dev
55-
```
43+
Build the application for production:
5644

57-
Submitting news
58-
---
45+
```bash
46+
# npm
47+
npm run build
5948

60-
All news articles are written in Markdown and stored in `/public/news`, with
61-
extra assets (images, etc.) stored in `/assets/...`. All assets should be
62-
referenced from the site (`/assets/...`, not `https://...`).
49+
# pnpm
50+
pnpm run build
6351

64-
News articles should contain a header:
52+
# yarn
53+
yarn build
6554

66-
```
67-
---
68-
categories:
69-
- journals
70-
title: "安记冰室・九月上"
71-
date: 2024-09-19T23:00:00+08:00
72-
important: false
73-
home: true
74-
---
55+
# bun
56+
bun run build
7557
```
7658

77-
- `categories` (enum):
78-
- `advisories`: User advisories (usually AOSC OS-related).
79-
- `news`: Community news about events, sponsorships, etc.
80-
- `journals`: Community journals (entitled *Coffee Break*).
81-
- `minutes`: Contributor meeting records.
82-
- `title` (string): News title.
83-
- `date` (string): Publication date to be presented as-is.
84-
- `important` (boolean): Highlight as important.
85-
- `home` (boolean): Whether to list in the news highlight section at the Portal home.
59+
Locally preview production build:
8660

87-
### Localising news articles
61+
```bash
62+
# npm
63+
npm run preview
8864

89-
To localise a news article, use a language code suffix such as `.zh-cn`, i.e.:
65+
# pnpm
66+
pnpm run preview
9067

68+
# yarn
69+
yarn preview
70+
71+
# bun
72+
bun run preview
9173
```
92-
2024-09-18-aosc-os-relnote.zh-cn.md
93-
```
74+
75+
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

README.zh-cn.md

Lines changed: 0 additions & 74 deletions
This file was deleted.

app.vue

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<script setup lang="js">
2+
const highBrightnessControllerStore = useHighBrightnessControllerStore();
3+
const router = useRouter();
4+
const { t } = useI18n();
5+
6+
useHead({
7+
title: t('seo.head.title'),
8+
titleTemplate: (title) => `${title} | ${t('seo.site.name')}`,
9+
link: [{ rel: 'icon', type: 'image/svg+xml', href: '/aosc.svg' }],
10+
script: [
11+
{
12+
// This script will execute before the browser renders the <body>,
13+
// ensuring the correct season class is set from the very beginning.
14+
textContent:
15+
'document.documentElement.classList.add(["spring","summer","autumn","winter"][(new Date().getMonth()+10)%12/3|0])',
16+
type: 'text/javascript',
17+
tagPosition: 'head'
18+
}
19+
]
20+
});
21+
22+
useSeoMeta({
23+
description: t('seo.seo.description'),
24+
ogImage: '/aosc.svg',
25+
ogSiteName: t('seo.site.name')
26+
});
27+
28+
router.afterEach((to, _from) => {
29+
highBrightnessControllerStore.obj[to.path] =
30+
!highBrightnessControllerStore.obj[to.path];
31+
});
32+
33+
const { $mitt } = useNuxtApp();
34+
const bodyRef = useTemplateRef('mainBody');
35+
onMounted(() => {
36+
const mutationObserver =
37+
window.MutationObserver ||
38+
window.WebKitMutationObserver ||
39+
window.MozMutationObserver;
40+
const observer = new mutationObserver(() => {
41+
$mitt.emit('routeSwitching');
42+
});
43+
observer.observe(bodyRef.value, {
44+
childList: true
45+
});
46+
});
47+
</script>
48+
49+
<template>
50+
<NuxtLayout>
51+
<div ref="mainBody" class="flex-1 pl-[1px]"><NuxtPage /></div>
52+
</NuxtLayout>
53+
</template>

src/style.css renamed to assets/css/main.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
--color-black: #000;
1212

1313
--text-*: initial;
14+
1415
--text-xl: 1.5rem;
1516
--text-2xl: 1.8rem;
1617
--text-3xl: 2rem;
@@ -34,6 +35,7 @@
3435
::file-selector-button {
3536
border-color: var(--color-gray-200, currentColor);
3637
}
38+
3739
a:hover {
3840
text-decoration: underline;
3941
}
@@ -46,6 +48,11 @@ body {
4648
font-family: 'Noto Sans CJK SC', sans-serif;
4749
font-size: 12pt;
4850
min-width: 800px;
51+
52+
/* Global style for Element Plus created components (located outside #app) */
53+
--el-color-primary: var(--primary);
54+
--el-border-radius-base: 0;
55+
--el-popover-border-radius: 0;
4956
}
5057

5158
@media (min-width: 960px) {
@@ -61,7 +68,7 @@ body {
6168
/* flex: 0 0 100%; */
6269
}
6370

64-
.shadow {
71+
.myShadow {
6572
box-shadow: 0px 0px 10px #999;
6673
background: #fafafa;
6774
}

0 commit comments

Comments
 (0)