# Hugo Not Generating HTML files Upon Build

**URL:** <https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030>\
**Category:** support\
**Created:** [December 12, 2021, 12:06pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030 "2021-12-12T12:06:41Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 12:06pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/1 "2021-12-12T12:06:41Z")

</div>

Here is my repo: [GitHub - joesan/joesan-me: My personal blogging website](https://github.com/joesan/bigElectrons)

What I’m trying to do is basically the following:

1. Upon commit to the master branch, trigger the GitHub actions
2. Checkout a copy of the master branch, install hugo, build and copy the contents of the public folder to a new branch called gh-pages
3. The gh-pages is then configured to serve the GitHub pages
4. Using my custom domain name, the page is redirected to GitHub pages when called.

Here is what I’m doing in my main.yaml:

```auto
      - name: Generate HTML
        run: hugo --minify
      - name: Commit and push to target branch
        run: |-
          hugo version
          echo "PRINTING CURRENT DIRECTORY......"
          pwd
          echo "PRINTING LS DIRECTORY......"
          ls -la
          cd public
          echo "PRINTING LS PUBLIC DIRECTORY......"
          ls -la
          git config --global user.email "workflow-bot@bigelectrons.com"
          git config --global user.name "workflow-bot"
          git checkout --orphan $TARGET_BRANCH
          mv public ..
          rm -rf *
          mv ../public/* .
          touch .nojekyll
          touch README.md
          echo 'https://www.bigelectrons.com - SITE GENERATED USING HUGO' > README.md
          touch CNAME
          echo 'bigelectrons.com' > CNAME
          rm -rf .github/
          rm -Rf .gitignore
          rm -Rf .idea
          git add .
          git commit -m "generated using hugo build"
          git push --set-upstream origin $TARGET_BRANCH --force

```

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 2:46pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/2 "2021-12-12T14:46:10Z")

</div>

I additionally see the following in my logs:

```auto
hugo --minify

[3](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:3) shell: /usr/bin/bash -e {0}

[4](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:4) env:

[5](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:5) TARGET_BRANCH: gh-pages

[7](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:7)Start building sites …

[8](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:8)hugo v0.90.1+extended linux/amd64 BuildDate=2021-12-10T15:22:29Z

[9](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:9)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[10](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:10)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for layout "archives" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[11](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:11)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for layout "navo" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[12](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:12)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for layout "projects" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[13](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:13)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[14](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:14)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[15](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:15)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[16](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:16)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[17](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:17)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[18](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:18)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

[19](https://github.com/joesan/bigElectrons/runs/4498309832?check_suite_focus=true#step:4:19)WARN 2021/12/12 14:38:51 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

```

Is that anything that I should pay attention to?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 12, 2021, 2:53pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/3 "2021-12-12T14:53:57Z")

</div>

> [@joesan](#):
>
> Is that anything that I should pay attention to?

Yes, all of it.

Recommendations:

1. Make sure you can build the site locally without errors or warnings _before_ trying to deploy.

2. Use an existing, proven workflow:

3. Once you have that working, make workflow modifications as needed.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 2:56pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/4 "2021-12-12T14:56:12Z")

</div>

On local machine it works flawlessly:

```auto
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/bigElectrons$ hugo --minify

                   | EN   
-------------------+------
  Pages | 147  
  Paginator pages | 13  
  Non-page files | 0  
  Static files | 63  
  Processed images | 0  
  Aliases | 53  
  Sitemaps | 1  
  Cleaned | 0  

Total in 274 ms
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/bigElectrons$

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 12, 2021, 3:02pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/5 "2021-12-12T15:02:25Z")

</div>

Which version of Hugo are you running locally?  
Which version of Hugo are you running on GH?

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 3:07pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/6 "2021-12-12T15:07:48Z")

</div>

Local:

```auto
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/bigElectrons$ hugo version
Hugo Static Site Generator v0.68.3/extended linux/amd64 BuildDate: 2020-03-25T06:15:45Z

```

GitHub build:

```auto
Run hugo version

[30](https://github.com/joesan/bigElectrons/runs/4498357591?check_suite_focus=true#step:5:30)hugo v0.90.1+extended linux/amd64 BuildDate=2021-12-10T15:22:29Z

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 12, 2021, 3:26pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/7 "2021-12-12T15:26:38Z")

</div>

v0.68.3 was released almost two years ago. Time to upgrade your local machine.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 3:29pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/8 "2021-12-12T15:29:09Z")

</div>

But that is strange as the older version works without producing any errors. I will update my local version and try and then post the results.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 3:35pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/9 "2021-12-12T15:35:58Z")

</div>

How to I upgrade the version on my local machine?

```auto
joesan@joesan-InfinityBook-S-14-v5:~$ sudo apt install hugo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
hugo is already the newest version (0.68.3-1)

```

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 3:45pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/10 "2021-12-12T15:45:44Z")

</div>

I managed to update the local machine and on my local machine it looks ok:

```auto
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/bigElectrons$ hugo --minify
Start building sites … 
hugo v0.90.1+extended linux/amd64 BuildDate=2021-12-10T15:22:29Z

                   | EN   
-------------------+------
  Pages | 147  
  Paginator pages | 13  
  Non-page files | 0  
  Static files | 63  
  Processed images | 0  
  Aliases | 53  
  Sitemaps | 1  
  Cleaned | 0  

Total in 312 ms
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/bigElectrons$ cd public/
drwxr-xr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  .
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  ..
.rw-rw-r-- joesan joesan 0 B Sat Dec 11 08:17:43 2021  .gitignore
.rw-rw-r-- joesan joesan 13.7 KB Sun Dec 12 16:43:51 2021  404.html
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  about
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  about-hugo
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  about-us
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  categories
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  contact
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  css
drwxr-xr-x joesan joesan 4 KB Sat Dec 11 08:17:43 2021  fonts
drwxr-xr-x joesan joesan 4 KB Sat Dec 11 20:16:38 2021  icons
drwxr-xr-x joesan joesan 4 KB Sat Dec 11 08:17:43 2021  images
.rw-rw-r-- joesan joesan 46.6 KB Sun Dec 12 16:43:51 2021  index.html
.rw-rw-r-- joesan joesan 40.9 KB Sun Dec 12 16:43:51 2021  index.xml
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  js
drwxr-xr-x joesan joesan 4 KB Sat Dec 11 21:15:23 2021  logos
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  page
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  post
.rw-rw-r-- joesan joesan 11.6 KB Sun Dec 12 16:43:51 2021  sitemap.xml
drwxrwxr-x joesan joesan 4 KB Sun Dec 12 16:43:51 2021  tags
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/bigElectrons/public$

```

I now seriously do not understand why it should not work on the remote GitHub page?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 12, 2021, 4:01pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/11 "2021-12-12T16:01:33Z")

</div>

> [@jmooring](#):
>
> Use an existing, proven workflow:
> 
> See: [https://gohugo.io/hosting-and-deployment/hosting-on-github](https://gohugo.io/hosting-and-deployment/hosting-on-github)

Get this working, then modify your workflow as needed.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 4:03pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/12 "2021-12-12T16:03:45Z")

</div>

I do not want to use the GitHub actions and I do not understand how adding the GitHub actions would make my issue vanish? Is there any relation to this?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 12, 2021, 4:23pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/13 "2021-12-12T16:23:24Z")

</div>

> [@joesan](#):
>
> Is there any relation to this?

Yes. You can learn from something that has been proven to work for many, many sites.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 4:33pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/14 "2021-12-12T16:33:59Z")

</div>

Ok I was able to make some progress. But now, the css seems to be messed up.

> **[bigelectrons](https://bigelectrons.com/)**
>
> A theme based on VMware's Clarity Design System for publishing technical blogs with Hugo.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 4:54pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/15 "2021-12-12T16:54:39Z")

</div>

Had a look at the developer tools. Seems CORS issue is blocking CSS from being rendered.

`Access to CSS stylesheet at 'https://www.bigelectrons.com/css/styles.01869c76e4757810d94ecbdccadba853d9d01d9416dfeb113df02e1479ff8b36e284e8bfeb3e8f353f2fdcdcbbdfcf27e558dbda96eb6341bfc304d55cd9e986.css' from origin 'https://bigelectrons.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 12, 2021, 6:42pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/16 "2021-12-12T18:42:52Z")

</div>

You are serving your site from `https://bigelectrons.com/` but you have set the baseURL in site config to `https://www.bigelectrons.com/`.

---

<div class="post-metadata">

**Author:** ![joesan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/joesan/32/15791_2.png) [@joesan](https://discourse.gohugo.io/u/joesan)\
**Post date:** [December 12, 2021, 6:45pm UTC](https://discourse.gohugo.io/t/hugo-not-generating-html-files-upon-build/36030/17 "2021-12-12T18:45:12Z")

</div>

Yes, figured that out. Seems everything is fine now. Thanks for the help. I however do not understand why the custom script that I wrote would not work.
