-
Notifications
You must be signed in to change notification settings - Fork 0
[add] Recipe & Policy pages migrated from OSB main site #1
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
Show all changes
10 commits
Select commit
Hold shift + click to select a range
11931f2
Initial plan
Copilot 87380a4
feat: copy wiki/recipe/policy backend API and translation keys from O…
Copilot 0125dc1
fix: correct naming and breadcrumb path in policy/recipe pages
Copilot bd5ef8f
feat: add missing DocumentModel/documentStore and port wiki/[node_tok…
Copilot bf8e28a
fix: update wiki/index.tsx to use named wikiStore import matching source
Copilot e76caf1
[remove] useless files
TechQuery 882b723
[refactor] skip SSG detail pages in CI Building
TechQuery e6f318c
Merge branch 'main' into copilot/copy-api-and-translations
TechQuery 949b861
[migrate] replace Content API with Tree API of GitHub to reduce API C…
TechQuery 9e88314
[migrate] replace Babel with SWC based on patched Next.js to compile …
TechQuery 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,7 @@ | ||
| NEXT_PUBLIC_SITE_NAME = wiki | ||
| NEXT_PUBLIC_SITE_SUMMARY = Lark project scaffold based on TypeScript, React, Next.js, Bootstrap & Workbox. | ||
| NEXT_PUBLIC_LOGO = https://github.com/open-source-bazaar.png | ||
|
|
||
| NEXT_PUBLIC_SENTRY_DSN = | ||
| SENTRY_ORG = | ||
| SENTRY_PROJECT = | ||
| NEXT_PUBLIC_SITE_NAME = 开源市集 wiki | ||
| NEXT_PUBLIC_SITE_SUMMARY = | ||
| NEXT_PUBLIC_LOGO = https://github.com/Open-Source-Bazaar.png | ||
|
|
||
| NEXT_PUBLIC_LARK_API_HOST = https://open.feishu.cn/open-apis/ | ||
| NEXT_PUBLIC_LARK_APP_ID = cli_a2c7771153f8900c | ||
| NEXT_PUBLIC_LARK_WIKI_URL = https://open-source-bazaar.feishu.cn/wiki/space/7318346900506181660 | ||
|
|
||
| NEXT_PUBLIC_CACHE_HOST = https://cache.example.com | ||
| CACHE_REPOSITORY = your-namespace/Web-file-cache | ||
| NEXT_PUBLIC_LARK_APP_ID = cli_a8094a652022900d | ||
| NEXT_PUBLIC_LARK_WIKI_URL = https://open-source-bazaar.feishu.cn/wiki/space/7052192153363054596 |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
| import Link from 'next/link'; | ||
| import { FC } from 'react'; | ||
| import { Badge } from 'react-bootstrap'; | ||
|
|
||
| import { XContent } from '../../models/Wiki'; | ||
|
|
||
| export interface ContentTreeProps { | ||
| nodes: XContent[]; | ||
| basePath: string; | ||
| level?: number; | ||
| metaKey?: string; | ||
| } | ||
|
|
||
| export const ContentTree: FC<ContentTreeProps> = ({ | ||
| nodes, | ||
| basePath, | ||
| level = 0, | ||
| metaKey = 'category', | ||
| }) => ( | ||
| <ol className={level === 0 ? 'list-unstyled' : ''}> | ||
| {nodes.map(({ path, name, type, meta, children }) => ( | ||
| <li key={path} className={level > 0 ? 'ms-3' : ''}> | ||
| {type !== 'dir' ? ( | ||
| <Link className="h4 d-flex align-items-center py-1" href={`${basePath}/${path}`}> | ||
| {name} | ||
|
|
||
| {meta?.[metaKey] && ( | ||
| <Badge bg="secondary" className="ms-2 small"> | ||
| {meta[metaKey]} | ||
| </Badge> | ||
| )} | ||
| </Link> | ||
| ) : ( | ||
| children?.[0] && ( | ||
| <details> | ||
| <summary className="h4">{name}</summary> | ||
|
|
||
| <ContentTree | ||
| nodes={children} | ||
| basePath={basePath} | ||
| level={level + 1} | ||
| metaKey={metaKey} | ||
| /> | ||
| </details> | ||
| ) | ||
| )} | ||
| </li> | ||
| ))} | ||
| </ol> | ||
| ); |
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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,10 +1,34 @@ | ||
| import { WikiNodeModel } from 'mobx-lark'; | ||
| import './Base'; | ||
|
|
||
| import { Content, ContentModel, TreeModel } from 'mobx-github'; | ||
| import { DocumentModel, WikiNodeModel } from 'mobx-lark'; | ||
| import { DataObject } from 'mobx-restful'; | ||
|
|
||
| import { lark } from '../pages/api/Lark/core'; | ||
| import { LarkWikiDomain, LarkWikiId } from './configuration'; | ||
|
|
||
| export interface XContent extends Content { | ||
| meta?: DataObject; | ||
| // eslint-disable-next-line no-restricted-syntax | ||
| children?: XContent[]; | ||
| } | ||
|
|
||
| export const policyTreeStore = new TreeModel('fpsig', 'open-source-policy'); | ||
|
|
||
| export const policyContentStore = new ContentModel( | ||
| 'fpsig', | ||
| 'open-source-policy', | ||
| ); | ||
| export const recipeTreeStore = new TreeModel('Gar-b-age', 'CookLikeHOC'); | ||
|
|
||
| export const recipeContentStore = new ContentModel('Gar-b-age', 'CookLikeHOC'); | ||
|
|
||
| export class MyWikiNodeModel extends WikiNodeModel { | ||
| client = lark.client; | ||
| } | ||
| export const wikiStore = new MyWikiNodeModel(LarkWikiDomain, LarkWikiId); | ||
|
|
||
| export default new MyWikiNodeModel(LarkWikiDomain, LarkWikiId); | ||
| export class MyDocumentModel extends DocumentModel { | ||
| client = lark.client; | ||
| } | ||
| export const documentStore = new MyDocumentModel(LarkWikiDomain); | ||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.