|
| 1 | + |
| 2 | ++++ |
| 3 | +title = "Daisy" |
| 4 | +description = "Beautiful and fast responsive theme based on TailwindCSS and DaisyUI." |
| 5 | +template = "theme.html" |
| 6 | +date = 2025-04-06T13:02:47+02:00 |
| 7 | + |
| 8 | +[taxonomies] |
| 9 | +theme-tags = ['multilingual', 'responsive', 'search'] |
| 10 | + |
| 11 | +[extra] |
| 12 | +created = 2025-04-06T13:02:47+02:00 |
| 13 | +updated = 2025-04-06T13:02:47+02:00 |
| 14 | +repository = "https://codeberg.org/winterstein/zola-theme-daisy.git" |
| 15 | +homepage = "https://codeberg.org/winterstein/zola-theme-daisy" |
| 16 | +minimum_version = "0.9.0" |
| 17 | +license = "MIT" |
| 18 | +demo = "https://zola-daisy.winterstein.biz" |
| 19 | + |
| 20 | +[extra.author] |
| 21 | +name = "Adrian Winterstein" |
| 22 | +homepage = "https://www.winterstein.biz" |
| 23 | ++++ |
| 24 | + |
| 25 | +# Daisy Theme |
| 26 | + |
| 27 | +> You can find this theme on [Codeberg](https://codeberg.org/winterstein/zola-theme-daisy) and [Github](https://github.com/awinterstein/zola-theme-daisy). |
| 28 | +
|
| 29 | +A beautiful and fast [Zola](https://www.getzola.org/) theme build on [TailwindCSS](https://tailwindcss.com) and [DaisyUI](https://daisyui.com) with 37 different color schemes included. See an example of the *autumn* colors here: |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +The theme is responsive and works very well on mobile devices: |
| 34 | + |
| 35 | +<img src="https://codeberg.org/awinterstein/zola-theme-daisy/raw/branch/main/screenshot-mobile.png" alt="Mobile Screenshot" width="200"/> |
| 36 | + |
| 37 | +## Features |
| 38 | + |
| 39 | +* Responsive design (looks good on desktop and mobile) |
| 40 | +* Automatically selected dark / light modes |
| 41 | +* 37 color schemes included |
| 42 | +* Customizable navbar and footer (with social links) |
| 43 | +* Can be used with any Zola taxonomies (e.g., tags, categories) |
| 44 | +* Search functionality |
| 45 | +* Multi-language support |
| 46 | +* Pagination |
| 47 | +* Customizable favicon |
| 48 | +* Error 404 page |
| 49 | + |
| 50 | +### Styling |
| 51 | + |
| 52 | +The Daisy theme supports all [built-in color themes of DaisyUI](https://daisyui.com/docs/themes/#enable-a-built-in-theme) plus a light and dark color scheme that I created for my own website. The color themes can optionally even be switched at runtime. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +## Quick Start |
| 57 | + |
| 58 | +The installation of the theme works the same as for other Zola themes. As it is described in the [official documentation](https://www.getzola.org/documentation/themes/installing-and-using-themes/). Hence, it fist needs to be added as a git submodule: |
| 59 | + |
| 60 | +```bash |
| 61 | +cd my-zola-website |
| 62 | +git submodule add -b main \ |
| 63 | + https://codeberg.org/winterstein/zola-theme-daisy.git \ |
| 64 | + themes/daisy |
| 65 | +``` |
| 66 | + |
| 67 | +Please make sure to add it at the path `themes/daisy` in your Zola directory. The translations and the icons won't work if added to a different directory. |
| 68 | + |
| 69 | +As the second step, it can be enabled then in the `config.toml` file of your website: |
| 70 | + |
| 71 | +```toml |
| 72 | +theme = "daisy" |
| 73 | +``` |
| 74 | + |
| 75 | +For starting to create a new Zola website using this theme, the you can also just checkout / fork the [example repository](https://codeberg.org/winterstein/zola-theme-daisy-example) and adapt it to your needs. That repository already contains a structure and configuration for the Zola-based website. |
| 76 | + |
| 77 | +## Configuration |
| 78 | + |
| 79 | +See the following sections for information on the possible configurations for the theme in the your `config.toml` file. |
| 80 | + |
| 81 | +### Color Schemes |
| 82 | + |
| 83 | +Set a light and dark color scheme: |
| 84 | + |
| 85 | +```toml |
| 86 | +daisyui_theme_light = "light" |
| 87 | +daisyui_theme_dark = "dark" |
| 88 | +``` |
| 89 | + |
| 90 | +See the `themes` list in the [`theme.toml`](theme.toml) for all possible identifiers. You can also set only a light or a dark color scheme, if you do not want the automatic dark mode switching based on the browser settings of your visitors. |
| 91 | + |
| 92 | +If you want to allow your visitors to change the used color scheme, just set the following variable in the `[extra]` section of your `config.toml`: |
| 93 | + |
| 94 | +```toml |
| 95 | +[extra] |
| 96 | +enable_theme_switching = true |
| 97 | +``` |
| 98 | + |
| 99 | +There will be a dropdown in the navbar then, for the visitors to select form the color schemes. |
| 100 | + |
| 101 | +### Languages |
| 102 | + |
| 103 | +To enable support for multiple languages, simply set the default language and add language settings for all your additional languages: |
| 104 | + |
| 105 | +```toml |
| 106 | +default_language = "en" |
| 107 | + |
| 108 | +[languages.de] |
| 109 | +# title and description in the additional language |
| 110 | +title = "Daisy Theme" |
| 111 | +description = "Beispiel- und Demoseite des Daisy-Themas für Zola." |
| 112 | + |
| 113 | +# don't forget to enable features like search or feed |
| 114 | +# generation for the additional language as well |
| 115 | +build_search_index = true |
| 116 | +generate_feeds = true |
| 117 | + |
| 118 | +# also any taxonomies of your default language need to |
| 119 | +# be defined for the additional language as well |
| 120 | +taxonomies = [ |
| 121 | + { name = "tags", paginate_by = 2, feed = true }, |
| 122 | + { name = "directors", paginate_by = 2, feed = true }, |
| 123 | +] |
| 124 | +``` |
| 125 | + |
| 126 | +Taxonomies should have exactly the same (not translated) name in all languages, for the language switching to work best. |
| 127 | + |
| 128 | +You need to create an i18n file containing the translations for all theme variables for all the languages of your website, if they are not included in the theme. Right now, only [English](i18n/en.toml) and [German](i18n/de.toml) are included. You can create a the directory `i18n` in your website root directory and the language files in there will be picked up by the theme. It would be great, however, I you create a [pull-request](https://codeberg.org/winterstein/zola-theme-daisy/pulls) on the theme repository to add your translations to the theme. |
| 129 | + |
| 130 | +### Search |
| 131 | + |
| 132 | +Integrating a search into your website is as easy as adding the following to your configuration: |
| 133 | + |
| 134 | +```toml |
| 135 | +# enable it globally for the default language |
| 136 | +build_search_index = true |
| 137 | + |
| 138 | +[search] |
| 139 | +# only this format is supported by the theme |
| 140 | +index_format = "elasticlunr_json" |
| 141 | + |
| 142 | +# you need to enable search at all your language sections as well |
| 143 | +[languages.de] |
| 144 | +build_search_index = true |
| 145 | +``` |
| 146 | + |
| 147 | +As soon as `build_search_index` is enabled, the search indices are created for all languages that have this variable enabled in their section in the `config.toml` and the search bar is shown in the navbar of the website. |
| 148 | + |
| 149 | +Just be aware, that you need to add a [Lunr Languages](https://github.com/MihaiValentin/lunr-languages) file to your `static` directory, if you ae using other languages than English and German. See the corresponding repository for the [`min` files](https://github.com/MihaiValentin/lunr-languages/tree/master/min). Feel free to add support for your languages to the theme as well, via a [pull-request](https://codeberg.org/winterstein/zola-theme-daisy/pulls). |
| 150 | + |
| 151 | +### Navbar |
| 152 | + |
| 153 | +Arbitrary links can be added to the footer by defining the following list in the `[extra.navbar]` section: |
| 154 | + |
| 155 | +```toml |
| 156 | +[extra.navbar] |
| 157 | +links = [ |
| 158 | + { url = "blog", i18n_key = "posts" }, |
| 159 | + { url = "tags", i18n_key = "tags" }, |
| 160 | + { url = "movies", i18n_key = "movies" }, |
| 161 | +] |
| 162 | +``` |
| 163 | + |
| 164 | +The value of the `i18n_key` must be in the `i18n` files for your languages (see [en.toml](i18n/en.toml), for example). |
| 165 | + |
| 166 | +### Footer |
| 167 | + |
| 168 | +All three parts of the footer can be adapted: the links, the social icons, and the copyright notice. |
| 169 | + |
| 170 | +#### Links |
| 171 | + |
| 172 | +Arbitrary links can be added to the footer by defining the following list in the `[extra.footer]` section: |
| 173 | + |
| 174 | +```toml |
| 175 | +[extra.footer] |
| 176 | +links = [ |
| 177 | + { url = "about", i18n_key = "about" }, |
| 178 | + { url = "sitemap.xml", i18n_key = "sitemap", no_translation = true }, |
| 179 | +] |
| 180 | +``` |
| 181 | + |
| 182 | +The value of the `i18n_key` must be in the `i18n` files for your languages (see [en.toml](i18n/en.toml), for example). If the parameter `no_translation` is set to true, than the URL is not adapted to contain the current language code. This is needed for external links or something like the `sitemap.xml` in the example, that is not translated within your website. |
| 183 | + |
| 184 | +#### Social Icons |
| 185 | + |
| 186 | +The social icons in the footer can be adapted by setting any of the following variables: |
| 187 | + |
| 188 | +```toml |
| 189 | +[extra.social] |
| 190 | +codeberg = "" |
| 191 | +github = "" |
| 192 | +gitlab = "" |
| 193 | +stackoverflow = "" |
| 194 | +mastodon = "" |
| 195 | +linkedin = "" |
| 196 | +instagram = "" |
| 197 | +youtube = "" |
| 198 | +signal = "" |
| 199 | +telegram = "" |
| 200 | +email = "" |
| 201 | +phone = "" |
| 202 | +``` |
| 203 | + |
| 204 | +For every non-empty variable, the corresponding icon is shown in the footer. |
| 205 | + |
| 206 | +#### Copyright Notice |
| 207 | + |
| 208 | +The copyright notice in the footer can be set by adding the following variable in the configuration: |
| 209 | + |
| 210 | +```toml |
| 211 | +[extra.footer] |
| 212 | +notice = "This is my <b>copyright</b> notice." |
| 213 | +``` |
| 214 | + |
| 215 | +HTML can be used there. |
| 216 | + |
| 217 | + |
0 commit comments