elementor / static-html-output

Static HTML Output Plugin for WordPress
https://statichtmloutput.com
The Unlicense
124 stars 33 forks source link

Docker: GitHub Pages deploy with custom crawling port wrong links #158

Closed KasperZutterman closed 3 years ago

KasperZutterman commented 3 years ago

When using the deploy to GitHub pages from inside a Docker container, I use the Custom crawling port: 8080, It crawls all pages just fine, but the links inside the files (css, js, ...) pushed to GitHub still contain the port:

e.g. www.testsite.com:8080/... where it should be: www.testsite.com/...

leonstafford commented 3 years ago

Hi @KasperZutterman - which plugin version are you using? This may be for the https://github.com/leonstafford/static-html-output plugin (the one with GitHub Pages publishing built in)

KasperZutterman commented 3 years ago

I am using v6.6.21 of the static HTML Output plugin. But had the same issue with v6.6.22 & v6.6.23.

It seems to me there should be an optional post-processing filter rule removing the selected crawl port.
I've had a look at the source code but didn't succeed in adding it myself.

leonstafford commented 3 years ago

Hi @KasperZutterman sorry for the late reply.

So, at least WP2Static does have a filter to override the port, perhaps in this repo, too, else we can quickly add.

However, what I think the issue is here is Docker related, which comes up from time to time.

If you can SSH/docker exec into your WP container and try to curl your WP address, which is... 80 or 443? And your docker WP container is exposing 8080, which doesn't match to your WordPress Site URL.

Main thing to do to get this working is to match up your WP site URL and the crawl URL, which is accessible from within your WP container.

If you're using a domain also, you may need to add that domain to the /etc/hosts file within WP container to be able to resolve it properly.

Hope that's giving you some ideas. There should be some other solutions in this repo's closed issues or in https://github.com/leonstafford/wp2static

I have a bit of a different setup in https://github.com/leonstafford/lokl, which I'm using solely now - WP and MySQL in same container and just localhost:port, with as many of these instances as I want. I did used to use a more regular Docker setup and just needed to do a cpl tweaks to get it working. I really should setup some example repos with everything running... for Docker and also for things like running these SSGs as Composer packages...

Please let me know how you go and I can have a better search if you're unable to find a solution

KasperZutterman commented 3 years ago

Hi @leonstafford, Thank you for your reply!

I switched to using lokl, this is an amazing tool! By using lokl I was able to resolve these issues!

Thanks again!

leonstafford commented 3 years ago

Hi @KasperZutterman - oh, cool! Glad you like Lokl, I've been really enjoying it. I'm working on some nice updates to that along with some other things at the moment. Please post any feedback for Lokl within that GitHub repo, there's only a few people so far I've heard of using it