From 06765b7ccc8119ccf3ef4ca9d9dec15a04397b3a Mon Sep 17 00:00:00 2001 From: Christopher Biscardi Date: Mon, 6 Apr 2026 17:49:55 -0700 Subject: [PATCH] Update to zola 0.22.1 Notably, zola has produced their own code highlighting solution that in the future causes us to need to write our custom .css syntax theme as a vscode theme instead. However, as far as I can tell, this is not possible until zola releases a new version. The current state is that the CSS overrides we use aren't applied as they were previously when using zola's new giallo. - zola built a replacement for syntect called giallo: https://github.com/getzola/zola/issues/2758 - There are CSS fixes to code style generation that seem relevant but will fully break any attempt at the css class based highlighting that we have now: https://github.com/getzola/giallo/pull/56 > The current CSS generation in giallo is broken: getzola/giallo#56 will be included in the next Zola release. > > [keats](https://github.com/getzola/zola/issues/3075#issuecomment-4189396022) - We will need to write our theme as a vscode theme to regain styling. I haven't explored actually writing this theme file yet so don't know if there will be regressions or opportunities for enhancements. --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .gitignore | 6 + config.toml | 14 ++- syntaxes/ron.json | 235 +++++++++++++++++++++++++++++++++++ 5 files changed, 251 insertions(+), 8 deletions(-) create mode 100644 syntaxes/ron.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 550f35eb71..ca9bc0c5f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,7 +261,7 @@ jobs: path: content/community/people - name: "Build website" - uses: shalzz/zola-deploy-action@v0.19.2 + uses: shalzz/zola-deploy-action@v0.22.1 env: PAGES_BRANCH: gh-pages BUILD_DIR: . diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a5f07c3c4b..a05aa99c88 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,7 +48,7 @@ jobs: if: github.repository_owner == 'bevyengine' # When updating to a newer version, remember to also update it # in the contribution guide & readme - uses: shalzz/zola-deploy-action@v0.19.2 + uses: shalzz/zola-deploy-action@v0.22.1 env: PAGES_BRANCH: gh-pages BUILD_DIR: . diff --git a/.gitignore b/.gitignore index b428d603e0..38a0e0b0b8 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,9 @@ target/ # MacOS folder attributes **/.DS_Store + +# A file generated by zola in v0.22, which we don't use. +# in the future zola will expect that our custom css code +# syntax theme will be converted to a vscode theme, which +# will allow us to remove this and include the generated file +static/giallo.css \ No newline at end of file diff --git a/config.toml b/config.toml index 5fe42055be..738844ae54 100644 --- a/config.toml +++ b/config.toml @@ -18,14 +18,16 @@ feed_limit = 1000 taxonomies = [{ name = "news", feed = true }] -[markdown] -# Whether to do syntax highlighting -# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola -highlight_code = true -highlight_theme = "css" +[markdown.highlighting] +style = "class" +# "github-dark" is not actually used by bevy. The field is required to be set +# and in the future bevy's custom CSS syntax theming will need to be defined +# as a vscode theme +# https://github.com/getzola/zola/issues/3075#issuecomment-4189396022 +theme = "github-dark" # Load extra syntaxes (e.g. WGSL) for syntax highlighting -extra_syntaxes_and_themes = ["syntaxes"] +extra_grammars = ["syntaxes/ron.json"] [extra] # Put all your custom variables here diff --git a/syntaxes/ron.json b/syntaxes/ron.json new file mode 100644 index 0000000000..3058d724d0 --- /dev/null +++ b/syntaxes/ron.json @@ -0,0 +1,235 @@ +{ + "displayName": "RON", + "name": "ron", + "patterns": [ + { + "include": "#expression" + } + ], + "repository": { + "array": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.ron" + } + }, + "end": "]", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.ron" + } + }, + "patterns": [ + { + "include": "#value" + }, + { + "include": "#object-name" + }, + { + "meta_scope": "meta.structure.array.ron" + } + ] + }, + "block_comment": { + "begin": "/\\*", + "end": "\\*/", + "name": "comment.block.ron" + }, + "character": { + "begin": "'", + "contentName": "constant.character.ron", + "end": "'", + "name": "string.quoted.single" + }, + "constant": { + "match": "\\b(true|false)\\b", + "name": "constant.language.ron" + }, + "dictionary": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.dictionary.begin.ron" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.dictionary.end.ron" + } + }, + "patterns": [ + { + "include": "#value" + }, + { + "include": "#object-name" + }, + { + "include": "#object" + }, + { + "include": "#tag-name" + }, + { + "match": ",", + "name": "punctuation.separator.dictionary.ron" + }, + { + "match": ":", + "name": "punctuation.separator.dictionary.key-value.ron" + } + ] + }, + "escapes": { + "captures": { + "1": { + "name": "constant.character.escape.backslash.ron" + }, + "2": { + "name": "constant.character.escape.bit.ron" + }, + "3": { + "name": "constant.character.escape.unicode.ron" + }, + "4": { + "name": "constant.character.escape.unicode.punctuation.ron" + }, + "5": { + "name": "constant.character.escape.unicode.punctuation.ron" + } + }, + "match": "(\\\\)(?:(x[0-7][0-7A-Fa-f])|(u(\\{)[A-Fa-f\\d]{4,6}(}))|.)", + "name": "constant.character.escape.ron" + }, + "expression": { + "patterns": [ + { + "include": "#array" + }, + { + "include": "#block_comment" + }, + { + "include": "#constant" + }, + { + "include": "#dictionary" + }, + { + "include": "#line_comment" + }, + { + "include": "#number" + }, + { + "include": "#object-name" + }, + { + "include": "#object" + }, + { + "include": "#string" + }, + { + "include": "#character" + }, + { + "include": "#tag-name" + } + ] + }, + "line_comment": { + "begin": "//", + "end": "$", + "name": "comment.line.double-slash.ron" + }, + "number": { + "match": "-?(?:0|[1-9]\\d*)(?:(?:\\.\\d+)?(?:[Ee][-+]?\\d+)?)?", + "name": "constant.numeric.ron" + }, + "object": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.dictionary.begin.ron" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.dictionary.end.ron" + } + }, + "patterns": [ + { + "include": "#value" + }, + { + "include": "#dictionary" + }, + { + "include": "#tag-name" + }, + { + "include": "#object-name" + }, + { + "include": "#object" + } + ] + }, + "object-name": { + "match": "[A-Z_a-z][0-9A-Z_a-z]*", + "name": "entity.name.class.ron" + }, + "string": { + "begin": "(b?)(\")", + "end": "\"", + "name": "string.quoted.double", + "patterns": [ + { + "include": "#escapes" + } + ] + }, + "tag-name": { + "match": "[_a-z][0-9A-Z_a-z]*", + "name": "entity.name.tag.ron" + }, + "value": { + "patterns": [ + { + "include": "#array" + }, + { + "include": "#block_comment" + }, + { + "include": "#constant" + }, + { + "include": "#dictionary" + }, + { + "include": "#line_comment" + }, + { + "include": "#number" + }, + { + "include": "#object" + }, + { + "include": "#string" + }, + { + "include": "#character" + } + ] + } + }, + "scopeName": "source.ron" +} \ No newline at end of file