imorente / atlas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Atlas, Hugo Boilerplate

Atlas

The Hugo boilerplate we use for our projects.

Disclaimer - This boilerplate has been heavily integrated with Netlify, and therefore many features are specific to the Netlify platform and may not work with other hosting providers.

Getting Started

To get started, you can either clone the repository, or deploy straight to Netlify. Then run the following from the project root:

npm install
npm run server

Available Commands

There are 3 commands available:

  • npm run build - Builds assets (sass, js, fonts, images) and runs hugo
  • npm run build:preview - The same as build, but runs hugo --buildDrafts --buildFuture
  • npm run server - Runs BrowserSync and watches for changes, running build when changes are detected

Robots.txt

A default robots.txt can be found at /layouts/robots.txt which is configured to disallow crawlers when the HUGO_ENV environment variable is not set to "production".

Headers

Headers can be configured within /layouts/index.headers, which is then built to /public/_headers.

This is a Netlify feature. Learn more about Headers with Netlify.

Security Headers

Atlas comes with some default headers to help you better protect your site. The default headers we include are: X-Frame-Options, X-XSS-Protection, X-Content-Type-Options, Referrer-Policy.

These headers are configured with the following values:

X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: origin-when-cross-origin

Redirects

Redirect rules can be appended to /layouts/index.redirects, which is then built to /public/_redirects.

This is a Netlify feature. Learn more about Netlify Redirects.

Aliases

Hugo Aliases are usually handled by <meta http-equiv="refresh" ...> tags. These have been disabled within config.toml with disableAliases = true, and instead are handled by Netlify Redirects. This is handled automatically and you should continue to add aliases as described in the Hugo documentation.

Deploy to Netlify

You can deploy directly to Netlify using this button:

Deploy to Netlify

License

MIT © Indigo Tree

About

License:MIT License


Languages

Language:JavaScript 55.0%Language:HTML 44.8%Language:CSS 0.1%