Skip to content

Commit

Permalink
Upgrade to zola 0.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed Oct 17, 2021
1 parent 5c75098 commit 44f5140
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/blog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v1

- name: 'Download Zola'
run: curl -sL https://github.com/getzola/zola/releases/download/v0.12.1/zola-v0.12.1-x86_64-unknown-linux-gnu.tar.gz | tar zxv
run: curl -sL https://github.com/getzola/zola/releases/download/v0.14.1/zola-v0.14.1-x86_64-unknown-linux-gnu.tar.gz | tar zxv
- name: 'Install Python Libraries'
run: python -m pip install --user -r requirements.txt
working-directory: "blog"
Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v1

- name: 'Download Zola'
run: curl -sL https://github.com/getzola/zola/releases/download/v0.12.1/zola-v0.12.1-x86_64-unknown-linux-gnu.tar.gz | tar zxv
run: curl -sL https://github.com/getzola/zola/releases/download/v0.14.1/zola-v0.14.1-x86_64-unknown-linux-gnu.tar.gz | tar zxv

- name: "Run zola check"
run: ../zola check
Expand Down
64 changes: 43 additions & 21 deletions blog/config.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
title = "Writing an OS in Rust"
base_url = "https://os.phil-opp.com"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."

highlight_code = true
highlight_theme = "visual-studio-dark"
generate_feed = true
feed_filename = "rss.xml"
compile_sass = true

languages = [
{ code = "zh-CN" }, # Chinese (simplified)
{ code = "zh-TW" }, # Chinese (traditional)
{ code = "ja" }, # Japanese
{ code = "fa" }, # Persian
{ code = "ru" }, # Russian
{ code = "fr" }, # French
]
minify_html = true

ignored_content = ["*/README.md"]

[markdown]
highlight_code = true
highlight_theme = "visual-studio-dark"
smart_punctuation = true

[link_checker]
skip_prefixes = [
"https://crates.io/crates", # see https://github.com/rust-lang/crates.io/issues/788
Expand All @@ -36,9 +29,14 @@ skip_anchor_prefixes = [
[extra]
subtitle = "Philipp Oppermann's blog"
author = { name = "Philipp Oppermann" }
default_language = "en"
languages = ["en", "zh-CN", "zh-TW", "fr", "ja", "fa", "ru"]

[translations.en]
lang_name = "English"
[languages.en]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.en.translations]
lang_name = "English (original)"
toc = "Table of Contents"
all_posts = "« All Posts"
comments = "Comments"
Expand All @@ -50,7 +48,11 @@ translated_content_notice = "This is a community translation of the <strong><a h
translated_by = "Translation by"
word_separator = "and"

[translations.zh-CN]
# Chinese (simplified)
[languages.zh-CN]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.zh-CN.translations]
lang_name = "Chinese (simplified)"
toc = "目录"
all_posts = "« 所有文章"
Expand All @@ -63,7 +65,11 @@ translated_content_notice = "这是对原文章 <strong><a href=\"_original.perm
translated_by = "翻译者:"
word_separator = ""

[translations.zh-TW]
# Chinese (traditional)
[languages.zh-TW]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.zh-TW.translations]
lang_name = "Chinese (traditional)"
toc = "目錄"
all_posts = "« 所有文章"
Expand All @@ -76,7 +82,11 @@ translated_content_notice = "這是對原文章 <strong><a href=\"_original.perm
translated_by = "翻譯者:"
word_separator = ""

[translations.ja]
# Japanese
[languages.ja]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.ja.translations]
lang_name = "Japanese"
toc = "目次"
all_posts = "« すべての記事へ"
Expand All @@ -89,7 +99,11 @@ translated_content_notice = "この記事は<strong><a href=\"_original.permalin
translated_by = "翻訳者:"
word_separator = "及び"

[translations.fa]
# Persian
[languages.fa]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.fa.translations]
lang_name = "Persian"
toc = "فهرست مطالب"
all_posts = "« همه پست‌ها"
Expand All @@ -102,7 +116,11 @@ translated_content_notice = "این یک ترجمه از جامعه کاربرا
translated_by = "ترجمه توسط"
word_separator = "و"

[translations.ru]
# Russian
[languages.ru]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.ru.translations]
lang_name = "Russian"
toc = "Содержание"
all_posts = "« Все посты"
Expand All @@ -115,7 +133,11 @@ translated_content_notice = "Это перевод сообщества пост
translated_by = "Перевод сделан"
word_separator = "и"

[translations.fr]
# French
[languages.fr]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.fr.translations]
lang_name = "French"
toc = "Table des matières"
all_posts = "« Tous les articles"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ EXCEPTION: BREAKPOINT at 0x110970

So let's disassemble the instruction at `0x110970` and its predecessor:

```shell
```bash
> objdump -d build/kernel-x86_64.bin | grep -B1 "110970:"
11096f: cc int3
110970: 48 c7 01 2a 00 00 00 movq $0x2a,(%rcx)
Expand Down
2 changes: 1 addition & 1 deletion blog/content/edition-1/posts/08-kernel-heap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ I created the [linked_list_allocator] crate to handle all of these cases. It con

We need to add the extern crate to our `Cargo.toml` and our `lib.rs`:

``` shell
``` bash
> cargo add linked_list_allocator
```

Expand Down
1 change: 0 additions & 1 deletion blog/sass/css/edition-2/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ tbody tr:nth-child(odd) th {

/* Blog post or page title */
.page-title,
.post-title,
.post-title a {
color: var(--post-title-color);
}
Expand Down
18 changes: 8 additions & 10 deletions blog/templates/edition-2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@ <h2>Support Me</h2>
<aside class="page-aside-right">
<div class="block" id="language-selector">
<h2>Other Languages</h2>
<ul>{%- for lang_code in config.languages | map(attribute="code") | concat(with="en") | sort -%}
{%- if lang_code != lang -%}
<li data-lang-switch-to="{{ lang_code }}" class="">
{%- if lang_code == "en" -%}
<a href="/">English (original)</a>
{%- else -%}
<a href="/{{ lang_code }}">{{ trans(key="lang_name", lang = lang_code) }}</a>
{%- endif -%}
</li>
{%- endif %}
{% set translations = section.translations | group_by(attribute="lang") %}
<ul>{%- for lang_code in config.extra.languages -%}
{%- set translation = translations[lang_code].0 -%}
{%- if translation and lang_code != lang -%}
<li data-lang-switch-to="{{ translation.lang }}" class=""><a href="{{ translation.permalink | safe }}">
{{ trans(key="lang_name", lang = translation.lang) }}
</a></li>
{%- endif -%}
{% endfor %}</ul>
</div>
<div class="block">
Expand Down
2 changes: 1 addition & 1 deletion blog/templates/edition-2/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2 class="post-title"><a href="{{ post.path | safe }}">{{ post.title }}</a></h2
{{ post.summary | safe }}
<a class="read-more" href="{{ post.path | safe }}"><em>{{ trans(key="readmore", lang=lang) | safe }}</em></a>

{%- if lang and not_translated and lang != config.default_language -%}
{%- if lang and not_translated and lang != config.extra.default_language -%}
<aside class="no-translation">
{{ trans(key="not_translated", lang=lang) }}
</aside>
Expand Down
16 changes: 8 additions & 8 deletions blog/templates/edition-2/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ <h2 id="comments" class="{% if page.extra.rtl %}right-to-left{% endif %}">{{ tra
{% if page.translations -%}
<div class="block" id="language-selector">
<h2>Other Languages</h2>
<ul>{%- for translation in page.translations | sort(attribute="lang") %}
<li data-lang-switch-to="{{ translation.lang }}" class=""><a href="{{ translation.permalink | safe }}">
{%- if translation.lang == "en" -%}
English (original)
{%- else -%}
{% set translations = page.translations | group_by(attribute="lang") %}
<ul>{%- for lang_code in config.extra.languages -%}{%- if translations[lang_code] -%}
{%- set translation = translations[lang_code] | first -%}
{%- if translation and lang_code != lang -%}
<li data-lang-switch-to="{{ translation.lang }}" class=""><a href="{{ translation.permalink | safe }}">
{{ trans(key="lang_name", lang = translation.lang) }}
{%- endif -%}
</a></li>
{% endfor %}</ul>
</a></li>
{%- endif -%}
{%- endif -%}{% endfor %}</ul>
</div>
{%- endif %}

Expand Down
2 changes: 1 addition & 1 deletion blog/templates/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link>{{ config.base_url | safe }}</link>
<description>{{ config.description }}</description>
<generator>Zola</generator>
<language>{{ config.default_language }}</language>
<language>{{ lang }}</language>
<atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/>
<lastBuildDate>{{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
{% for page in pages %}
Expand Down

0 comments on commit 44f5140

Please sign in to comment.