Peng Ding commited on
Commit
24c6d5e
·
1 Parent(s): 1e21b77

use README_en.md content for HF Space description

Browse files

Prepend HF frontmatter to the full README_en.md instead of
writing a separate summary. Keeps HF Space description in sync
with the GitHub repo README.

Files changed (2) hide show
  1. .github/workflows/deploy-hf.yml +20 -46
  2. Makefile +5 -15
.github/workflows/deploy-hf.yml CHANGED
@@ -13,18 +13,8 @@ jobs:
13
  include:
14
  - space_var: HF_SPACE
15
  title: VeilRender
16
- note: >-
17
- > **Note / 注意**: This Space requires an API token. For a public demo, see
18
- [veilrender-public](https://huggingface.co/spaces/oaklight/veilrender-public).
19
- >
20
- > 此 Space 需要 API token 认证。公开演示请访问
21
- [veilrender-public](https://huggingface.co/spaces/oaklight/veilrender-public)。
22
  - space_var: HF_SPACE_PUBLIC
23
  title: VeilRender Public
24
- note: >-
25
- > **Note / 注意**: This is a public demo with no auth. For production use, self-host via Docker with a token.
26
- >
27
- > 此实例为公开演示,无需认证。生产环境请通过 Docker 自行部署并配置 API token。
28
  steps:
29
  - uses: actions/checkout@v6
30
  with:
@@ -34,45 +24,29 @@ jobs:
34
  - name: Prepare HF Space files
35
  env:
36
  SPACE_TITLE: ${{ matrix.title }}
37
- SPACE_NOTE: ${{ matrix.note }}
38
  run: |
39
- # Remove symlink and all non-essential files first
40
- rm -f README.md README_en.md README_zh.md
41
- rm -rf .github .pre-commit-config.yaml CLAUDE.md Makefile BENCHMARK.md
42
-
43
- # Write fresh README with HF frontmatter
44
- cat > README.md <<EOF
45
- ---
46
- title: ${SPACE_TITLE}
47
- emoji: 👻
48
- colorFrom: gray
49
- colorTo: purple
50
- sdk: docker
51
- app_port: 7860
52
- pinned: false
53
- ---
54
-
55
- # ${SPACE_TITLE}
56
-
57
- Headless browser rendering API — accepts a URL, renders with headless Chromium, returns HTML / Markdown / readability content.
58
-
59
- 无头浏览器渲染 API — 接收 URL,通过无头 Chromium 渲染,返回 HTML / Markdown / 可读性提取内容。
60
 
61
- ${SPACE_NOTE}
62
-
63
- ## Links
64
-
65
- - **GitHub**: [Oaklight/veilrender](https://github.com/${{ github.repository }}) — source code, docs & issues
66
- - **Docker Hub**: [oaklight/veilrender](https://hub.docker.com/r/oaklight/veilrender) — pre-built multi-arch images
67
- - **PyPI**: [veilrender](https://pypi.org/project/veilrender/)
68
-
69
- ## Quick Start
70
 
71
- \`\`\`bash
72
- docker run -p 7860:7860 -e VEILRENDER_API_TOKEN=your-secret oaklight/veilrender
73
- \`\`\`
74
- EOF
75
- sed -i 's/^ //' README.md
76
 
77
  - name: Push to HF Space
78
  env:
 
13
  include:
14
  - space_var: HF_SPACE
15
  title: VeilRender
 
 
 
 
 
 
16
  - space_var: HF_SPACE_PUBLIC
17
  title: VeilRender Public
 
 
 
 
18
  steps:
19
  - uses: actions/checkout@v6
20
  with:
 
24
  - name: Prepare HF Space files
25
  env:
26
  SPACE_TITLE: ${{ matrix.title }}
 
27
  run: |
28
+ # Prepend HF frontmatter to README_en.md content
29
+ {
30
+ printf '%s\n' \
31
+ '---' \
32
+ "title: ${SPACE_TITLE}" \
33
+ 'emoji: 👻' \
34
+ 'colorFrom: gray' \
35
+ 'colorTo: purple' \
36
+ 'sdk: docker' \
37
+ 'app_port: 7860' \
38
+ 'pinned: false' \
39
+ '---' \
40
+ ''
41
+ cat README_en.md
42
+ } > README.hf.md
 
 
 
 
 
 
43
 
44
+ # Replace README symlink with the combined file
45
+ rm -f README.md README_en.md README_zh.md
46
+ mv README.hf.md README.md
 
 
 
 
 
 
47
 
48
+ # Remove non-essential files
49
+ rm -rf .github .pre-commit-config.yaml CLAUDE.md Makefile BENCHMARK.md
 
 
 
50
 
51
  - name: Push to HF Space
52
  env:
Makefile CHANGED
@@ -79,23 +79,13 @@ endif
79
  TMP=$$(mktemp -d); \
80
  git clone --depth 1 . "$$TMP/repo"; \
81
  cd "$$TMP/repo"; \
 
 
 
 
82
  rm -f README.md README_en.md README_zh.md; \
 
83
  rm -rf .github .pre-commit-config.yaml CLAUDE.md Makefile BENCHMARK.md; \
84
- printf '%s\n' \
85
- '---' \
86
- 'title: VeilRender' \
87
- 'emoji: 👻' \
88
- 'colorFrom: gray' \
89
- 'colorTo: purple' \
90
- 'sdk: docker' \
91
- 'app_port: 7860' \
92
- 'pinned: false' \
93
- '---' \
94
- '' \
95
- '# VeilRender' \
96
- '' \
97
- 'Headless browser rendering API. See [GitHub repo](https://github.com/Oaklight/veilrender) for full documentation.' \
98
- > README.md; \
99
  git add -A; \
100
  git commit -m "deploy $$COMMIT" --allow-empty; \
101
  git push --force "https://oauth2:$${HF_TOKEN}@huggingface.co/spaces/$(HF_SPACE)" HEAD:main; \
 
79
  TMP=$$(mktemp -d); \
80
  git clone --depth 1 . "$$TMP/repo"; \
81
  cd "$$TMP/repo"; \
82
+ { printf '%s\n' '---' 'title: VeilRender' 'emoji: 👻' \
83
+ 'colorFrom: gray' 'colorTo: purple' 'sdk: docker' \
84
+ 'app_port: 7860' 'pinned: false' '---' ''; \
85
+ cat README_en.md; } > README.hf.md; \
86
  rm -f README.md README_en.md README_zh.md; \
87
+ mv README.hf.md README.md; \
88
  rm -rf .github .pre-commit-config.yaml CLAUDE.md Makefile BENCHMARK.md; \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  git add -A; \
90
  git commit -m "deploy $$COMMIT" --allow-empty; \
91
  git push --force "https://oauth2:$${HF_TOKEN}@huggingface.co/spaces/$(HF_SPACE)" HEAD:main; \