Comments (7)
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.
Grand! I'll include that in the next release.
from pagefind.
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.
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.
@bglw that would be really helpful, then I can replace my google search with Pagefind and it will work fully offline too.
from pagefind.
Sounds fine for now, thanks!
from pagefind.
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.jsI 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)
- Dark mode in default pagefind-modular-ui.css HOT 6
- H1 elements not being indexed HOT 2
- [Feature request] Score exact name of page highly HOT 1
- The path to the image is not found
- Special characters (p.e. Umlauts) in page's file names are not escaped, causing not working links HOT 2
- CSS Validation Parse Error: .pagefind-ui__button.svelte-193m69l | Value Error : color ----pagefind-ui-primary HOT 1
- Runtime error "unreachable executed" when search term contains emoticon HOT 1
- Support of specific "target" for <a> links by default UI to open result documents in different frame HOT 2
- ModularUI results do not update on scroll HOT 4
- Sort ModularUI FilterPills HOT 2
- Difference in the results by including `a` in the middle. HOT 4
- Problem with domains and subdomains HOT 4
- Error in documentation for the bundle path option
- Consider exposing the types on the Pagefind client
- feature request: Python wrapper package, Python API HOT 6
- Allow to specify the path of the config file HOT 1
- Allow to override default weight of HTML elements in config
- Add UI search event hooks HOT 1
- Pagefind 1.1.0 output is not stable HOT 1
- Speical Symbols
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagefind.