-
After making any changes (such as adding new posts, adjusting styles, etc.), first perform a commit.
git commit -m ""
-
Next, build the entire site with the new changes. The static site will be built into the
docs/
directory (for the GitHub page). Hugo default ispublic/
.hugo -D
-D
flag means build with drafts. -
Finally, commit once more to upload the built static site to GitHub.
git commit -m "build"
hugo server -D
hugo new posts/new_post.md
Hugo will not automatically clean up static site in the docs/
directory for you, so
every time you rebuild, the new content will be mixed with the old content. Although it
rarely causes conflicts, it is better to run before rebuilding: rm -rf docs/*
— with
cautious!
See this issue: 'hugo clean'
Use the post's slug:
[Link to post]({{< ref "/posts/post-slug/" >}})
[Link to post](/posts/post-slug/)
## My Header {#my-header}
Some paragraph here. {#custom-para}
[Header](/posts/post/#my-header)
[Paragraph](/posts/post/#custom-para)