使用 Hugo,我尝试生成一个包含包含
yaml
的代码块的站点。我没有使用特殊的模板或任何可选的东西。当构建网站而不是代码块时,只需一个
e>
显示在 HTML 中。我猜转换出了问题,因为我的
yaml
代码中有一个缺陷。这就是yaml
:
name: Update all wiki articles
on:
push:
branches:
- main
paths:
- docs/vimwiki/**
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs/vimwiki
env:
content: ./wiki/content
steps:
- uses: actions/checkout@v4
- name: Cloning repo
env:
# Github personal access token
TOKEN: ${{ secrets.WIKI_REPO_TOKEN_RW }}
run: |
git config --global user.email "<>"
git config --global user.name "Github Actions Runner"
git clone --single-branch --branch main \
"https://x-access-token:[email protected]/hmaier-dev/wiki.git" "wiki"
- name: Removing old files
run: |
find $content -name '*.md' -type f -exec rm {} \;
ls -la
- name: Copy over new files
run: |
# Whitelist of all publishable wiki articles
cp index.md $content
# more publishable markdown files...
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.12'
# Optional:
# Give special treatment to index.wiki because it needs to get censored
- name: Censor index.wiki
run: |
cd $content
python ../build/extract.py index.md
# Pushing to the public wiki
- name: Commit and push new files
run: |
cd wiki
git checkout main
git add .
git diff-index --quiet HEAD || git commit -m "Automatic wiki-publish"
git push origin main
Hugo 没有提供特殊的输出。构建站点时,
yaml
中的哪些部分可能会出现故障?还是代码块太长了?
感谢您的宝贵时间。
通过重写我的文章,我发现删除了以下评论,来自:
- name: Copy over new files
run: |
# Whitelist of all publishable wiki articles
cp index.md $content
# more publishable markdown files...
到
- name: Copy over new files
run: |
# Whitelist of all publishable wiki articles
cp index.md $content
我可以让它工作。 我认为行尾的点(
...
)是问题所在。
谁能提供更多有关这方面的信息?