{"id":26895846,"url":"https://github.com/ffabut/hugo-example","last_synced_at":"2026-04-29T01:04:40.001Z","repository":{"id":236261471,"uuid":"792248063","full_name":"ffabut/hugo-example","owner":"ffabut","description":"Example repository of automated Hugo build and deployment using the Github Actions.","archived":false,"fork":false,"pushed_at":"2025-03-24T11:02:17.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-24T12:23:30.225Z","etag":null,"topics":["github-actions","github-pages","hugo","static-site-generator","static-web"],"latest_commit_sha":null,"homepage":"https://ffabut.github.io/hugo-example/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ffabut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-26T09:22:31.000Z","updated_at":"2025-03-24T11:02:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3846222-ff54-4393-a3c6-d7486b74c8df","html_url":"https://github.com/ffabut/hugo-example","commit_stats":null,"previous_names":["ffabut/hugo-sample-page","ffabut/hugo-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffabut%2Fhugo-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffabut%2Fhugo-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffabut%2Fhugo-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffabut%2Fhugo-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffabut","download_url":"https://codeload.github.com/ffabut/hugo-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246574851,"owners_count":20799221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","github-pages","hugo","static-site-generator","static-web"],"created_at":"2025-04-01T02:58:51.013Z","updated_at":"2026-04-29T01:04:39.954Z","avatar_url":"https://github.com/ffabut.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hugo Sample Page\n\nThis is an sample/example/boilerplate repository showing minimalistic Hugo project with automated builds and deployments (in Github Actions) to hosting on GitHub Pages.\nYou can fork this repository and use it a starting point for your own website.\nOr just copy the [.github/workflows/build.yml] to your existing Hugo project to automate its build and deployment.\n\n## Description\n\n### How repo was made\nThis is a boring stuff, just to explain the Hugo code in this repo.\nThere is nothing fancy, mostly just default hugo commands to init a Hugo project:\n\n1. `hugo new site hugo-sample-project` to init Hugo project, `cd hugo-sample-project` to get inside the project directory\n2. `hugo new theme default-theme` to init default Hugo template (otherwise it would not build)\n3. added `theme = 'default-theme'` to hugo.toml to activate the theme\n4. added file `.gitignore` with line `public` to ignore local builds in `public` directory (no need to keep this in git history)\n5. that is all 99% of this repository\n\n## Automation\n\n### Why automation\nThis repository uses Github Actions to automate builds and deployments.\nActions are free for public repositories and there is quite some free runners time for private repos.\nUsing the Actions we can automate the build, which saves us need to run `hugo` or `hugo --minify` before every commit.\n\nAutomation is also practical for situations when you collaborate on one web with multiple people.\nIdeally everybody creates a PR for their changes, PR is tested, accepted by others and it is merged to the main branch.\nWithout automation, one would need to pull the changes from main branch, build the page with `hugo --minify` and push the changes in `./public` directory back to repository.\nAutomation can detect new commit in `main` branch, it installs Hugo on virtual computer, runs the build and uploads the contents of `public` directory into `gh-pages` branch, from which website is being served by GitHub Pages.\nThis saves you from wasting your time and making mistakes!\n\n### Workflow definition\nGithub Actions expects workflow files to be stored at `.github/workflows` directory.\nThis repo contains one file `.github/workflows/build.yml` which defines the workflow for build and deployment.\nThere is no special need to change this file, it is just a standard workflow file, you can add it into your project.\nFor more information take a look at comments in the file.\nIn short:\n1. it runs on every push to `main` branch, and on every new commit in PR\n2. it starts virtual machine with Ubuntu operating system\n3. it installs Hugo\n4. it clones the repository (main branch or the PR branch)\n5. it runs `hugo --minify` command to build the website into `public` dir\n6. it uploads the contents of `public` directory into `gh-pages` branch\n\nOnce action successfully run, you can see the results on the `gh-pages` branch: https://github.com/username/reponame/tree/gh-pages (replace username and reponame with appropriate values, for this repo: ffabut and hugo-sample-project -\u003e https://github.com/ffabut/hugo-sample-page/tree/gh-pages).\n\n### Setup on your side\nYou need to enable Github Pages on your repo and configure it.\n1. go to https://github.com/username/reponame/settings/pages (for this repo it would be: https://github.com/ffabut/hugo-sample-page/settings/pages)\n2. in section `Build and deployment`\n3. set `Source` to `Deploy from branch`\n4. set `Branch` to `gh-pages` and `/root`\n\nWe select `Deploy from branch` and branch `gh-pages` because it is more practical to keep the built files outside our main branch, it keeps our main branch more clean, we do not clutter it by deploying to `public` directory in main branch.\n\nWe select `/root` directory because as we use different branch than main, there is no need to put the build into a directory like `public`.\nWe can just server from the root of the branch. \nGithub Action is configured in the same manner.\n\nOnce this is set, every push to `main` branch will trigger the build and deployment.\nAnd after a while, changes should be online!\nCongratz!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffabut%2Fhugo-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffabut%2Fhugo-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffabut%2Fhugo-example/lists"}