diff --git a/config.toml b/config.toml index 81e0f5e..a160d5f 100644 --- a/config.toml +++ b/config.toml @@ -22,15 +22,19 @@ generate_feeds = true internal_level = "warn" [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 +bottom_footnotes = true -highlight_theme = "css" +[markdown.highlighting] +error_on_missing_language = true -highlight_themes_css = [ - { theme = "base16-ocean-dark", filename = "assets/css/syntax-theme-dark.css" }, - { theme = "base16-ocean-light", filename = "assets/css/syntax-theme-light.css" }, +style = "class" + +light_theme = "github-light" +dark_theme = "github-dark" + +extra_grammars = [ + "syntaxes/abnf/ABNF.json", + "syntaxes/csl-json/CSL-JSON.json", ] [extra.github] diff --git a/content/_index.md b/content/_index.md index bbf4869..cdf17d9 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,13 +1,15 @@ +++ +[extra] +homepage_badges = [ + { href = "https://discord.gg/Nz6rtfJ8Cu", image = "https://dcbadge.limes.pink/api/server/Nz6rtfJ8Cu?style=flat", alt = "Badge for EIP Editor Discord channel" }, + { href = "https://discord.gg/EVTQ9crVgQ", image = "https://dcbadge.limes.pink/api/server/EVTQ9crVgQ?style=flat", alt = "Badge for Ethereum R&D Discord channel" }, + { href = "https://discord.gg/mRzPXmmYEA", image = "https://dcbadge.limes.pink/api/server/mRzPXmmYEA?style=flat", alt = "Badge for Ethereum Wallets Discord channel" }, + { href = "/atom.xml", image = "https://img.shields.io/badge/rss-Everything-red.svg", alt = "RSS feed for everything" }, + { href = "/status/last-call/atom.xml", image = "https://img.shields.io/badge/rss-Last%20Calls-red.svg", alt = "RSS feed for last calls" }, +] +++ -

EIPs - Discord channel for ECH eip-editer - Discord channel for Eth R&D eip-editing - Discord server for discussions about proposals that impact Ethereum wallets - RSS - RSS -

+# EIPs

Ethereum Improvement Proposals (EIPs) describe standards for the Ethereum platform, including core protocol specifications, client APIs, and contract standards. Network upgrades are discussed separately in the Ethereum Project Management repository.

diff --git a/sass/assets/css/style.scss b/sass/assets/css/style.scss index 4bf4052..a56bd86 100644 --- a/sass/assets/css/style.scss +++ b/sass/assets/css/style.scss @@ -33,6 +33,34 @@ $content-width: 1152px; vertical-align: baseline; } +.homepage-badges { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.5rem; + margin: -0.25rem 0 1.25rem; +} + +.homepage-badge-link { + display: inline-flex; + align-items: center; + line-height: 1; +} + +.homepage-badge-link:hover { + text-decoration: none; +} + +.homepage-badge-link img { + display: block; + max-width: 100%; + height: 20px; +} + +.homepage-badge-link .badge { + font-size: 0.875rem; +} + .footer-col-wrapper { color: #111; } diff --git a/templates/eip.html b/templates/eip.html index 0c959ec..5881b6c 100644 --- a/templates/eip.html +++ b/templates/eip.html @@ -230,11 +230,17 @@

Requires {% for required in page.extra.requires -%} + {% if required is starting_with("http") %} + {% set required_segment = required | split(pat="/") | last %} + {% set required_label = required_segment | replace(from="eip-", to="EIP-") | replace(from="erc-", to="ERC-") %} + {{ required_label }} + {% else %} {% set path = required | trim_start_matches(pat="@/") %} {% set page = get_page(path=path) %} {{ macros::eip_number(page=page) }} + {% endif %} {%- if not loop.last %}, {% endif -%} {%- endfor %} diff --git a/templates/index.html b/templates/index.html index 575141f..5cd5ace 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,17 @@ {% extends "base.html" %} +{% import "macros.html" as macros %} {% block content %} +{% if section.extra.homepage_badges %} +{% set badge_markup = macros::homepage_badges(badges=section.extra.homepage_badges) %} +{% set content_with_badges = section.content | replace(from="

", to="" ~ badge_markup) %} +{% if content_with_badges == section.content %} +{{ badge_markup | safe }} {{ section.content | safe }} +{% else %} +{{ content_with_badges | safe }} +{% endif %} +{% else %} +{{ section.content | safe }} +{% endif %} {% endblock content %} diff --git a/templates/macros.html b/templates/macros.html index 1ec4536..4ce27b7 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,7 +1,27 @@ {%- macro eip_number(page) -%} {%- if page.extra.category and page.extra.category == "ERC" -%} - ERC- + ERC- {%- else -%} - EIP- + EIP- {%- endif -%}{{- page.extra.number -}} {%- endmacro eip_number -%} + +{%- macro homepage_badges(badges) -%} +{%- if badges -%} +
+ {%- for badge in badges -%} + + {%- if badge.image -%} + {{ badge.alt | default(value=badge.label | default(value='Homepage badge')) }} + {%- else -%} + {{ badge.label }} + {%- endif -%} + + {%- endfor -%} +
+{%- endif -%} +{%- endmacro homepage_badges -%} diff --git a/theme.toml b/theme.toml index d0df4e4..f58d1d0 100644 --- a/theme.toml +++ b/theme.toml @@ -1,9 +1,9 @@ name = "eips-theme" description = "A theme for Ethereum Improvement Proposals" license = "MIT" -homepage = "https://github.com/eips-wg/eips-theme" +homepage = "https://github.com/eips-wg/theme" # The minimum version of Zola required -min_version = "0.17.2" +min_version = "0.22.1" # An optional live demo URL demo = "https://eips-wg.github.io/eips-theme"