diff --git a/README.md b/README.md index a5ab63d9986d6de6a37299b9adcb0291ef535727..d004e26d8d7f4e3024632bae1b972ba3bffae175 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,27 @@ add pages that should be precreated by adding the following to your inventory wi ``` pages will be created inside the `/var/www/dokuwiki/data/pages/` folder. the template needs to be copied to the host beforehand, for example by using the `files` role. one level of directories deep is created by the role, nested directories can't be created. + + +## template style settings +change some default template settings +``` +template_style: + text = "#333333" + background = "#ffffff" + text_alt = "#999999" + background_alt = "#eeeeee" + text_neu = "#666666" + background_neu = "#dddddd" + border = "#cccccc" + highlight = "#ffff99" + link = "#2b73b7" + background_site = "#fbfaf9" + existing = "#008800" + missing = "#dd3300" + site_width = "75%" + sidebar_width = "16em" + tablet_width = "800px" + phone_width = "480px" + theme_color = "#008800" +``` diff --git a/defaults/main.yml b/defaults/main.yml index d037d7a8e66adab299c043fbc0f51628fc4bcde4..e4e68eb22987fad978dd51558a4d7c080b1ef560 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,3 +25,4 @@ dokuwiki: plugins: [] precreate_pages: [] timezone: UTC + template_style: ~ diff --git a/tasks/main.yml b/tasks/main.yml index 1b3be425ddf7069ccec0b3479694ca7c3d9790f9..8ac1e3c7a577c070178262a643e2dc8db580bf8c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,3 +44,26 @@ - name: create precreated pages if they do not exist include_tasks: precreate_pages.yml loop: "{{ dokuwiki.precreate_pages | dict2items }}" + +- name: set custom theme options + when: dokuwiki.template_style + block: + - name: create folder for custom theme options + file: + path: /usr/share/dokuwiki/conf/tpl/dokuwiki/ + state: directory + mode: 0644 + + - name: set theme options + template: + src: style.ini.j2 + dest: /usr/share/dokuwiki/conf/tpl/dokuwiki/style.ini + owner: root + group: www-data + mode: 0644 + +- name: delete custom theme options + when: not dokuwiki.template_style + file: + path: /usr/share/dokuwiki/conf/tpl/dokuwiki/style.ini + state: absent diff --git a/templates/style.ini.j2 b/templates/style.ini.j2 new file mode 100644 index 0000000000000000000000000000000000000000..779b09ca965ef1b9ad6aa2c69b7c6535ab8928fd --- /dev/null +++ b/templates/style.ini.j2 @@ -0,0 +1,9 @@ +[stylesheets] +extra.css = all + +[replacements] +;These overwrites have been generated from the Template styling Admin interface +;Any values in this section will be overwritten by that tool again +{% for k,v in dokuwiki.template_style.items() %} +__{{ k }}__ = "{{ v }}" +{% endfor -%} \ No newline at end of file