reference_themes_for_users.adoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. [#themes]
  2. = Themes (for users)
  3. You can look for themes on the link:http://www.olivetin.app/themes/[OliveTin Theme Site].
  4. == Installing a theme
  5. There are 3 ways to install a theme;
  6. If running inside a Docker container:
  7. 1. Use the `olivetin-get-theme` command to easily Git clone the theme into your `custom-webui/themes/` directory.
  8. If running without using containers:
  9. 1. Download the theme .zip and copy it across to your `custom-webui/themes/` directory.
  10. 2. Git Clone the theme into your `custom-webui/themes/` directory.
  11. [#get-theme]
  12. == How to use the `olivetin-get-theme` command
  13. The default OliveTin configuration comes with an action to get new OliveTin themes. If you deleted it from your configuration, you can add it back in by adding the following to your `config.yaml` file;
  14. [source,bash]
  15. ----
  16. actions:
  17. - title: Get OliveTin Theme
  18. shell: olivetin-get-theme {{ themeGitRepo }} {{ themeFolderName }}
  19. icon: theme
  20. arguments:
  21. - name: themeGitRepo
  22. title: Theme's Git Repository
  23. description: Find new themes at https://olivetin.app/themes
  24. type: url
  25. - name: themeFolderName
  26. title: Theme's Folder Name
  27. type: ascii_identifier
  28. ----
  29. When you are browsing the OliveTin Theme Site, you can click on a theme and see it's Git Repository URL. You can then copy this URL and paste it into the `olivetin-get-theme` command.
  30. == Where do I find my themes directory?
  31. When OliveTin starts up, it will try to create a directory called `custom-webui/themes/` in your config directory. This directory is where you can put your own custom themes.
  32. OliveTin will then serve this theme directory at `http://yourserver:1337/custom-webui/themes/`, this means that all theme content should go into `/custom-webui/themes/mytheme/`.
  33. Install Themes into your `custom-webui/themes/` directory, which should be in your config directory. If this directory does not exist, you can create it.
  34. [source,yaml]
  35. ----
  36. ├── config.yaml
  37. ├── custom-webui
  38. │ └── themes
  39. │ └── custom-icons
  40. │ ├── icon.png
  41. │ └── theme.css
  42. ├── entities
  43. │ ├── containers.json
  44. │ ├── heating.yaml
  45. │ ├── servers2.yml
  46. │ ├── servers.yaml
  47. │ └── systemd_units.json
  48. └── installation-id.txt
  49. ----
  50. == Create your own theme (without any intention of publishing it)
  51. Create a sub-directory under your theme directory (eg `custom-webui/themes/mytheme`);
  52. Set your theme in your config
  53. [source,yaml]
  54. .`config.yaml`
  55. ----
  56. themeName: mytheme
  57. ----
  58. Add your css into `custom-webui/themes/mytheme/theme.css`.
  59. Your theme css will be loaded "on top" of the existing stylesheet.
  60. To test it is working, set your theme CSS to something ridiculous like;
  61. ----
  62. body {
  63. background-color: red !important;
  64. }
  65. ----
  66. Profit.
  67. Check out xref:reference/reference_themes_for_developers.adoc[Themes for Developers] for more information on how to develop themes.