gohugo-amp icon indicating copy to clipboard operation
gohugo-amp copied to clipboard

only index.html works. All others pages fail to load and get a 404.

Open ghost opened this issue 5 years ago • 6 comments

I pulled the code at: https://github.com/wildhaber/gohugo-amp.gohugohq.com

Then checked out the "develop" branch and kicked it off using "npm run go". It runs, but only the first page works on localhost:1313 All other pages like "http://localhost:1313/install/" get a 404. Not sure what i am doing wrong.... ??

Sorry about this. Must be something simple i am not getting ?

my make script:

LIB=github.com/wildhaber/gohugo-amp.gohugohq.com
LIB_FSPATH=$(GOPATH)/src/$(LIB)

## install on gopath and run
go get -u $(LIB)/...
cd $(LIB_FSPATH) && git checkout develop
cd $(LIB_FSPATH) && yarn install 
cd $(LIB_FSPATH) && npm run go

output:


cd /Users/apple/workspace/go/src/github.com/wildhaber/gohugo-amp.gohugohq.com && npm run go

> [email protected] go /Users/apple/workspace/go/src/github.com/wildhaber/gohugo-amp.gohugohq.com
> npm run hugo:server


> [email protected] hugo:server /Users/apple/workspace/go/src/github.com/wildhaber/gohugo-amp.gohugohq.com
> hugo server --buildDrafts --buildFuture


                   | EN
+------------------+----+
  Pages            | 88
  Paginator pages  |  0
  Non-page files   |  0
  Static files     | 11
  Processed images |  0
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Total in 70 ms
Watching for changes in /Users/apple/workspace/go/src/github.com/wildhaber/gohugo-amp.gohugohq.com/{content,data,i18n,layouts,static,themes}
Watching for config changes in /Users/apple/workspace/go/src/github.com/wildhaber/gohugo-amp.gohugohq.com/config.toml
Environment: "development"
Serving pages from memory
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

ghost avatar Jan 02 '19 12:01 ghost

I tried "npm run build:prod", and it generates the files in the "public" folder, but only the top level ones.

For instance, the index.html and no others. Same with the sitemap.xml. It only has:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    
    <url>
        <loc>https://gohugo-amp.gohugohq.com/</loc>
        <lastmod>2016-10-16T19:28:41+02:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>1</priority>
    </url>
    
    <url>
        <loc>https://gohugo-amp.gohugohq.com/</loc>
        <lastmod>2016-10-16T19:28:41+02:00</lastmod>
        <priority>0</priority>
    </url>
    
</urlset>

ghost avatar Jan 02 '19 12:01 ghost

If anyone can help me out it would be great. Have tried everything I can think of.

ghost avatar Jan 02 '19 16:01 ghost

Hey @gedw99, the example pages of the theme only contains an index.md (https://github.com/wildhaber/gohugo-amp/tree/develop/exampleSite/content)

If you're looking for the content of the documentation, you can find them here: https://github.com/wildhaber/gohugo-amp.gohugohq.com/tree/develop/content

wildhaber avatar Jan 08 '19 08:01 wildhaber

hey @wildhaber

thanks for the response. I am running off the Content in gohugo-amp.gohugohq.com, NOT the example site. You can see this in my Makefile in the first issue above.

So i have not idea whats wrong. Maybe the hugo version ? I am using:

hugo version Hugo Static Site Generator v0.53/extended darwin/amd64 BuildDate: unknown

ghost avatar Jan 08 '19 09:01 ghost

complete Makefile for replication:

# hugo based

# use this example site: github.com/wildhaber/gohugo-amp.gohugohq.com
LIB=github.com/wildhaber/gohugo-amp.gohugohq.com
LIB_FSPATH=$(GOPATH)/src/$(LIB)



print:
	@echo 
	@echo LIB :$(LIB)
	@echo LIB_FSPATH  : $(LIB_FSPATH)
	@echo
	ls $(LIB_FSPATH)


dep-all: dep-os dep dep-modules
	# get all deps

dep-os:
	brew install hugo
	brew install yarn

dep:
	# install on gopath
	mkdir -p $(LIB_FSPATH)
	cd $(LIB_FSPATH) && cd .. && rm -rf gohugo-amp && git clone https://$(LIB).git
	
	#cd $(LIB_FSPATH) git checkout develop
	
dep-modules:
	cd $(LIB_FSPATH) && yarn install 

code:
	cd $(LIB_FSPATH) && code .

clean:
	rm -rf $(LIB_FSPATH)

### 

run:
	cd $(LIB_FSPATH) && npm run go
run-d:
	rm -rf $(LIB_FSPATH)/public
	cd $(LIB_FSPATH) && hugo serve -p 1314 -v --baseURL http://localhost:1314 --buildDrafts --buildFuture --disableFastRender --renderToDisk --noHTTPCache

build:
	cd $(LIB_FSPATH) && npm run build:prod
build-d:
	rm -rf $(LIB_FSPATH)/public
	cd $(LIB_FSPATH) && hugo --buildDrafts --buildFuture --baseURL http://localhost:1315
	#cd $(LIB_FSPATH) && hugo gen



ghost avatar Jan 08 '19 09:01 ghost

@gedw99, I was having the same issue.

See https://GitHub.com/wildhaber/gohugo-amp.gohugohq.com/pull/11

yds avatar May 09 '19 12:05 yds