|
| 1 | ++++ |
| 2 | +title = "Juice" |
| 3 | +sort_by = "weight" |
| 4 | ++++ |
| 5 | + |
| 6 | +# Juice |
| 7 | + |
| 8 | +**Juice** is an intuitive, elegant, and responsive Zola theme for product sites. |
| 9 | + |
| 10 | +- Build for product sites |
| 11 | +- Simple and intuitive structure |
| 12 | +- Clean and elegant design |
| 13 | +- Responsive and mobile device compatible |
| 14 | +- Customize and extend friendly |
| 15 | + |
| 16 | +# Installation |
| 17 | + |
| 18 | +> **Zola** is a prerequisite. Please refer to the [Zola installation](https://www.getzola.org/documentation/getting-started/installation/) docs. |
| 19 | +
|
| 20 | +First download this theme to your `themes` directory: |
| 21 | + |
| 22 | +```bash |
| 23 | +$ cd themes |
| 24 | +$ git clone https://github.com/huhu/juice.git |
| 25 | +``` |
| 26 | + |
| 27 | +or add as a submodule |
| 28 | + |
| 29 | +```bash |
| 30 | +$ git submodule add https://github.com/huhu/juice themes/juice |
| 31 | +``` |
| 32 | + |
| 33 | +and then enable it in your `config.toml`: |
| 34 | + |
| 35 | +```toml |
| 36 | +theme = "juice" |
| 37 | +``` |
| 38 | + |
| 39 | +# Structure |
| 40 | + |
| 41 | +### Hero |
| 42 | + |
| 43 | +**Juice** is designed for product websites, hence we let **hero** part fills whole of screen. |
| 44 | +You can customize your **hero** by using `hero` block in the `templates/index.html`. |
| 45 | + |
| 46 | +```html |
| 47 | +{% extends "juice/templates/index.html" %} {% block hero %} |
| 48 | +<div>Your cool hero html...</div> |
| 49 | +{% endblock hero %} |
| 50 | +``` |
| 51 | + |
| 52 | +### Page |
| 53 | + |
| 54 | +Every markdown file located in `content` directory will become a **Page**. There also will display as |
| 55 | +a navigate link on the top-right corner. |
| 56 | +You can change the frontmatter's `weight` value to sort the order (ascending order). |
| 57 | + |
| 58 | +``` |
| 59 | ++++ |
| 60 | +title = "Changelog" |
| 61 | +description = "Changelog" |
| 62 | +weight = 2 |
| 63 | ++++ |
| 64 | +
|
| 65 | +``` |
| 66 | + |
| 67 | +### CSS variables |
| 68 | + |
| 69 | +You can override theme variable by creating a file named `_variables.html` in your `templates` directory. |
| 70 | + |
| 71 | +```html |
| 72 | +<style> |
| 73 | + :root { |
| 74 | + /* Primary theme color */ |
| 75 | + --primary-color: #fed43f; |
| 76 | + /* Primary theme text color */ |
| 77 | + --primary-text-color: #543631; |
| 78 | + --primary-text-color-over: #000; |
| 79 | + /* Primary theme link color */ |
| 80 | + --primary-link-color: #f9bb2d; |
| 81 | + /* Secondary color: the background body color */ |
| 82 | + --secondary-color: #fcfaf6; |
| 83 | + --secondary-text-color: #303030; |
| 84 | + /* Highlight text color of table of content */ |
| 85 | + --toc-highlight-text-color: #d46e13; |
| 86 | + --toc-background-color: white; |
| 87 | + --code-color: #4a4a4a; |
| 88 | + --code-background-color: white; |
| 89 | + --shadow-color: #ddd; |
| 90 | + /* Font used for headers (h1 & h2) */ |
| 91 | + --header-font-family: "Fira Sans", sans-serif; |
| 92 | + /* Font used for text */ |
| 93 | + --text-font-family: "Fira Sans", sans-serif; |
| 94 | + } |
| 95 | +</style> |
| 96 | +``` |
| 97 | + |
| 98 | +### Favicon |
| 99 | + |
| 100 | +The same way as changing the `hero` block in the `templates/index.html`, you can change the **favicon**. |
| 101 | + |
| 102 | +```html |
| 103 | +{% extends "juice/templates/index.html" %} |
| 104 | + |
| 105 | +{% block favicon %} |
| 106 | +<link rel="icon" type="image/png" href="/favicon.ico" /> |
| 107 | +{% endblock favicon %} |
| 108 | +``` |
| 109 | + |
| 110 | +### Fonts |
| 111 | + |
| 112 | +If you changed the `--xy-font-family`-variable in `_variables.html`, you have to load the mentioned fonts in the `templates/index.html`. |
| 113 | + |
| 114 | +```html |
| 115 | +{% extends "juice/templates/index.html" %} |
| 116 | + |
| 117 | +{% block fonts %} |
| 118 | +<link |
| 119 | + href= "https://cdn.jsdelivr.net/npm/[email protected]/css/fork-awesome.min.css" |
| 120 | + rel="stylesheet" |
| 121 | + crossorigin="anonymous" |
| 122 | +/> |
| 123 | +<link |
| 124 | + href="https://fonts.googleapis.com/css2?family=Babylonica&display=swap" |
| 125 | + rel="stylesheet" |
| 126 | +/> |
| 127 | +{% endblock fonts %} |
| 128 | +``` |
| 129 | + |
| 130 | +### Sidebar |
| 131 | + |
| 132 | +**Juice** has a sidebar on the right side of the screen. You can customize it by using `sidebar` block in the `templates/index.html`. |
| 133 | + |
| 134 | +```html |
| 135 | +{% extends "juice/templates/index.html" %} |
| 136 | + |
| 137 | +{% block sidebar %} |
| 138 | +<div> |
| 139 | + Your cool sidebar |
| 140 | +</div> |
| 141 | +{% endblock sidebar %} |
| 142 | +``` |
| 143 | + |
| 144 | +# Configuration |
| 145 | + |
| 146 | +You can customize some builtin property in `config.toml` file: |
| 147 | + |
| 148 | +```toml |
| 149 | +[extra] |
| 150 | +juice_logo_name = "Juice" |
| 151 | +juice_logo_path = "juice.svg" |
| 152 | +juice_extra_menu = [ |
| 153 | + { title = "Github", link = "https://github.com/huhu/juice"} |
| 154 | +] |
| 155 | +repository_url = "https://github.com/huhu/juice" |
| 156 | +``` |
| 157 | + |
| 158 | +# Shortcodes |
| 159 | + |
| 160 | +**Juice** have some builtin shortcodes available in `templates/shortcodes` directory. |
| 161 | + |
| 162 | +- `issue(id)` - A shortcode to render issue url, e.g. `issue(id=1)` would render to the link `https://github.com/huhu/juice/issue/1`. |
| 163 | + |
| 164 | +> The `repository_url` is required. |
| 165 | +
|
| 166 | +# Showcases |
| 167 | + |
| 168 | +Please see the [showcases page](/showcases). |
| 169 | + |
| 170 | +# Contributing |
| 171 | + |
| 172 | +Thank you very much for considering contributing to this project! |
| 173 | + |
| 174 | +We appreciate any form of contribution: |
| 175 | + |
| 176 | +- New issues (feature requests, bug reports, questions, ideas, ...) |
| 177 | +- Pull requests (documentation improvements, code improvements, new features, ...) |
0 commit comments