-
Notifications
You must be signed in to change notification settings - Fork 296
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
Allow using third-party templates without overwriting Shaarli's default #163
Comments
Then wouldn't it be simplier if we all keep our template set in our "Github space" and list them somewhere here? EDIT: Do you want me to close the PR as we're at it? |
Yep you can close the PR as this issue is now open :)
I don't know. You can still maintain your theme in your own repos, but just Having all these templates in the org would ensure we have a list of known, maintained, compatible templates, and in the long run template maintainers can maintain each other's work (fixes, version bumps...) via the org. The templates would also be easily accessible/discoverable at https://github.com/shaarli/Shaarli. But yeah, even if we don't create these repos, I'm pinging everyone to see if the change is worth it (will we have a significant number of compatible templates? currently people's work is not compatible for easy install, the CSS is still old school, etc. Maybe we can help each other with this) |
Good Idea! I'm in! :) But what about assets (js, css, fonts)? Should Shaarli not be updated accordingly? |
@VinM replied https://github.com/Vinm/Blue-theme-for-Shaarli/issues/2#issuecomment-78364265:
|
@AkibaTech Well this is what we have to solve. The way I see it, the dir structure could be like
And we should do the same for the default template (mov |
Dooooooooone!!!! (with a new branch called "shaarli-template") |
@AkibaTech You should also include jQuery since we're trying to get rid of it. And it might be done soon if #165 is merged.
Yep that's probably better.
I agree for client side dependency (eg. not raintpl) and CSS. Except maybe |
All right. Theme updated :) |
You're right! I updated the dir structure above ^ @AkibaTech think you could do this? Thanks for your quick reply, I'll start working on a new branch soon and test your template there. And yep, include everything you would need client side, including jQuery. Edit: careful, I see you updated your readme, this feature is not implemented yet! :) Hope it will be soon. |
Know it :) Branch "shaarli-template" is for this awesome upcoming feature. Edit: I'll try to find time to update my theme and have a better result. |
|
Interested as well, I will update my template tomorrow to fit this new structure. |
It's done and available here: https://github.com/kalvn/shaarli-blocks/tree/shaarli-template By the way, if you want to make it easy for people to build custom templates, you should really define some path variables in index.php (like the absolute URL to templates, or at least the absolute URL of the installation) and make them available in the template because I noticed that some head files are automatically renamed and some aren't (for example CSS files) and it can quickly become a mess to understand why it doesn't work. |
I'm in too. 👏 I will create a new version soon (with flexbox). Rewrite the default HTML \o/
Reset.css does not have to come with Shaarli. Ex: some dev don't use it (ex: me), there are normalize etc. Dev must choose their one reset. |
I'll do it soon also :) |
You should never edit index.php directly. You should define index. php. should. never. be. touched. Else we lose the benefit of having "modular" templates, and upgrade becomes painful as index.php is overwritten every time. Edit: I've opened #166 to help alleviate confusion about where to write options, and make configuration easier. Edit2: @AkibaTech @kalvn Thanks for your work! Edit3: We will not provide a way to set this from the Edit4: I've updated the wiki with template installation instructions. See https://github.com/shaarli/Shaarli/wiki#changing-template |
Albinomouse available as template : https://github.com/alexisju/albinomouse-template |
I finally moved mine on the master branch. I also created a new theme with Material Design guidelines and also offered an installation for Shaarli 0.0.44 and above: https://github.com/kalvn/Shaarli-Material |
@kalvn great work! Thanks for your time, I'll look into this in the coming days (short on time right now). Another thing to consider when we will push the changes for 3rd party templates support (mainly changing the dir structure) is to know whether your templates will support plugins (eg. I see you're using the QR code library, but it is planned to make it optional/pluggable) and where we will put them in the dir structure. Please have a look at #164, feedback welcome. The dir structure refactoring to support third party templates will probably be part of this Pull Request in the future. @alexisju thanks to you too |
misterair replied: https://github.com/misterair/limonade/issues/7#issuecomment-86743026
|
Attention, you can no longer use |
ok |
Kinda duplicates #22. Also I think it's not a very good idea to have a main repo with all the themes. Everyone having its own repos and referencing in the docs is good enough. Closing. |
Users should be able to clone/unzip other templates into their
tpl/your-template-here
directories, and tell Shaarli to use them by setting theRAINTPL_TPL
config variable to this path. This prevents breaking Shaarli's upgrade path, and allows users to upgrade templates to their latest version easily.@ArthurHoaro has started something tending to this in #76.
tpl/default
, all links to/from the template rewritten and checked.That also means each third-party template has to be in it's own archive/repository to be able to clone/unpack it easily in it's own
tpl/your-template-here
.The https://github.com/shaarli/templates repo doesn't follow this model currently (the hoa.ro template is in a subdirectory). I'd be ok to rename it to template-hoaro and move contents directly at the root of the repo. @ArthurHoaro already has write access to this repo so he can keep maintaining it in the future.
@alexisju you also have a nice template at https://github.com/alexisju/Shaarli-AlbinoMouse, would you like me to create a template-albinomouse repository in the shaarli organization and give you write access there? You could sync your template there when you think it's ready, and maintain it in the future.
There are more third-party Shaarli templates listed in the wiki and it would be cool if the maintainers are willing to maintain their templates in the organization. So @kalvn @VinM @dhoko @AkibaTech @misterair ping. Do you want to join your work to the community fork and maintain your template in the oragnization? I can create repos and give you write access there.
We'll have to agree about a directory structure in this issue, or on https://gitter.im/shaarli/Shaarli (english only here, english or French on Gitter if that's more comfortable for you)
The text was updated successfully, but these errors were encountered: