-
Notifications
You must be signed in to change notification settings - Fork 5
Add 2026 SCC showcase wall in Rabbita #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
i18n/zh/docusaurus-plugin-content-pages/2026-scc/showcase/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import ContestLayout from '@site/src/components/ContestLayout' | ||
| import ContestNavbar, { items2026 } from '@site/src/components/ContestNavbar' | ||
| import RabbitaShowcaseMount from '@site/src/pages/2026-scc/showcase/RabbitaShowcaseMount' | ||
| import styles from '@site/src/pages/2026-scc/showcase/wrapper.module.css' | ||
|
|
||
| export default function Page() { | ||
| return ( | ||
| <ContestLayout | ||
| heroImg='/img/2026-contest/kv.jpg' | ||
| mobileHeroImg='/img/2026-contest/kv.jpg' | ||
| qqGroupImg='/img/2026-contest/qq-group.png' | ||
| heroBgColor='#09184c' | ||
| heroBackdropImg='/img/2026-contest/kv.jpg' | ||
| > | ||
| <div className={styles.shell}> | ||
| <ContestNavbar activeIndex={1} items={items2026} qqGroup={false} /> | ||
| <RabbitaShowcaseMount | ||
| lightModeLabel='白天模式' | ||
| darkModeLabel='夜间模式' | ||
| toggleLabel='展示墙主题切换' | ||
| /> | ||
| </div> | ||
| </ContestLayout> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { spawnSync } from 'node:child_process' | ||
| import { cp, mkdir, readFile, rm, stat, writeFile } from 'node:fs/promises' | ||
| import { readdirSync } from 'node:fs' | ||
| import path from 'node:path' | ||
| import process from 'node:process' | ||
|
|
||
| const websiteDir = process.cwd() | ||
| const showcaseDir = path.resolve(websiteDir, 'src/rabbita/2026-scc-showcase') | ||
| const targetDir = path.resolve(websiteDir, 'static/rabbita-2026-scc-showcase') | ||
| const stylesSrc = path.resolve(showcaseDir, 'styles.css') | ||
|
|
||
| function findFirstJs(dir) { | ||
| for (const entry of readdirSync(dir, { withFileTypes: true })) { | ||
| const full = path.join(dir, entry.name) | ||
| if (entry.isDirectory()) { | ||
| const nested = findFirstJs(full) | ||
| if (nested) return nested | ||
| } else if (entry.name.endsWith('.js')) { | ||
| return full | ||
| } | ||
| } | ||
| return null | ||
| } | ||
|
|
||
| const build = spawnSync('moon', ['build', '--target', 'js', '--release'], { | ||
| cwd: showcaseDir, | ||
| stdio: 'inherit', | ||
| }) | ||
|
|
||
| if (build.status !== 0) { | ||
| process.exit(build.status ?? 1) | ||
| } | ||
|
|
||
| const buildDir = path.resolve(showcaseDir, '_build/js/release/build') | ||
| const jsFile = findFirstJs(buildDir) | ||
|
|
||
| if (!jsFile) { | ||
| console.error('[rabbita-showcase] failed to locate compiled main.js output') | ||
| process.exit(1) | ||
| } | ||
|
|
||
| const code = await stat(jsFile).then(() => | ||
| readFile(jsFile, 'utf8') | ||
| ).then((text) => | ||
| text | ||
| .replace(/\n?\/\/[#@]\s*sourceMappingURL=.*$/m, '') | ||
| .replace(/\n?\/\*#\s*sourceMappingURL=.*?\*\//m, '') | ||
| ) | ||
|
|
||
| await stat(stylesSrc) | ||
| await rm(targetDir, { recursive: true, force: true }) | ||
| await mkdir(targetDir, { recursive: true }) | ||
| await writeFile(path.join(targetDir, 'main.js'), code) | ||
| await cp(stylesSrc, path.join(targetDir, 'styles.css')) | ||
|
|
||
| console.log(`[rabbita-showcase] synced ${showcaseDir} -> ${targetDir}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The showcase watch list includes
moon.pkg.json, but this project usesmoon.pkg(src/rabbita/2026-scc-showcase/main/moon.pkg). As a result, editing package metadata/options in dev mode will not triggerbuildAndCopy(), so/rabbita-2026-scc-showcase/main.jscan stay stale until the Docusaurus process is restarted.Useful? React with 👍 / 👎.