POSTS
Hugo Tips Part 2
Hugo Tips: Part 2
I only have 3 tips this time, but they are important:
Always always always remember to run
env HUGO_ENV="production" hugo
(or the equivalent on your system) rather than just plainhugo
. It is possible that runninghugo
will write the files indevelopment
mode, which puts NOCRAWL, NOINDEX tags on every page. These tags will prevent search engines from crawling your site. For Windows, it should beset HUGO_ENV=production
.If you have your site hosted on AWS (like me!), the AWS command line is by far the simplest way to get everything uploaded to the s3 bucket.
aws s3 sync . s3://my-bucket/ --acl public-read
This command will upload only the changed files and replace the outdated version on s3.
A related point: always verify the public permissions for the site!
Sources:
- Hugo Environment Variables
- How to set environment variables in Hugo
- Using High-Level (s3) Commands with the AWS CLI