Jieiku / abridge

Fast & Lightweight Zola Theme
https://abridge.pages.dev/
MIT License
142 stars 41 forks source link

Does not register a service worker that controls page and start_url. #158

Closed sachinsenal0x64 closed 6 months ago

sachinsenal0x64 commented 6 months ago

I use cloudflare pages, any solution ? thanks.

image

Jieiku commented 6 months ago

No solution at the moment because I have not tried using cloudflare pages before. I think cloudflare pages has a free account, so I could probably look into this when I have time, but at the moment I am too busy.

I know that it works on netlify, that is where the demo is currently hosted. I have also tested it on self hosted services and it works there as well, so I would think it could be made to work with cloudflare pages too.

Jieiku commented 6 months ago

I attempted installing this on cloudflare pages: https://developers.cloudflare.com/pages/framework-guides/deploy-a-zola-site/#deploy-with-cloudflare-pages

I had to change the build system to version 1: https://community.cloudflare.com/t/zola-build-fails-not-found/535948/4

Open the project Settings tab and navigate to the Builds & deployments sub-tab. Scroll down to Build system version and click Configure Production build system. Change the build system from version 2 to version 1 so that Zola will be installed.

additionally I added another environment variable:

DEPLOY_PRIME_URL and set it to https://blogcloudflare.pages.dev

I then also set the build command to:

zola build --base-url $DEPLOY_PRIME_URL && npm run abridge && zola build --base-url $DEPLOY_PRIME_URL

The site is working properly with the pwa detected on cloudlfare pages: https://blogcloudflare.pages.dev/

2024-01-02_14-02-29

Closing because I was unable to reproduce the issue.

sachinsenal0x64 commented 6 months ago

Thank you very much

sachinsenal0x64 commented 6 months ago

I used this command with build system version 2 so all working fine :) = asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.17.2 && asdf global zola 0.17.2 && zola build --base-url $DEPLOY_PRIME_URL

Jieiku commented 1 week ago

Just wanted to add some info here. I added the ability to pass arguments via npm to the node script. So for the v2 build system I now do this at cloudflare pages:

asdf plugin add zola https://github.com/Jieiku/asdf-zola && asdf install zola 0.19.1 && asdf global zola 0.19.1 && npm run abridge -- "--base-url https://abridge.pages.dev"