diff --git a/.github/sync_imgs.yml b/.github/sync_imgs.yml
new file mode 100644
index 000000000..e1655d4f1
--- /dev/null
+++ b/.github/sync_imgs.yml
@@ -0,0 +1,4 @@
+yangchuansheng/fastgpt-imgs:
+ - source: docSite/assets/imgs/
+ dest: imgs/
+ deleteOrphaned: true
\ No newline at end of file
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index 5451642b3..b306ef570 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -45,6 +45,10 @@ jobs:
- 'docSite/content/docs/**'
base: main
+ - name: Add cdn for images
+ run: |
+ sed -i "s#\](/imgs/#\](https://cdn.jsdelivr.us/gh/yangchuansheng/fastgpt-imgs@main/imgs/#g" $(grep -rl "\](/imgs/" docSite/content/docs)
+
# Step 3 - Install Hugo (specific version)
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml
index b22f7ae27..08929fa0a 100644
--- a/.github/workflows/deploy-preview.yml
+++ b/.github/workflows/deploy-preview.yml
@@ -45,6 +45,10 @@ jobs:
- 'docSite/content/docs/**'
base: main
+ - name: Add cdn for images
+ run: |
+ sed -i "s#\](/imgs/#\](https://cdn.jsdelivr.us/gh/yangchuansheng/fastgpt-imgs@main/imgs/#g" $(grep -rl "\](/imgs/" docSite/content/docs)
+
# Step 3 - Install Hugo (specific version)
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
diff --git a/.github/workflows/sync_imgs.yml b/.github/workflows/sync_imgs.yml
new file mode 100644
index 000000000..19dc28ab2
--- /dev/null
+++ b/.github/workflows/sync_imgs.yml
@@ -0,0 +1,35 @@
+name: Sync images
+on:
+ pull_request_target:
+ branches:
+ - main
+ paths:
+ - docSite/assets/imgs/**
+ push:
+ branches:
+ - main
+ paths:
+ - docSite/assets/imgs/**
+ workflow_dispatch:
+jobs:
+ sync:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ if: ${{ (github.event_name == 'pull_request_target') }}
+ with:
+ ref: ${{ github.event.pull_request.head.ref }}
+ repository: ${{ github.event.pull_request.head.repo.full_name }}
+
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Run GitHub File Sync
+ uses: BetaHuhn/repo-file-sync-action@v1.21.0
+ with:
+ GH_PAT: ${{ secrets.IMG_GH_PAT }}
+ CONFIG_PATH: .github/sync_imgs.yml
+ ORIGINAL_MESSAGE: true
+ SKIP_PR: true
+ COMMIT_EACH_FILE: false
\ No newline at end of file
diff --git a/docSite/assets/imgs/sealos_price.png b/docSite/assets/imgs/sealos_price.jpg
similarity index 100%
rename from docSite/assets/imgs/sealos_price.png
rename to docSite/assets/imgs/sealos_price.jpg
diff --git a/docSite/content/docs/commercial/intro.md b/docSite/content/docs/commercial/intro.md
index 353c89452..53fc2ed21 100644
--- a/docSite/content/docs/commercial/intro.md
+++ b/docSite/content/docs/commercial/intro.md
@@ -93,4 +93,4 @@ FastGPT 商业版软件根据不同的部署方式,分为 3 类收费模式。
Sealos 云服务属于按量计费,下面是它的价格表:
-
+
diff --git a/docSite/content/docs/course/websync.md b/docSite/content/docs/course/websync.md
index 9278ace82..3ecc033b3 100644
--- a/docSite/content/docs/course/websync.md
+++ b/docSite/content/docs/course/websync.md
@@ -25,13 +25,13 @@ curl https://doc.fastgpt.in/docs/intro/
### 1. 新建知识库,选择 Web 站点同步
-
+
-
+
### 2. 点击配置站点信息
-
+
### 3. 填写网址和选择器
diff --git a/docSite/layouts/docs/_markup/render-image.html b/docSite/layouts/docs/_markup/render-image.html
new file mode 100644
index 000000000..e78ae5a00
--- /dev/null
+++ b/docSite/layouts/docs/_markup/render-image.html
@@ -0,0 +1,32 @@
+{{ $dest := .Destination }}
+{{ $text := .PlainText }}
+{{ $url := urls.Parse $dest }}
+
+{{ if .Title }}
+
+ {{ if eq $url.Scheme "" }}
+ {{ with $image := resources.Get $dest }}
+ {{ if eq $image.MediaType.SubType "svg" }}
+ {{ $image.Content | safeHTML }}
+ {{ else }}
+
+ {{ end }}
+ {{ end }}
+ {{ else }}
+
+ {{ end }}
+ {{ .Title | markdownify }}
+
+{{ else }}
+ {{ if eq $url.Scheme "" }}
+ {{ with $image := resources.Get $dest }}
+ {{ if eq $image.MediaType.SubType "svg" }}
+ {{ $image.Content | safeHTML }}
+ {{ else }}
+
+ {{ end }}
+ {{ end }}
+ {{ else }}
+
+ {{ end }}
+{{ end }}
\ No newline at end of file
diff --git a/docSite/layouts/partials/docs/footer/footer-scripts.html b/docSite/layouts/partials/docs/footer/footer-scripts.html
index d3041cac4..aadf813fb 100644
--- a/docSite/layouts/partials/docs/footer/footer-scripts.html
+++ b/docSite/layouts/partials/docs/footer/footer-scripts.html
@@ -58,7 +58,7 @@
diff --git a/docSite/layouts/partials/docs/head.html b/docSite/layouts/partials/docs/head.html
index db7ba21fa..296ad897e 100644
--- a/docSite/layouts/partials/docs/head.html
+++ b/docSite/layouts/partials/docs/head.html
@@ -106,5 +106,5 @@
{{- end -}}
-
+
\ No newline at end of file
diff --git a/docSite/static/js/jsdelivr-auto-fallback.js b/docSite/static/js/jsdelivr-auto-fallback.js
index 9d5ac3e80..f3d6c7311 100644
--- a/docSite/static/js/jsdelivr-auto-fallback.js
+++ b/docSite/static/js/jsdelivr-auto-fallback.js
@@ -4,17 +4,17 @@
let failed;
let isRunning;
const DEST_LIST = [
- 'cdn.jsdelivr.net',
- 'jsd.cdn.zzko.cn',
'cdn.jsdelivr.us',
+ 'jsd.cdn.zzko.cn',
'jsd.onmicrosoft.cn',
'fastly.jsdelivr.net',
- 'gcore.jsdelivr.net'
+ 'gcore.jsdelivr.net',
+ 'cdn.jsdelivr.net',
];
const PREFIX = '//';
const SOURCE = DEST_LIST[0];
const starTime = Date.now();
- const TIMEOUT = 2000;
+ const TIMEOUT = 1000;
const STORE_KEY = 'jsdelivr-auto-fallback';
const TEST_PATH = '/gh/PipecraftNet/jsdelivr-auto-fallback@main/empty.css?';
const shouldReplace = (text) => text && text.includes(PREFIX + SOURCE);