-
Notifications
You must be signed in to change notification settings - Fork 169
增加部署到pages,以及部分章节优化 #2
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
Open
liueggy
wants to merge
9
commits into
0voice:main
Choose a base branch
from
liueggy:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
429314b
Spin the markdown knowledge base into a publishable reading site
liueggy 51c5ef7
Remove emojis from README.md
Claude 11b6467
Merge pull request #1 from liueggy/claude/update-readme-file
liueggy 2bd6578
更新 README.md
liueggy e84484c
更新 README.md
liueggy 49963fa
Make the home page read like a technical index instead of a blog land…
liueggy 3013bf0
Improve chapter readability and remove emoji-heavy note styling
liueggy 7c69b2a
Simplify homepage: remove verbose descriptions and streamline layout
Claude 21ee8e6
更新后续章节
liueggy 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 |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Deploy VitePress site to Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v5 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Normalize markdown links | ||
| run: npm run docs:fix-links | ||
|
|
||
| - name: Build with VitePress | ||
| run: npm run docs:build | ||
|
|
||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v4 | ||
| with: | ||
| path: .vitepress/dist | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
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,6 @@ | ||
| node_modules/ | ||
| .vitepress/cache/ | ||
| .vitepress/dist/ | ||
| dist/ | ||
| .omx/ | ||
| .DS_Store |
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,52 @@ | ||
| import { defineConfig } from 'vitepress'; | ||
| import { buildNav, buildRewrites, buildSidebar } from '../scripts/docs-tools.mjs'; | ||
|
|
||
| export default defineConfig({ | ||
| lang: 'zh-CN', | ||
| title: 'Embed Book', | ||
| description: '嵌入式软件开发全景知识库,覆盖 C 语言、驱动开发、RTOS、Embedded Linux、IoT 与 AI on MCU。', | ||
| base: '/Embed_book/', | ||
| srcExclude: ['README.md', 'LICENSE.md', '.omx/**', 'node_modules/**'], | ||
| cleanUrls: true, | ||
| rewrites: buildRewrites(), | ||
| ignoreDeadLinks: [/^http:\/\/localhost:\d+/], | ||
| lastUpdated: true, | ||
| head: [ | ||
| ['meta', { name: 'theme-color', content: '#0f172a' }], | ||
| ['meta', { property: 'og:type', content: 'website' }], | ||
| ['meta', { property: 'og:title', content: 'Embed Book' }], | ||
| ['meta', { property: 'og:description', content: '为嵌入式软件学习打造的可阅读、可导航静态文档站。' }] | ||
| ], | ||
| themeConfig: { | ||
| siteTitle: 'Embed Book', | ||
| logo: '/1.png', | ||
| nav: buildNav(), | ||
| sidebar: buildSidebar(), | ||
| socialLinks: [ | ||
| { icon: 'github', link: 'https://github.com/liueggy/Embed_book' } | ||
| ], | ||
| search: { | ||
| provider: 'local' | ||
| }, | ||
| outline: { | ||
| level: [2, 3], | ||
| label: '本页目录' | ||
| }, | ||
| docFooter: { | ||
| prev: '上一页', | ||
| next: '下一页' | ||
| }, | ||
| returnToTopLabel: '返回顶部', | ||
| sidebarMenuLabel: '导航', | ||
| darkModeSwitchLabel: '主题', | ||
| lightModeSwitchTitle: '切换到浅色模式', | ||
| darkModeSwitchTitle: '切换到深色模式', | ||
| lastUpdated: { | ||
| text: '最后更新于' | ||
| }, | ||
| footer: { | ||
| message: '以 GitHub Pages 发布,使用 VitePress 构建。', | ||
| copyright: 'Content under CC BY-NC-SA 4.0 where applicable.' | ||
| } | ||
| } | ||
| }); |
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,157 @@ | ||
| :root { | ||
| --vp-c-brand-1: #1f4b6e; | ||
| --vp-c-brand-2: #173a57; | ||
| --vp-c-brand-3: #102a40; | ||
| --vp-c-brand-soft: rgba(31, 75, 110, 0.1); | ||
| --vp-home-hero-name-color: #0f172a; | ||
| --vp-home-hero-name-background: none; | ||
| --vp-home-hero-image-background-image: none; | ||
| --vp-home-hero-image-filter: none; | ||
| } | ||
|
|
||
| .VPHero.has-image .name, | ||
| .VPHero .name { | ||
| letter-spacing: -0.02em; | ||
| } | ||
|
|
||
| .VPHome .VPHero { | ||
| margin-top: 20px; | ||
| border: 1px solid rgba(148, 163, 184, 0.22); | ||
| border-radius: 18px; | ||
| background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); | ||
| box-shadow: none; | ||
| } | ||
|
|
||
| .dark .VPHome .VPHero { | ||
| background: linear-gradient(180deg, #111827 0%, #0f172a 100%); | ||
| border-color: rgba(148, 163, 184, 0.18); | ||
| } | ||
|
|
||
| .VPHome .VPHero::after { | ||
| display: none; | ||
| } | ||
|
|
||
| .VPHome .VPHero .container { | ||
| padding-top: 52px; | ||
| padding-bottom: 40px; | ||
| } | ||
|
|
||
| .VPHome .VPHero .text, | ||
| .VPHome .VPHero .tagline { | ||
| color: var(--vp-c-text-2); | ||
| } | ||
|
|
||
| .VPHome .VPHero .action.alt { | ||
| color: var(--vp-c-text-1); | ||
| border-color: rgba(148, 163, 184, 0.3); | ||
| background: transparent; | ||
| } | ||
|
|
||
| .portal-strip { | ||
| margin: 24px 0 20px; | ||
| padding: 12px 14px; | ||
| border: 1px solid rgba(148, 163, 184, 0.18); | ||
| border-radius: 12px; | ||
| background: #f8fafc; | ||
| color: var(--vp-c-text-2); | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| .dark .portal-strip { | ||
| background: rgba(15, 23, 42, 0.55); | ||
| } | ||
|
|
||
| .portal-index { | ||
| display: grid; | ||
| grid-template-columns: repeat(2, minmax(0, 1fr)); | ||
| gap: 20px; | ||
| margin: 20px 0 28px; | ||
| } | ||
|
|
||
| .portal-block { | ||
| padding: 18px 20px; | ||
| border: 1px solid rgba(148, 163, 184, 0.18); | ||
| border-radius: 14px; | ||
| background: var(--vp-c-bg-soft); | ||
| } | ||
|
|
||
| .portal-block h3 { | ||
| margin: 0 0 12px; | ||
| font-size: 17px; | ||
| } | ||
|
|
||
| .portal-block ol, | ||
| .portal-block ul { | ||
| margin: 0; | ||
| padding-left: 18px; | ||
| } | ||
|
|
||
| .portal-block li { | ||
| margin: 8px 0; | ||
| line-height: 1.6; | ||
| } | ||
|
|
||
| .portal-table { | ||
| margin: 16px 0 28px; | ||
| border: 1px solid rgba(148, 163, 184, 0.18); | ||
| border-radius: 14px; | ||
| overflow: hidden; | ||
| background: var(--vp-c-bg-soft); | ||
| } | ||
|
|
||
| .portal-row { | ||
| display: grid; | ||
| grid-template-columns: 240px minmax(0, 1fr); | ||
| gap: 18px; | ||
| padding: 16px 18px; | ||
| color: inherit; | ||
| text-decoration: none; | ||
| border-top: 1px solid rgba(148, 163, 184, 0.14); | ||
| transition: background-color 0.18s ease; | ||
| } | ||
|
|
||
| .portal-row:first-child { | ||
| border-top: 0; | ||
| } | ||
|
|
||
| .portal-row:hover { | ||
| background: rgba(148, 163, 184, 0.08); | ||
| } | ||
|
|
||
| .portal-row strong { | ||
| font-size: 15px; | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| .portal-row span { | ||
| color: var(--vp-c-text-2); | ||
| line-height: 1.6; | ||
| } | ||
|
|
||
| .portal-image { | ||
| margin: 18px 0 10px; | ||
| overflow: hidden; | ||
| border: 1px solid rgba(148, 163, 184, 0.18); | ||
| border-radius: 16px; | ||
| background: #fff; | ||
| } | ||
|
|
||
| .dark .portal-image { | ||
| background: #0f172a; | ||
| } | ||
|
|
||
| .portal-image img { | ||
| display: block; | ||
| width: 100%; | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .portal-index { | ||
| grid-template-columns: 1fr; | ||
| } | ||
|
|
||
| .portal-row { | ||
| grid-template-columns: 1fr; | ||
| gap: 6px; | ||
| } | ||
| } |
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,7 @@ | ||
| import DefaultTheme from 'vitepress/theme'; | ||
| import './custom.css'; | ||
|
|
||
| export default { | ||
| extends: DefaultTheme | ||
| }; | ||
|
|
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.