Skip to content

Add feature to add custom css/js instead of overwriting all content #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Forceu
Copy link
Owner

@Forceu Forceu commented Apr 3, 2025

No description provided.

@Forceu Forceu added the enhancement New feature or request label Apr 3, 2025
@Forceu Forceu linked an issue Apr 3, 2025 that may be closed by this pull request
@Forceu
Copy link
Owner Author

Forceu commented May 3, 2025

@MalteMagnussen I think you said that you heavily modified the Gokapi templates. With the next release (2.0), this will not be supported anymore, but rather there will be an option to add custom JS/CSS instead of modifying templates, which makes upgrading a lot easier and also does not create any issues in regard to the AGPL license. Let me know if that is working for you or if you have any idea for changes to make this more usable.

The proposed changes are in this PR, for x64 systems I created the docker image f0rc3/gokapi:testing-customcontent to test it.

For adding custom content, create the folder custom in the folder where the binary is running (with docker, mount a folder to /app/custom). Any file in this directory will be available in the sub-URL /custom/.

To have custom CSS included, create a file in the folder named custom.css. The CSS will be applied to all pages
To have custom JS included, create a file public.js for all public pages and/or admin.js for all admin-related pages. Please note that the admin.js will be readable without login.
To prevent caching issues, you can version your files by creating the file version.txt with a version number.

@Forceu Forceu marked this pull request as ready for review May 3, 2025 18:52
@MalteMagnussen
Copy link

@Forceu - Thank you for the heads up! :)

This sounds great! Will take a look, once I am back to work. Currently away from work for a couple of weeks to attend to personal matters, but will have a talk with the users and the new maintainer once I am back.

I am part of the internal developer platform team, so after I set up Gokapi for use by our 2nd-level support, I did a hand-over of the internal repo to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add option to have additional CSS/JS that is loaded
2 participants