nicokaiser / hugo-theme-gallery

Gallery Theme for Hugo
https://nicokaiser.github.io/hugo-theme-gallery/
MIT License
368 stars 112 forks source link

"Page not found" When building #78

Closed realdeadbeef closed 3 months ago

realdeadbeef commented 3 months ago

Steps to reproduce

  1. hugo new site tomtakesphotos.com
  2. cd tomtakesphotos.com
  3. git init
  4. git submodule add --depth=1 https://github.com/nicokaiser/hugo-theme-gallery.git themes/gallery
  5. Add theme = 'gallery' to hugo.toml
  6. hugo serve or hugo

Result

image

CLI Output

Watching for changes in /home/deadbeef/Documents/tomtakesphotos.com/{archetypes,assets,content,data,i18n,layouts,static}
Watching for config changes in /home/deadbeef/Documents/tomtakesphotos.com/hugo.toml
Start building sites … 
hugo v0.132.2-3fd26c70dff5934ec1802b9563530130ed1bca75+extended linux/amd64 BuildDate=2024-08-14T16:17:21Z VendorInfo=gohugoio

WARN  found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

                   | EN  
-------------------+-----
  Pages            |  4  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  0  
  Processed images |  0  
  Aliases          |  0  
  Cleaned          |  0  

Built in 7 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) 
Press Ctrl+C to stop
nicokaiser commented 3 months ago

Could you check if your git submodule add command created all the necessary files from the repository in themes/gallery?

❯ ls -la themes/gallery
total 80
drwxr-xr-x  18 nkaiser  staff   576 Aug 17 22:19 .
drwxr-xr-x   3 nkaiser  staff    96 Aug 17 22:19 ..
-rw-r--r--   1 nkaiser  staff    42 Aug 17 22:19 .git
drwxr-xr-x   4 nkaiser  staff   128 Aug 17 22:19 .github
-rw-r--r--   1 nkaiser  staff    82 Aug 17 22:19 .gitignore
-rw-r--r--   1 nkaiser  staff   137 Aug 17 22:19 .prettierignore
-rw-r--r--   1 nkaiser  staff  1073 Aug 17 22:19 LICENSE
-rw-r--r--   1 nkaiser  staff  5285 Aug 17 22:19 README.md
drwxr-xr-x   5 nkaiser  staff   160 Aug 17 22:19 assets
drwxr-xr-x  11 nkaiser  staff   352 Aug 17 22:19 exampleSite
-rw-r--r--   1 nkaiser  staff    60 Aug 17 22:19 go.mod
drwxr-xr-x   9 nkaiser  staff   288 Aug 17 22:19 i18n
drwxr-xr-x   4 nkaiser  staff   128 Aug 17 22:19 images
drwxr-xr-x   5 nkaiser  staff   160 Aug 17 22:19 layouts
-rw-r--r--   1 nkaiser  staff   299 Aug 17 22:19 package.json
-rw-r--r--   1 nkaiser  staff   380 Aug 17 22:19 prettier.config.js
drwxr-xr-x   3 nkaiser  staff    96 Aug 17 22:19 static
-rw-r--r--   1 nkaiser  staff   457 Aug 17 22:19 theme.toml

When I execute exactly the commands you use, also with hugo v0.132.2+extended, and it works... Seems like something is missing, I get the 404 page when I do not add `theme = 'gallery'" to hugo.toml...

❯ cat hugo.toml
baseURL = 'https://example.org/'
languageCode = 'en-us'
title = 'My New Hugo Site'
theme = 'gallery'
realdeadbeef commented 3 months ago
deadbeef@mintVM:~/Documents/tomtakesphotos.com$ ls -lh themes/gallery/
total 52K
drwxrwxr-x 4 deadbeef deadbeef 4.0K Aug 17 20:37 assets
drwxrwxr-x 6 deadbeef deadbeef 4.0K Aug 17 20:37 exampleSite
-rw-rw-r-- 1 deadbeef deadbeef   60 Aug 17 20:37 go.mod
drwxrwxr-x 2 deadbeef deadbeef 4.0K Aug 17 20:37 i18n
drwxrwxr-x 2 deadbeef deadbeef 4.0K Aug 17 20:37 images
drwxrwxr-x 4 deadbeef deadbeef 4.0K Aug 17 20:37 layouts
-rw-rw-r-- 1 deadbeef deadbeef 1.1K Aug 17 20:37 LICENSE
-rw-rw-r-- 1 deadbeef deadbeef  299 Aug 17 20:37 package.json
-rw-rw-r-- 1 deadbeef deadbeef  380 Aug 17 20:37 prettier.config.js
-rw-rw-r-- 1 deadbeef deadbeef 5.2K Aug 17 20:37 README.md
drwxrwxr-x 3 deadbeef deadbeef 4.0K Aug 17 20:37 static
-rw-rw-r-- 1 deadbeef deadbeef  457 Aug 17 20:37 theme.toml
nicokaiser commented 3 months ago

Looks okay, could you check your hugo.toml?

realdeadbeef commented 3 months ago

I've just fixed it, really sorry, I didn't have auto-save enabled in my IDE, so none of my changes were actually saving :sob: