How to add GET parameter to CSS filename in plugin JCH Optimize (Joomla) - optimization

I cannot find an answer to for several weeks. Perhaps my experience in development is not so great :) One site uses the JCH Optimize plugin and I noticed that after clearing the old memory (caches), the CSS and JS file links do not change, i.e. the names of these files remain old. The problem is that the browser checks the file name and if it has not changed, then the site visitors show the old version of the style file. The question itself, where in the plugin (in which code file) i can add some GET parameters ?vers = 1.1 so that for the browser it is a new file and it would update the information for users. I will be glad to hear any solutions. Thanks.

The names of the combined css and javascript files are keyed from the names of the individual files on the page. Clearing the cache will not cause the plugin to generate a different file name.
As of version 7.0.0, there is an option to generate a different cache key if you want to change the names of the combined file. Update your current version to get that capability.

Related

Exclude files from search in VSCode's extension

My VSCode extension creates a database of symbols and stores it along the project. I'd like to automatically exclude this file from search results (it would be even better to exclude it from file explorer).
Is there a way how can I modify "search.exclude" from my extension or can I set such a setting in my extension's package.json?
There is no API for you to contribute to search.exclude and/or files.exclude settings, so you are out of luck on this.
On the other hand, you can make your extension to update the User Settings using workspace.getConfiguration("section").update("section") API. With that, search.exclude and/or files.exclude settings could de updated to respect the symbols you want to be ignored.
But, I would suggest you to warn the users about this process, asking for their approval, before effectively updating the setting. Personally, I don't do this, and prefer that extensions that don't do this as well, but I understand sometimes this is necessary/inevitable.
Hope this helps

Docusaurus locale Fr always falls back to English in new projects

I am fairly new to Docusaurus. I created my first documentation site in May 2022 with Docusaurus v2 and with a bit of trial and error (getting folder name and filenames exact etc) I managed to get it working in English and French and with versioning. During this process Docusaurus 2 upgraded several times.
Now I am trying to make two other sites and in both cases they always fall back to English when I run the locale Fr (npm run start -- --locale fr).
I have checked folder names and filenames and they all match. As a test I copied some files from the third site to the first site and they work as expected. The only way I can get French in the two new sites is to put them in the docs (English) folder. This is not ideal but is a workaround.
I am wondering if it is a bug when starting from the newer updates? However, no-one else seems to have written in with similar problems. So it may be something I am doing but I just can't see what I am doing wrong. The site I originally created has upgraded to the newest and continues to work, it is just the newer sites that were created with the updates that aren't working.
Has anyone else seen this? Any help would be much appreciated. Thanks.
Edit:
As I said, I am new to Docusaurus, so the problem was my misunderstanding of the file structure. My first working site had versioning as well two locales, so the files were correctly in a current folder. My next sites didn't have versioning so I didn't have the French in a current folder. Once the files were moved the problem was solved.
If you look carefully at the diagram (https://docusaurus.io/docs/api/plugins/#docusaurus/plugin-content-docs#i18n) it does say to put translated files in a current folder, and then it has versions folder directly below.
Whereas the English is very different. It doesn't have current and has the version files in a very separate folder.
Thanks to Joshua for his help.

how can I execute a three.js example in my project folder?

How can I execute a three.js example in my project folder? The example I want to execute is this:
https://threejs.org/examples/webgl_animation_keyframes.html
.
After installing three.js through npm, I copied example's source code:
https://github.com/mrdoob/three.js/blob/master/examples/webgl_animation_keyframes.html
in my empty examples folder located at '/node_modules/three/examples'.
I think there's a path direction problem importing some of including library files such as
"import { RoomEnvironment } from './jsm/environments/RoomEnvironment.js';"
"loader.load( 'models/gltf/LittlestTokyo.glb', function ( gltf )"
etc.
Do I have to copy those library files and paste it on the right path by hand? I'm afraid this is not a correct solution. Is there a solution something like, as I wish, downloading all necessary library files in the right places by input some npm command?
The situation is certainly not ideal, but here are some tips:
You can clone the whole repository so you have all the resources used by the examples: git clone --depth=1 https://github.com/mrdoob/three.js.git
You can use a web browser's web page saving feature (Ctrl+S) but be sure to replace the HTML with the example's source HTML, because it will be much cleaner. You'll need to fix up file path references, and it may still miss some resources. Also make sure not to get the iframe containing page, but rather the demo itself.
If Save Webpage As misses some resources, you can use Chrome's dev tools Network tab. Refresh the page to populate it, then right click inside the table > Copy > Copy All as CURL. This will give you a command you can paste in your terminal (in an empty directory, ideally) to download all the resources used by the webpage. This can still miss some resources that are dynamically loaded, such as with 1. the model selector in the LDraw Loader example, in which case you could switch to each model to purposely populate the network requests table, or 2. a fallback for older browsers, in which case you may not be able to get it through this method.
It's much easier to remove features than to add and combine them, so try to find an example that uses as many of the things you want as possible (without being overwhelmingly complex). It's worth looking outside of the official examples to real projects and third party experiments. Just note that they may not be up to date with the latest APIs.
I hope someone writes a script to automate setting up a Three.js project from an example... and posts a better answer than this!

logrotate keep old file names

By default log rotate shifts file name's index on each rotation. I would like to keep names for old files. On each rotation: create new files + delete outdated.
Reason: every time I am rsycn those files with another sever, I have to download ALL file instead of simply downloading newly created ONE file and removing outdated ONE file.
Thanks
This web site and its users simply s#cks! This web site dedicated to newbie questions, which later will be replied by another group of newbies who will use google search to copy&paste reply (have no clue what they are saying) or by replying irrelevant clarification posts.

Relationship between codes under bootstrap configuration and the CMS console?

Whenever I change the configurations e.g. under hst:pages in the CMS console, will it get reflected in the XML files under bootstrap configuration?
On the other hand, when I update the XML file under bootstrap configuration, is it supposed to be reflected in the CMS console as well?
I've tried (I increased the version number in the hippoecm-extension.xml file, cleaned and rebuilt the project) but this doesn't seem to happen
1) Your changes will get reflected in the XML files only if you have the auto-export feature activated. More information on this feature can be found here:
http://www.onehippo.org/library/development/automatic-export-add-on.html
2) You have to do several things for this to work: update the version number in the XML file, mark the item you want to reload as reload on startup, and add the flag -Drepo.bootstrap=true when you start the server. You can find more detailed information on this topic here:
http://www.onehippo.org/library/concepts/update/deploying-content-and-configuration-updates.html