|
| 1 | +<img align="right" width="150" alt="logo" src="https://user-images.githubusercontent.com/5889006/190859553-5b229b4f-c476-4cbd-928f-890f5265ca4c.png"> |
| 2 | + |
| 3 | +# Hugo Theme Stack Starter Template |
| 4 | + |
| 5 | +This is a quick start template for [Hugo theme Stack](https://github.com/CaiJimmy/hugo-theme-stack). It uses [Hugo modules](https://gohugo.io/hugo-modules/) feature to load the theme. |
| 6 | + |
| 7 | +It comes with a basic theme structure and configuration. GitHub action has been set up to deploy the theme to a public GitHub page automatically. Also, there's a cron job to update the theme automatically everyday. |
| 8 | + |
| 9 | +## Get started |
| 10 | + |
| 11 | +1. Click *Use this template*, and create your repository as `<username>.github.io` on GitHub. |
| 12 | + |
| 13 | + |
| 14 | +2. Once the repository is created, create a GitHub codespace associated with it. |
| 15 | + |
| 16 | + |
| 17 | +3. And voila! You're ready to go. The codespace has been configured with the latest version of Hugo extended, just run `hugo server` in the terminal and see your new site in action. |
| 18 | + |
| 19 | +4. Check `config` folder for the configuration files. You can edit them to suit your needs. Make sure to update the `baseurl` property in `config/_default/config.toml` to your site's URL. |
| 20 | + |
| 21 | +5. Open Settings -> Pages. Change the build branch from `master` to `gh-pages`. |
| 22 | + |
| 23 | + |
| 24 | +6. Once you're done editing the site, just commit it and push it. GitHub action will deploy the site automatically to GitHub page asociated with the repository. |
| 25 | + |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +In case you don't want to use GitHub codespace, you can also run this template in your local machine. **You need to install Git, Go and Hugo extended locally.** |
| 30 | + |
| 31 | +## Update theme manually |
| 32 | + |
| 33 | +Run: |
| 34 | + |
| 35 | +```bash |
| 36 | +hugo mod get -u github.com/CaiJimmy/hugo-theme-stack/v3 |
| 37 | +hugo mod tidy |
| 38 | +``` |
| 39 | + |
| 40 | +> This starter template has been configured with `v3` version of theme. Due to the limitation of Go module, once the `v4` or up version of theme is released, you need to update the theme manually. (Modifying `config/module.toml` file) |
| 41 | +
|
| 42 | +## Deploy to another static page hostings |
| 43 | + |
| 44 | +If you want to build this site using another static page hosting, you need to make sure they have Go installed in the machine. |
| 45 | + |
| 46 | +<details> |
| 47 | + <summary>Vercel</summary> |
| 48 | + |
| 49 | +You need to overwrite build command to install manually Go: |
| 50 | + |
| 51 | +``` |
| 52 | +amazon-linux-extras install golang1.11 && hugo --gc --minify |
| 53 | +``` |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +If you are using Node.js 20, you need to overwrite the install command to install manually Go: |
| 58 | + |
| 59 | +``` |
| 60 | +dnf install -y golang |
| 61 | +``` |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +Make sure also to specify Hugo version in the environment variable `HUGO_VERSION` (Use the latest version of Hugo extended): |
| 67 | + |
| 68 | + |
| 69 | +</details> |
0 commit comments