0

With the Hugo, I'm trying to generate a site with a code block containing yaml. I am using no special template or any optional stuff. When building the site instead of the codeblock just an

e>

is getting displayed in the HTML. I guess something has gone wrong with the conversion, because there is a flaw in my yaml-code. This is the 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

There is no special output the provided by Hugo. What part in the yaml could fail when building the site? Or is the codeblock just to long?

Thanks for your time.

EDIT: The codeblock is already formatted with yamllint.

DarkBee
14.4k9 gold badges86 silver badges135 bronze badges
asked Dec 15, 2024 at 17:33

1 Answer 1

0

By rewriting my article I found out that removing the following comment, from:

 - name: Copy over new files
 run: |
 # Whitelist of all publishable wiki articles
 cp index.md $content
 # more publishable markdown files...

to

 - name: Copy over new files
 run: |
 # Whitelist of all publishable wiki articles
 cp index.md $content

I could get it to work. I suppose the dots (...) at the end of the line where the issue. Can anyone provide some more information regarding this?

EDIT:

The dots at the end of the line were not the issue. With the first line

# How this wiki works

Hugo would treat this as Emcas Org Mode frontmatter.

When parsing

# more

Hugo detects a summary divider. Read more about this in the following github-issue: https://github.com/gohugoio/hugo/issues/13152#issuecomment-2544122463

answered Dec 15, 2024 at 17:33
Sign up to request clarification or add additional context in comments.

1 Comment

Hugo does not impose a specific length limit on code blocks, so a long YAML block isn't an issue. However, poorly formatted or unclosed blocks could cause Hugo to generate unexpected output like e>.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.