Code Monkey home page Code Monkey logo

Comments (7)

bglw avatar bglw commented on June 24, 2024 1

I'm not particularly on top of PWAs, but I could definitely add an option for configuring that query parameter. That would let you specify a custom query parameter rather than using the timestamp automatically, but would still allow you to set a new parameter on each build if you ran into caching issues. I'll wire that up 🙂

from pagefind.

bglw avatar bglw commented on June 24, 2024 1

Grand! I'll include that in the next release.

from pagefind.

bglw avatar bglw commented on June 24, 2024 1

Hi @geshan — unfortunately there wasn't a super simple way to drop this in with the latest release. This file is loaded on initialization before any options get passed to Pagefind in the browser, so there isn't a great way to connect this to a flag in a nice way. (and I'm hesitant to make it a build-time flag)

For now, after running pagefind you could automatically patch out that query parameter each time:

# Linux
pagefind && sed -i 's/?ts=${Date.now()}//g' public/_pagefind/pagefind.js

# MacOS
pagefind && sed -i '' 's/?ts=${Date.now()}//g' public/_pagefind/pagefind.js

I will keep ruminating on this though and try find a better solution that I'm comfortable with 🙂

from pagefind.

bglw avatar bglw commented on June 24, 2024 1

Ah, I had forgotten about this issue but I'll pencil in proper support soon! As of Pagefind 1.0, the file is not loaded on initialization, and passing options could totally influence this behavior, so I can certainly add an option to resolve this. I'll target the next release for that 🙂

from pagefind.

geshan avatar geshan commented on June 24, 2024

@bglw that would be really helpful, then I can replace my google search with Pagefind and it will work fully offline too.

from pagefind.

geshan avatar geshan commented on June 24, 2024

Sounds fine for now, thanks!

from pagefind.

alaminkouser avatar alaminkouser commented on June 24, 2024

Hi @geshan — unfortunately there wasn't a super simple way to drop this in with the latest release. This file is loaded on initialization before any options get passed to Pagefind in the browser, so there isn't a great way to connect this to a flag in a nice way. (and I'm hesitant to make it a build-time flag)

For now, after running pagefind you could automatically patch out that query parameter each time:

# Linux
pagefind && sed -i 's/?ts=${Date.now()}//g' public/_pagefind/pagefind.js

# MacOS
pagefind && sed -i '' 's/?ts=${Date.now()}//g' public/_pagefind/pagefind.js

I will keep ruminating on this though and try find a better solution that I'm comfortable with 🙂

It works for now and also works in GitHub Workflows. And yes, it needs a better solution.

from pagefind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.