Skip to content

Commit

Permalink
Merge pull request #2 from l10178/doks-1.6
Browse files Browse the repository at this point in the history
Bump doks from 1.4 to 1.6
  • Loading branch information
l10178 authored Apr 30, 2024
2 parents 793db72 + 128b71e commit 721f6ed
Show file tree
Hide file tree
Showing 34 changed files with 6,025 additions and 6,206 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.json

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.125.4'
# extended: true

- name: Install dependencies
run: npm install

- name: Run linters
run: npm run lint --if-present

- name: Build site
run: npm run build

- name: Deploy github pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ Thumbs.db
node_modules
public
resources
package-lock.json
# package-lock.json
# pnpm-lock.yaml

.idea
.vscode
.impl
*.log
15 changes: 0 additions & 15 deletions .markdownlint-cli2.jsonc

This file was deleted.

12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.html
*.ico
*.png
*.jp*g
*.toml
*.*ignore
*.svg
*.xml
LICENSE
.npmrc
.gitkeep
*.woff*
19 changes: 19 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Default config
tabWidth: 4
endOfLine: lf
singleQuote: true
printWidth: 100000
trailingComma: none
bracketSameLine: true
quoteProps: consistent
experimentalTernaries: true

# Overrided config
overrides:
- files: ["*.md", "*.json", "*.yaml"]
options:
tabWidth: 2
singleQuote: false
- files: ["*.scss"]
options:
singleQuote: false
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.wordWrap": "off",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.tabSize": 2,
"editor.insertSpaces": true
}
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@ A book about identity as a service (IDaaS).

本项目使用 [Hugo][] 开发,使用 [Doks][] 作为 Hugo 主题,一切内容都是 Markdown,专心写文字即可。

本地开发时需要先安装 Nodejs,然后使用 pnpm(或 npm) 安装 Hugo bin,本地不需要提前安装 Hugo。
本地开发时需要先安装 Nodejs Hugo。

```bash
# 安装 npm 依赖包,注意此过程需要连接 github 下载 hugo
pnpm install
npm install
# 启动 Web,然后浏览器访问 http://localhost:1313/即可浏览效果
pnpm run dev
npm run dev
# 创建新页面
pnpm run create docs/platform/backstage.md
pnpm run create blog/k8s.md
# 执行代码检查
pnpm run lint
npm run create blog/k8s.md
# 编译结果
pnpm run build
npm run build
```

如果文章中包含图片,提交 Git 前推荐使用 [pngquant][] 先进行无损压缩。
Expand Down
Binary file removed assets/favicon-512x512.png
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mermaid from 'mermaid';

document.addEventListener('DOMContentLoaded', () => {
mermaid.initialize({ startOnLoad: true });
});
mermaid.initialize({ startOnLoad: true });
});
8 changes: 4 additions & 4 deletions assets/scss/common/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.container-fw {
// 原 docs 文本阅读内容是1200px,太窄了,加宽
max-width: 1800px;
// 原 docs 文本阅读内容是1200px,太窄了,加宽
max-width: 1800px;
}

.btn-toggle {
text-transform: none;
}
text-transform: none;
}
159 changes: 76 additions & 83 deletions assets/scss/common/_variables-docsearch.scss
Original file line number Diff line number Diff line change
@@ -1,104 +1,97 @@
/* Darkmode */

:root {
--docsearch-primary-color: var(--sl-color-text-accent);
--docsearch-text-color: var(--sl-color-text);
--docsearch-spacing: 12px;
--docsearch-icon-stroke-width: 1.4;
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-muted-color: var(--sl-color-gray-3);
--docsearch-container-background: var(--sl-color-backdrop-overlay);

/* modal */
--docsearch-modal-width: 560px;
--docsearch-modal-height: 600px;
--docsearch-modal-background: var(--sl-color-gray-6);
--docsearch-modal-shadow: var(--sl-shadow-lg);

/* searchbox */
--docsearch-searchbox-height: 56px;
--docsearch-searchbox-background: var(--sl-color-gray-7, var(--sl-color-gray-6));
--docsearch-searchbox-focus-background: var(--sl-color-black);
--docsearch-searchbox-shadow: inset 0 0 0 1px var(--docsearch-primary-color);

/* hit */
--docsearch-hit-height: 56px;
--docsearch-hit-color: var(--sl-color-white);
--docsearch-hit-active-color: var(--sl-color-black);
--docsearch-hit-background: var(--sl-color-black);

/* key */
--docsearch-key-gradient: linear-gradient(
var(--sl-color-bg-inline-code) 0%,
var(--sl-color-bg-inline-code) 100%
);

/* footer */
--docsearch-footer-height: 44px;
--docsearch-footer-background: var(--sl-color-black);
--docsearch-footer-shadow: 0 -1px 0 0 var(--sl-color-hairline-light);
--docsearch-primary-color: var(--sl-color-text-accent);
--docsearch-text-color: var(--sl-color-text);
--docsearch-spacing: 12px;
--docsearch-icon-stroke-width: 1.4;
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-muted-color: var(--sl-color-gray-3);
--docsearch-container-background: var(--sl-color-backdrop-overlay);

/* modal */
--docsearch-modal-width: 560px;
--docsearch-modal-height: 600px;
--docsearch-modal-background: var(--sl-color-gray-6);
--docsearch-modal-shadow: var(--sl-shadow-lg);

/* searchbox */
--docsearch-searchbox-height: 56px;
--docsearch-searchbox-background: var(--sl-color-gray-7, var(--sl-color-gray-6));
--docsearch-searchbox-focus-background: var(--sl-color-black);
--docsearch-searchbox-shadow: inset 0 0 0 1px var(--docsearch-primary-color);

/* hit */
--docsearch-hit-height: 56px;
--docsearch-hit-color: var(--sl-color-white);
--docsearch-hit-active-color: var(--sl-color-black);
--docsearch-hit-background: var(--sl-color-black);

/* key */
--docsearch-key-gradient: linear-gradient(var(--sl-color-bg-inline-code) 0%, var(--sl-color-bg-inline-code) 100%);

/* footer */
--docsearch-footer-height: 44px;
--docsearch-footer-background: var(--sl-color-black);
--docsearch-footer-shadow: 0 -1px 0 0 var(--sl-color-hairline-light);
}

html[data-bs-theme='light'] {
// --docsearch-primary-color: rgb(84, 104, 255);
--docsearch-primary-color: #5d2f86;
--docsearch-text-color: rgb(28, 30, 33);
--docsearch-spacing: 12px;
--docsearch-icon-stroke-width: 1.4;
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-muted-color: rgb(150, 159, 175);
--docsearch-container-background: rgba(101, 108, 133, 0.8);
--docsearch-logo-color: rgba(84, 104, 255);

/* modal */
--docsearch-modal-width: 560px;
--docsearch-modal-height: 600px;
--docsearch-modal-background: rgb(245, 246, 247);
--docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5),
0 3px 8px 0 rgba(85, 90, 100, 1);

/* searchbox */
--docsearch-searchbox-height: 56px;
--docsearch-searchbox-background: rgb(235, 237, 240);
--docsearch-searchbox-focus-background: #fff;
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);

/* hit */
--docsearch-hit-height: 56px;
--docsearch-hit-color: rgb(68, 73, 80);
--docsearch-hit-active-color: #fff;
--docsearch-hit-background: #fff;

// --docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225);

/* key */
--docsearch-key-gradient: linear-gradient(
#edeff3 0%,
#edeff3 100%
);

/*
html[data-bs-theme="light"] {
// --docsearch-primary-color: rgb(84, 104, 255);
--docsearch-primary-color: #5d2f86;
--docsearch-text-color: rgb(28, 30, 33);
--docsearch-spacing: 12px;
--docsearch-icon-stroke-width: 1.4;
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-muted-color: rgb(150, 159, 175);
--docsearch-container-background: rgba(101, 108, 133, 0.8);
--docsearch-logo-color: rgba(84, 104, 255);

/* modal */
--docsearch-modal-width: 560px;
--docsearch-modal-height: 600px;
--docsearch-modal-background: rgb(245, 246, 247);
--docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5), 0 3px 8px 0 rgba(85, 90, 100, 1);

/* searchbox */
--docsearch-searchbox-height: 56px;
--docsearch-searchbox-background: rgb(235, 237, 240);
--docsearch-searchbox-focus-background: #fff;
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);

/* hit */
--docsearch-hit-height: 56px;
--docsearch-hit-color: rgb(68, 73, 80);
--docsearch-hit-active-color: #fff;
--docsearch-hit-background: #fff;

// --docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225);

/* key */
--docsearch-key-gradient: linear-gradient(#edeff3 0%, #edeff3 100%);

/*
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230),
inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
--docsearch-key-pressed-shadow: inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,0.4);
*/

/* footer */
--docsearch-footer-height: 44px;
--docsearch-footer-background: #fff;

/*
/* footer */
--docsearch-footer-height: 44px;
--docsearch-footer-background: #fff;

/*
--docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232),
0 -3px 6px 0 rgba(69, 98, 155, 0.12);
*/
--docsearch-footer-shadow: 0 -1px 0 0 var(--sl-color-hairline-dark);
--docsearch-footer-shadow: 0 -1px 0 0 var(--sl-color-hairline-dark);
}

/* Custom style overrides */
.DocSearch-Modal {
border: 1px solid var(--sl-color-hairline-light);
border: 1px solid var(--sl-color-hairline-light);
}

.DocSearch-Logo svg * {
fill: var(--docsearch-muted-color);
fill: var(--docsearch-muted-color);
}
Loading

0 comments on commit 721f6ed

Please sign in to comment.