Skip to content

Commit 03791a8

Browse files
authored
Merge pull request #3 from rust-basel/update_theme
chore: update theme and add pt_Br translation
2 parents 4fd1cc1 + 8835975 commit 03791a8

17 files changed

Lines changed: 904 additions & 2228 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/public
22
/.idea
3+
/node_modules

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright 2024 Rust Basel
3+
Copyright 2025 Rust Basel
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ you can choose your preferred language setting for a consistent blog experience.
3232
- [Configuration](#configuration)
3333
- [Front Matter](#front-matter)
3434
- [Localization](#localization)
35-
- [Integrating in theme folder](#integrating-in-theme-folder)
35+
- [Integrating the theme folder](#integrating-the-theme-folder)
3636
- [Development](#development)
3737
- [Remarks](#remarks)
3838
- [Contributing](#contributing)
@@ -49,15 +49,17 @@ The site uses the German language.
4949

5050
## Prerequisites
5151

52-
In order to use the theme, you need some software pre-installed:
52+
To use the theme, you need some software pre-installed:
5353

5454
- [Git](https://git-scm.com/downloads), Required for version control.
5555

5656
- [Node](https://nodejs.org/en/download), an open-source, cross-platform JavaScript runtime environment.
57+
Node is optional and only needed if you want to change the CSS in `css/main.css`.
5758

5859
- [Zola](https://github.com/getzola/zola/releases), a fast static site generator.
5960

60-
- an editor or integrated development environment of your choice - I use [JetBrains IDEA](https://www.jetbrains.com/idea/download),
61+
- an editor or integrated development environment of your choice —
62+
I use [JetBrains IDEA](https://www.jetbrains.com/idea/download),
6163
an IDE that makes development a more productive and enjoyable experience.
6264

6365
---
@@ -68,7 +70,7 @@ In order to use the theme, you need some software pre-installed:
6870
Or download it from `https://github.com/thomasweitzel/zolarwind`.
6971

7072
2. Make adjustments to the `config.toml` file as needed.
71-
In order to run the theme as a standalone site, you need to adjust the `base_url` to your domain.
73+
To run the theme as a standalone site, you need to adjust the `base_url` to your domain.
7274
If you want to try it out on your local machine, you can leave it as is.
7375
Just run `zola serve` from the theme's root directory.
7476

@@ -81,7 +83,7 @@ Here's a breakdown of the configuration settings tailored for this theme:
8183

8284
### Basic Configuration:
8385

84-
- **base_url**: Specifies the URL the site will be built for.
86+
- **base_url**: Specify the URL the site will be built for.
8587
In this case, the site will be built for `https://example.org`.
8688
Adjust this to your own domain.
8789

@@ -93,7 +95,7 @@ Here's a breakdown of the configuration settings tailored for this theme:
9395
As of now, German (`de`) is available in the `i18n` directory.
9496

9597
- **theme**: The theme used for the site.
96-
The provided line is commented out, indicating that the themes files are taken from the `template` directory.
98+
The provided line is commented out, indicating that the theme's files are taken from the `template` directory.
9799
If you move the theme to the `themes/zolarwind` directory, use `zolarwind` for this entry.
98100

99101
- **build_search_index**: If set to `true`, a search index will be built from the pages and section content for the `default_language`.
@@ -111,39 +113,50 @@ Here's a breakdown of the configuration settings tailored for this theme:
111113

112114
- **highlight_theme**: Specifies the theme to be used for code highlighting. The chosen theme in this configuration is `1337`.
113115

116+
- **extra_syntaxes_and_themes**: directory for additional syntax highlighting configuration files for languages not directly supported by Zola.
117+
114118
### Extra Configuration:
115119

116120
The `[extra]` section is where you can place any custom variables you want to be accessible in your templates.
117121

118-
- **title**: The title of the site.
119-
Here, it's set to "Zolarwind".
120-
121-
- **generator**: Optional.
122-
Specifies the generator used for creating the static website.
123-
This site is generated using `Zola v0.18.0`.
122+
- **title**: Required.
123+
The title of the site.
124+
Here, it's set to "Zolarwind."
124125

125-
- **path_language_resources**: The path to the directory containing language resource files.
126+
- **path_language_resources**: Required.
127+
The path to the directory containing language resource files.
126128
In this config, it's set to `i18n/`.
127129
If you move the theme to the `themes/zolarwind` directory, use `themes/zolarwind/i18n/` for this entry.
128130

129-
- **favicon_svg**: Provides a path to the site's favicon in SVG format.
131+
- **generator**: Optional.
132+
Specify the generator used for creating the static website.
133+
This site is generated using `Zola v0.19.0`.
134+
135+
- **favicon_svg**: Optional.
136+
Provides a path to the site's favicon in SVG format.
130137
The provided path points to `/img/yin-yang.svg`.
131138

132-
- **copyright**: A template for the copyright notice.
139+
- **copyright**: Optional.
140+
A template for the copyright notice.
133141
It includes a placeholder `{year}` which is dynamically replaced with the current year of your `zola build` run.
134142

135-
- **site_description**: A brief description displayed on the site's banner.
143+
- **site_description**: Optional.
144+
A brief description is displayed on the site's banner.
136145

137-
- **quote**: A structure defining a quote and its author.
146+
- **quote**: Optional.
147+
A structure defining a quote and its author.
138148
This quote is from Yoda.
139149

140-
- **menu_pages**: An array of main navigation menu items.
150+
- **menu_pages**: Optional.
151+
An array of main navigation menu items.
141152
Each item has a `title` and a `url`.
142153

143-
- **footer_pages**: An array of pages that will appear in the site's footer.
154+
- **footer_pages**: Optional.
155+
An array of pages that will appear in the site's footer.
144156
Each item has a `title` and a `url`.
145157

146-
- **social_links**: An array of social media links.
158+
- **social_links**: Optional.
159+
An array of social media links.
147160
Each link has a name, a boolean indicating if it's enabled, a URL, and an SVG icon.
148161

149162
---
@@ -154,7 +167,7 @@ For blog posts (Markdown files in folder `content/blog`), this theme uses a dire
154167
This way, I have all resources for a post in one place.
155168
It can include images, videos, and other files.
156169

157-
Each post is associated with an image, that is displayed on the blog's main page and on the posts detail page.
170+
Each post is associated with an image displayed on the blog's main page and on the post's detail page.
158171
If you do not provide an image under `extra.image`, a default image is used instead.
159172

160173
- **date**: the date of the blog posts, e.g. `2020-06-11`.
@@ -163,7 +176,7 @@ If you do not provide an image under `extra.image`, a default image is used inst
163176

164177
- **description**: the description of the blog posts. It is used as a summary on the blog's main page.
165178

166-
- **authors**: an optional array of all the posts authors, e.g. `["Thomas Weitzel"]`.
179+
- **authors**: an optional array of all the post's authors, e.g. `["Thomas Weitzel"]`.
167180
You can leave it empty, but then the first author will show up as `Unknown` in the feed (`atom.xml`).
168181

169182
- **taxonomies**: only the optional `tags` taxonomy is used by this theme.
@@ -181,7 +194,7 @@ If you do not provide an image under `extra.image`, a default image is used inst
181194

182195
- **extra.image**: an optional image for the post.
183196
If omitted, a default image is used instead.
184-
The image is displayed on the blog's main page and on the posts detail page.
197+
The image is displayed on the blog's main page and on the post's detail page.
185198

186199
---
187200

@@ -200,7 +213,7 @@ To localize your blog with this theme:
200213
If your language is not supported yet, just create a new resource file with your translations.
201214
Use the file `en.toml` as a template for your own translations.
202215
Use the correct language code for the file name, e.g. `eo.toml` for Esperanto.
203-
Only languages that read from left-to-right (ltr) are supported by this theme.
216+
This theme supports only languages that read from left-to-right (ltr).
204217

205218
2. The theme will automatically display all theme-specific string resources in the chosen language.
206219

@@ -212,7 +225,7 @@ If you need to define your own date format, look [here](https://docs.rs/chrono/l
212225

213226
---
214227

215-
## Integrating in theme folder
228+
## Integrating the theme folder
216229

217230
This project is structured as a stand-alone Zola site.
218231
This section is for those who might want to integrate the theme into an existing Zola website.
@@ -232,6 +245,7 @@ This is the directory structure of the stand-alone site, where the theme is in t
232245
│ ├── css
233246
│ ├── img
234247
│ └── js
248+
├── syntaxes
235249
├── templates
236250
└── theme.toml
237251
```
@@ -249,6 +263,7 @@ Create a new directory `themes/zolarwind` and move the following files and direc
249263
├── static
250264
│ ├── img
251265
│ └── js
266+
├── syntaxes
252267
├── templates
253268
└── theme.toml
254269
```
@@ -261,7 +276,7 @@ The generation process can be triggered with a script in the `package.json` file
261276
**You only need to adjust and run the script** in `package.json` if you make changes to the theme's template files or use new Tailwind CSS classes directly in your content files.
262277
Since the source file `css/main.css` has moved to the directory `themes/zolarwind/css/main.css`, we need to adjust the script in `package.json` accordingly.
263278

264-
This is how the relevant part of it looks like for the stand-alone site:
279+
This is what the relevant part of it looks like for the stand-alone site:
265280

266281
```json
267282
"scripts": {
@@ -298,44 +313,44 @@ path_language_resources = "themes/zolarwind/i18n/"
298313

299314
## Development
300315

301-
If you want to adjust the CSS of the theme to your needs, you will need to edit the files in the `templates` and `css` directories.
302-
While you do this, you should make sure that the CSS file `static/css/generated.css` is up-to-date.
303-
This file is generated from the file `css/main.css`, and all the files that are configured as a pattern in `tailwind.config.js`:
304-
305-
- `css/main.css`
316+
If you want to adjust the CSS of the theme to your needs, you will need to edit the files in the `templates` and `css`
317+
directories. While you do this, you should make sure that the CSS file `static/css/generated.css` is up to date. This
318+
file is generated from the file `css/main.css`, and all the files that Tailwind automatically identifies via automatic
319+
content detection.
306320

307-
- `themes/**/*.html`
321+
If you ever need to explicitly add a source file excluded by default, you can always add it with the `@source`
322+
directive, right in your `css/main.css` file:
308323

309-
- `templates/**/*.html`
310-
311-
- `content/**/*.md`
324+
```css
325+
@source "../node_modules/@my-company/ui-lib";
326+
```
312327

313328
So whenever one of these files changes, you need to run the script `css:build` from the `package.json` file.
314-
To accomplish this, you need to have `Node.js` and all dependencies from `package.json` installed (with `npm install`).
329+
To achieve this, you need to have `Node.js` and all dependencies from `package.json` installed (with `npm install`).
315330
Then you can run the script with `npm run css:watch`.
316331
It monitors all files mentioned above and triggers the CSS generation whenever a relevant file changes.
317-
This ensures, that the file `static/css/generated.css` is always up-to-date.
332+
This ensures, that the file `static/css/generated.css` is always up to date.
318333

319-
I recommend to have two terminals open.
320-
In one terminal, run `zola serve` to start the Zola server.
334+
I recommend having two terminals open.
335+
In one terminal, run `npm run server` - or just `zola serve` - to start the Zola server.
321336
In the other terminal, run `npm run css:watch` to start the CSS generation whenever a relevant file changes.
322337

323-
That way, your local web browser will automatically reload the page with the updated CSS whenever you change a file.
338+
That way, your local web browser will automatically reload the page with the updated CSS whenever you change a file.
324339

325340
---
326341

327342
## Remarks
328343

329-
### Typography for markdown
344+
### Typography for Markdown
330345

331-
I'm not using `@tailwindcss/typography` for styling of markdown files.
346+
I'm not using `@tailwindcss/typography` for styling of Markdown files.
332347
I don't like how it looks.
333348
Instead, I use `@apply` in the `css/main.css` file.
334349
The `@apply` directive in Tailwind CSS enables you to compose utility classes into custom CSS classes.
335-
This makes it possible to apply multiple utility styles within a single class, making it efficient to style markdown content.
350+
This makes it possible to apply multiple utility styles within a single class, making it efficient to style Markdown content.
336351

337352
This approach has pros and cons.
338-
But it gives me fine-grained control over how the end result looks like.
353+
But it gives me fine-grained control over how the result looks like.
339354
While it is time-consuming, I prefer this solution over the `@tailwindcss/typography` plugin.
340355

341356
Yes, I'm reinventing the wheel here, because for common typographic patterns, I'm just recreating what's already provided by the typography plugin.
@@ -352,7 +367,7 @@ Using KaTeX (or any other library) by serving it from a Content Delivery Network
352367

353368
- **Cookies**: Many CDNs set cookies for various reasons, including analytics or performance optimizations.
354369
These cookies can track users across different websites that use the same CDN, potentially infringing on their privacy rights.
355-
By hosting KaTeX on your domain, you have full control over the cookies set and can ensure compliance with GDPR.
370+
By hosting KaTeX on your domain, you have full control over cookies and can ensure compliance with GDPR.
356371

357372
- **Consent**: If you're using a CDN that sets cookies or collects data, you might need to get explicit user consent before loading resources from that CDN.
358373
This can complicate user experience and lead to a reduced site performance for users who opt-out.
@@ -374,7 +389,7 @@ If you see areas of improvement or want to add features, please submit a PR.
374389

375390
I'm especially interested in more translations.
376391
See folder `i18n` for what's available and what is not.
377-
Just use the file `en.toml` as a template for your own translations.
392+
Use the file `en.toml` as a template for your own translations.
378393

379394
---
380395

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ default_language = "en"
1414
build_search_index = false
1515

1616
# When set to "true", a feed is automatically generated
17-
# generate_feed = true
17+
generate_feeds = true
1818

1919
# The taxonomies to use for the site
2020
taxonomies = [

css/main.css

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
@import 'tailwindcss/base';
2-
@import 'tailwindcss/components';
3-
@import 'tailwindcss/utilities';
1+
@import "tailwindcss";
42

5-
@layer base {
3+
@layer utilities {
64
.badge {
75
@apply inline-flex items-center px-2.5 py-0.5 rounded-full text-sm font-medium leading-4
86
}
@@ -50,22 +48,25 @@
5048
@apply font-bold;
5149
}
5250
.prose h1 {
53-
@apply text-xl font-bold mt-8;
51+
@apply text-2xl font-bold mt-8;
5452
}
5553
.prose h2 {
56-
@apply text-lg font-bold mt-8;
54+
@apply text-xl font-bold mt-8;
5755
}
5856
.prose h3 {
59-
@apply font-bold mt-8;
57+
@apply text-lg font-bold mt-8;
58+
}
59+
.prose h4 {
60+
@apply text-base font-bold mt-4;
6061
}
6162
.prose p {
6263
@apply mt-4;
6364
}
6465
.prose blockquote {
6566
@apply border-l-4 border-gray-600 pl-4 italic;
6667
}
67-
.prose p code, .prose ol code, .prose ul code {
68-
@apply px-1 font-mono text-sm border border-gray-200 bg-indigo-50 rounded-sm
68+
.prose kbd, p code, .prose ol code, .prose ul code {
69+
@apply mx-0.5 px-1 py-0.5 font-mono text-sm bg-gray-200 rounded shadow-sm ring-1 ring-gray-900/25;
6970
}
7071
.prose pre.mermaid {
7172
@apply block my-4 font-mono text-sm overflow-x-hidden
@@ -112,6 +113,9 @@
112113
h3 {
113114
@apply text-lg font-bold;
114115
}
116+
h4 {
117+
@apply text-base font-bold;
118+
}
115119
a {
116120
@apply text-blue-600 no-underline;
117121
}

i18n/de.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ settings_date_format = "%d. %B %Y"
77
empty_page_title = "Kein Titel"
88
empty_page_description = "Keine Zusammenfassung"
99
read_more = "Mehr lesen"
10-
previous_posts = "Vorherige Beiträge"
11-
next_posts = "Nächste Beiträge"
10+
previous_posts = "Jüngere Beiträge"
11+
next_posts = "Ältere Beiträge"
1212
reading_time = "Lesezeit"
1313
aria_to_homepage = "Zur Homepage"
1414
aria_menu = "Menü"

i18n/pt.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Global settings
2+
settings_locale = "pt"
3+
settings_date_locale = "pt_BR"
4+
settings_date_format = "%d. %B %Y"
5+
6+
# Simple language resources
7+
empty_page_title = "Título vazio"
8+
empty_page_description = "Descrição vazia"
9+
read_more = "Leia Mais"
10+
previous_posts = "Artigo anterior"
11+
next_posts = "Próximo artigo"
12+
reading_time = "tempo de leitura"
13+
aria_to_homepage = "Vá para homepage"
14+
aria_menu = "Menu"
15+
with_tag = "com tag"
16+
not_found_header = "A pagina solicitada não funciona."
17+
not_found_text = "Oops! Parece que a pagina desapareceu pelo abismo da internet. Talvez ela esteja de férias? Por favor verifique a URL ou me chame, and eu irei ver se posso localiza-la, ou ao menos enviar um grupo de busca."
18+
19+
# Nouns with singular and plural
20+
[words]
21+
one = "palavra"
22+
other = "palavras"
23+
24+
[minutes]
25+
one = "minuto"
26+
other = "minutos"
27+
28+
[posts]
29+
one = "post"
30+
other = "posts"
31+
32+
[tags]
33+
one = "tag"
34+
other = "tags"

0 commit comments

Comments
 (0)