Skip to content

Commit

Permalink
add: add linux pages and optization plugins.
Browse files Browse the repository at this point in the history
Signed-off-by: Eglinux <mthreads0755@gmail.com>
  • Loading branch information
eglinux-001 committed Feb 24, 2024
1 parent 1c87466 commit c942b1f
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 12 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: ci

permissions:
contents: write
id-token: write
pages: write

on:
push:
branches:
- master
- main
permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -26,10 +31,33 @@ jobs:
path: .cache
restore-keys: |
mkdocs-material-
- run: sudo apt update;sudo apt install pngquant
- run: sudo apt install pngquant
- run: pip install git+https://${GH_TOKEN}@github.com/eglinuxer/mkdocs-material-insiders.git
- run: pip install mkdocs-git-revision-date-localized-plugin
- run: pip install mkdocs-git-committers-plugin-2
- run: mkdocs gh-deploy --force
- name: Build documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CI: true
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
mkdocs build --clean
mkdocs --version
- name: Set up Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Push to Target Branch
run: |
git config pull.rebase true
git checkout -b gh-pages
git pull origin gh-pages
cp -r site/* .
rm -rf site
git add .
git commit -m "deploy docs changes to gh-pages"
git push origin gh-pages
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
6 changes: 6 additions & 0 deletions docs/linux/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
hide:
- footer
---

# Linux
23 changes: 15 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,19 @@ theme:

plugins:
- search
- git-revision-date-localized:
enable_creation_date: true
- git-committers:
repository: eglinuxer/eglinux
branch: main
token: !ENV GH_TOKEN
- projects
- optimize

# Continuous integration
- group:
enabled: !ENV CI
plugins:
- git-revision-date-localized:
enable_creation_date: true
type: timeago
- git-committers:
repository: eglinuxer/eglinux
token: !ENV GH_TOKEN
- optimize
- projects

extra:
homepage: https://www.eglinux.com
Expand All @@ -101,6 +106,8 @@ nav:
- 读书: eglinux/book.md
- 课程: eglinux/course.md
- 赞助: eglinux/support_me.md
- Linux:
- linux/index.md
- Python:
- python/index.md
- C/C++:
Expand Down

0 comments on commit c942b1f

Please sign in to comment.