Files
Graphite/website/templates/macros/replacements.html
Keavon Chambers 187b4c38b4 Port website dev docs generated content scripts from JS to Rust to avoid intermediate parsing (#3909)
* Remove the crate dependency graph website generation intermediate generation step

* Remove the message system tree website generation intermediate generation step

* Code cleanup

* Remove cache system

* Fix Windows comment URL error

* Fix incorrect artifact download URLs

* Add Flatpak to comment

* Make Flatpak use debug/release mode choice instead of always release mode
2026-03-17 15:02:15 -07:00

61 lines
2.0 KiB
HTML

{% macro blog_posts(count) %}
{% set articles = get_section(path="blog/_index.md") %}
{% set latest = articles.pages | slice(end = count) %}
{% for article in latest %}
<div class="block">
<a class="banner" href="{{ article.permalink | safe }}"><img loading="lazy" src="{{ article.extra.banner | safe }}" onerror="this.onerror = null; this.src = this.src.replace('.avif', '.png')" alt="Article cover image" /></a>
<h2 class="headline"><a href="{{ article.permalink | safe }}">{{ article.title }}</a></h2>
<div class="summary">
<p>{{ article.summary | striptags | safe }}</p>
</div>
<a href="{{ article.permalink | safe }}" class="link arrow">Keep reading</a>
</div>
{% endfor %}
{% endmacro blog_posts %}
{% macro text_balancer() %}
<style>
.balance-text {
visibility: hidden;
}
@media (scripting: none) {
.balance-text {
visibility: visible !important;
}
}
@supports (text-wrap: balance) {
.balance-text,
.balanced-text {
text-align: left;
text-wrap: balance;
visibility: visible;
}
}
</style>
<script>
{{ load_data(path="static/text-balancer.js", format="plain") | safe }}
</script>
{% endmacro text_balancer %}
{% macro hierarchical_message_system_tree() %}
{%- set content = load_data(path = "../generated/hierarchical-message-system-tree.html", format = "plain", required = false) -%}
{%- set fallback = "<pre>THIS CONTENT IS FILLED IN WHEN CI BUILDS THE WEBSITE.
TO TEST IT LOCALLY, FROM THE ROOT OF THE PROJECT, RUN:
cargo run -p editor-message-tree -- website/generated</pre>" -%}
{{ content | default(value = fallback) | safe }}
{% endmacro hierarchical_message_system_tree %}
{% macro crate_hierarchy() %}
{%- set content = load_data(path = "../generated/crate-hierarchy.svg", format = "plain", required = false) -%}
{%- set fallback = "<pre>THIS CONTENT IS FILLED IN WHEN CI BUILDS THE WEBSITE.
TO TEST IT LOCALLY, FROM THE ROOT OF THE PROJECT, RUN:
cargo run -p crate-hierarchy-viz -- website/generated</pre>" -%}
{{ content | default(value = fallback) | safe }}
{% endmacro crate_hierarchy %}