..Website is not deployed after pushing the change to
Posts are not listed under
Troubleshooting for Deploying Hugo on GitHub
Website is not deployed after pushing the change to master
branch
gh-pages.xml
which deploys the change to gh-pages
branch had two issues. The branch name from the tutorial is main
which is not matched with the default branch from the GitHub. master
is correct branch name.
on:
push:
branches:
- master # This was main. Fix it!
Also the if
statement below blocks the deployment. Remove or comment it out.
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
# if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
Posts are not listed under /
Looks like Permalinks
doesn’t work as expected with the skeletonfw theme.
When the permalinks
is configured, index.html
and list.html
should list up the posts under /posts according to the doc - Lists of Contents in Hugo.
[permalinks]
fixed = ":slug/"
posts = "/:year/:month/:slug/"
Example code for list.html:
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<li>
<a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
</li>
{{ end }}
But some reason it doesn’t work for me. So I needed to rewrite index.html
to render the /posts
instead of trying to list up the posts. The commit is here.
Use custom domain with the DreamHost
- Make sure to set your domain to
DNS Only
in DreamHost. Also remove any redirection. - Configure an apex domain from GitHub. Create
A
records with the IP addresses for GitHub pages. This is needed to use GitHub DNS when the custom domain is queried. So now when you enter the custom domain to a web browser, the GitHub DNS is used for look-up. - Add
CNAME
file with your custom domain name under the root of GitHub webpage. The GitHub DNS will useCNAME
to look up the custom domain. The commit link is here.
Make it searchable
Refer the post
Remaining taks
- Verify the custom domain according to the instruction