From d0c493cdb6867763d507a24f12d92f2617385114 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Fri, 10 May 2024 04:17:44 -0700 Subject: [PATCH] Fix and refactor website meta tags for better SEO and social media previews --- .../2022-02-12-announcing-graphite-alpha.md | 1 + ...n-for-the-future-of-2d-content-creation.md | 1 + ...buted-computing-in-the-graphene-runtime.md | 1 + ...01-looking-back-on-2023-and-what's-next.md | 1 + ...s-announcing-participation-in-gsoc-2024.md | 1 + ...-05-09-graphite-progress-report-q1-2024.md | 1 + website/content/features.md | 8 +-- website/templates/404.html | 8 ++- website/templates/article.html | 46 +++++++------- website/templates/base.html | 44 +++++++++----- website/templates/blog.html | 28 ++++----- website/templates/book.html | 60 +++++++++---------- website/templates/page.html | 8 ++- website/templates/section.html | 10 ++-- 14 files changed, 121 insertions(+), 97 deletions(-) diff --git a/website/content/blog/2022-02-12-announcing-graphite-alpha.md b/website/content/blog/2022-02-12-announcing-graphite-alpha.md index 6e627b0d1..a04b1ecd1 100644 --- a/website/content/blog/2022-02-12-announcing-graphite-alpha.md +++ b/website/content/blog/2022-02-12-announcing-graphite-alpha.md @@ -6,6 +6,7 @@ date = 2022-02-12 banner = "https://static.graphite.rs/content/blog/2022-02-12-announcing-graphite-alpha.avif" banner_png = "https://static.graphite.rs/content/blog/2022-02-12-announcing-graphite-alpha.png" author = "Keavon Chambers" +summary = "The Graphite open source team announces the alpha release of their next-generation graphics editor, a web-based SVG editor with vector-based tools. Future plans include a node-based procedural workflow, a raster graphics compositing engine, and a native desktop client." reddit = "https://www.reddit.com/r/graphite/comments/unw3hi/blog_post_announcing_graphite_alpha/" twitter = "https://twitter.com/GraphiteEditor/status/1524663930697568256" +++ diff --git a/website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md b/website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md index bc9bf4555..c3d7d7726 100644 --- a/website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md +++ b/website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md @@ -6,6 +6,7 @@ date = 2022-03-12 banner = "https://static.graphite.rs/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.avif" banner_png = "https://static.graphite.rs/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.png" author = "Keavon Chambers" +summary = "Graphite is an open-source application for 2D graphics editing and digital content creation, offering a nondestructive, node-based workflow. It combines intuitive UI with powerful procedural image generators to revolutionize 2D content creation." reddit = "https://www.reddit.com/r/graphite/comments/unw3va/blog_post_graphite_a_vision_for_the_future_of_2d/" twitter = "https://twitter.com/GraphiteEditor/status/1524664010091556864" +++ diff --git a/website/content/blog/2022-05-12-distributed-computing-in-the-graphene-runtime.md b/website/content/blog/2022-05-12-distributed-computing-in-the-graphene-runtime.md index b50480036..5a96b2b7b 100644 --- a/website/content/blog/2022-05-12-distributed-computing-in-the-graphene-runtime.md +++ b/website/content/blog/2022-05-12-distributed-computing-in-the-graphene-runtime.md @@ -6,6 +6,7 @@ date = 2022-05-12 banner = "https://static.graphite.rs/content/blog/2022-05-12-distributed-computing-in-the-graphene-runtime__2.avif" banner_png = "https://static.graphite.rs/content/blog/2022-05-12-distributed-computing-in-the-graphene-runtime__2.png" author = "Keavon Chambers" +summary = "Graphite's 2D editor is built upon Graphene, a node-based editing system for nondestructive design across various data types designed to render artwork faster using multiple machines. The system optimizes execution paths, minimizes latency, and uses a distributed runtime for quick data processing." reddit = "https://www.reddit.com/r/graphite/comments/unw45k/blog_post_distributed_computing_in_the_graphene/" twitter = "https://twitter.com/GraphiteEditor/status/1524664083554791424" +++ diff --git a/website/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.md b/website/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.md index adb112712..d8c86dd66 100644 --- a/website/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.md +++ b/website/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.md @@ -6,6 +6,7 @@ date = 2024-01-01 banner = "https://static.graphite.rs/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.avif" banner_png = "https://static.graphite.rs/content/blog/2024-01-01-looking-back-on-2023-and-what's-next.png" author = "Keavon Chambers" +summary = "Looking back on 2023, we reflect on our significant achievements and milestones. As we move forward, we're excited to share what's next, promising a year filled with innovation and progress." reddit = "https://www.reddit.com/r/graphite/comments/18xmoti/blog_post_looking_back_on_2023_and_whats_next/" twitter = "https://twitter.com/GraphiteEditor/status/1742576805532577937" diff --git a/website/content/blog/2024-02-22-graphite-internships-announcing-participation-in-gsoc-2024.md b/website/content/blog/2024-02-22-graphite-internships-announcing-participation-in-gsoc-2024.md index ff5b7bee7..635334a7b 100644 --- a/website/content/blog/2024-02-22-graphite-internships-announcing-participation-in-gsoc-2024.md +++ b/website/content/blog/2024-02-22-graphite-internships-announcing-participation-in-gsoc-2024.md @@ -5,6 +5,7 @@ date = 2024-02-22 banner = "https://static.graphite.rs/content/blog/2024-02-22-graphite-internships-announcing-participation-in-gsoc-2024.avif" banner_png = "https://static.graphite.rs/content/blog/2024-02-22-graphite-internships-announcing-participation-in-gsoc-2024.png" author = "Keavon Chambers" +summary = "Join Graphite in Google Summer of Code 2024 for a unique opportunity to contribute to open-source software development in Rust and computer graphics. Get paid while learning, working on self-contained projects under experienced mentors, and help Graphite grow." reddit = "https://www.reddit.com/r/graphite/comments/1ax3l8z/blog_post_graphite_internships_announcing/" twitter = "https://twitter.com/GraphiteEditor/status/1760619083396165703" +++ diff --git a/website/content/blog/2024-05-09-graphite-progress-report-q1-2024.md b/website/content/blog/2024-05-09-graphite-progress-report-q1-2024.md index 9fbf5545c..15d8e8333 100644 --- a/website/content/blog/2024-05-09-graphite-progress-report-q1-2024.md +++ b/website/content/blog/2024-05-09-graphite-progress-report-q1-2024.md @@ -5,6 +5,7 @@ date = 2024-05-09 banner = "https://static.graphite.rs/content/blog/2024-05-09-graphite-progress-report-q1-2024.avif" banner_png = "https://static.graphite.rs/content/blog/2024-05-09-graphite-progress-report-q1-2024.png" author = "Keavon Chambers & Hypercube" +summary = "Graphite's Q1 2024 update introduces a precise snapping system and a customizable grid for enhanced design control. The update also includes improved procedural scattering with the 'Copy to Points' node, demonstrated in new demo artwork." reddit = "https://www.reddit.com/r/graphite/comments/1coa0if/blog_post_graphite_progress_report_q1_2024/" twitter = "https://twitter.com/GraphiteEditor/status/1788698448348266946" +++ diff --git a/website/content/features.md b/website/content/features.md index 429b42c75..3137a0dac 100644 --- a/website/content/features.md +++ b/website/content/features.md @@ -125,14 +125,14 @@ Always on the bleeding edge and built to last— Graphite is written on a robust Imaginate (Stable Diffusion node/tool) +
+ + Editable nested node subgraphs +
Native desktop app (with Tauri)
-
- - Custom subgraph nodes -
Boolean operations for shapes diff --git a/website/templates/404.html b/website/templates/404.html index 4a4ba7051..e4dc9c7d4 100644 --- a/website/templates/404.html +++ b/website/templates/404.html @@ -1,8 +1,10 @@ {% extends "base.html" %} -{% block title %}Page not found{% endblock title %} +{%- block head -%} +{%- set title = "Page not found" -%} +{%- endblock head -%} -{% block content %} +{%- block content -%}

Page not found

@@ -11,4 +13,4 @@ Home Page
-{% endblock content %} +{%- endblock content -%} diff --git a/website/templates/article.html b/website/templates/article.html index 2c0bd601e..dd476d192 100644 --- a/website/templates/article.html +++ b/website/templates/article.html @@ -1,40 +1,36 @@ {% extends "base.html" %} -{% block title %}Blog | {% set this = section | default(value = page) %}{{ this.title }}{% endblock title %} - -{% block head %} -{% set this = section | default(value = page) %} - - - - - -{% endblock head %} - -{% block content %} -{% set this = section | default(value = page) %} +{%- block head -%}{%- set page = page | default(value = section) -%} +{%- set title = "Blog | " ~ page.title -%} +{%- set meta_title = page.title -%} +{%- set meta_image = page.extra.banner_png | safe -%} +{%- set meta_article_type = true -%} +{%- set meta_description = page.extra.summary | default(value = page.content | striptags | safe | linebreaksbr | replace(from = "
", to = " ") | replace(from = " ", to = " ") | trim | truncate(length = 200)) -%} +{%- set css = ["article.css"] -%} +{%- endblock head -%} +{%- block content -%}{%- set page = page | default(value = section) -%}
-

{{ this.title }}

- By {{ this.extra.author }}. {{ this.date | date(format = "%B %d, %Y", timezone="America/Los_Angeles") }}. - +

{{ page.title }}

+ By {{ page.extra.author }}. {{ page.date | date(format = "%B %d, %Y", timezone="America/Los_Angeles") }}. +

- {{ this.content | safe }} + {{ page.content | safe }}
- {% if this.extra.reddit or this.extra.twitter %} + {% if page.extra.reddit or page.extra.twitter %}
-{% endblock content %} +{%- if not page.summary -%} +{{ throw(message = "ARTICLE HAS NO SUMMARY! After the first paragraph (or two short ones), a `` comment must be inserted in the markdown. Otherwise the blog page will be missing its preview text." | safe) }} +{%- endif -%} +{%- endblock content -%} + diff --git a/website/templates/base.html b/website/templates/base.html index 9b57cfcc5..383c16c81 100644 --- a/website/templates/base.html +++ b/website/templates/base.html @@ -1,13 +1,30 @@ - {% set this = section | default(value = page | default(value = false)) %} + {%- block head -%}{%- endblock head -%} + {%- set page = page | default(value = section | default(value = false)) -%} + Graphite | {{ title | safe }} - Graphite | {% block title %}{% endblock title %} - {% block rss %} - - {% endblock %} + {% if current_path -%} + + {%- endif %} + {% if meta_description -%} + + + + {%- endif %} + + + + + + + + + {% block rss -%} + + {%- endblock %} @@ -15,17 +32,14 @@ - {% if this and this.extra.css %} - {% for css in this.extra.css %} - + {%- set extra_css = page.extra.css | default(value = []) | concat(with = css | default(value = [])) -%} + {% for css_path in extra_css %} + {% endfor %} - {% endif %} - {% block head %}{% endblock head %} - {% if this and this.extra.js %} - {% for js in this.extra.js %} - + {%- set extra_js = page.extra.js | default(value = []) | concat(with = js | default(value = [])) -%} + {% for js_path in extra_js %} + {% endfor %} - {% endif %} @@ -78,7 +92,7 @@
- {% block content %}{% endblock %} + {%- block content -%}{%- endblock -%}
diff --git a/website/templates/blog.html b/website/templates/blog.html index 3d3e56d27..cb0dd495f 100644 --- a/website/templates/blog.html +++ b/website/templates/blog.html @@ -1,35 +1,33 @@ {% extends "base.html" %} -{% block title %}{{ section.title }}{% endblock title %} +{%- block head -%}{%- set page = page | default(value = section) -%} +{%- set title = page.title -%} +{%- set meta_title = "Graphite Blog" -%} +{%- set css = ["blog.css"] -%} +{%- endblock head -%} -{% block head %} - -{% endblock head %} - -{% block content %} -{{ section.content | safe }} +{%- block content -%}{%- set page = page | default(value = section) -%} +{{ page.content | safe }}
- {% for page in section.pages %} + {% for page in page.pages %}
By {{ page.extra.author }}. {{ page.date | date(format = "%B %d, %Y", timezone = "America/Los_Angeles") }}.
-
- {{ page.summary | safe }} -
+
{{ page.summary | safe }}
{% endfor %}
-{% endblock content %} +{%- endblock content -%} diff --git a/website/templates/book.html b/website/templates/book.html index 5d5ec2a48..609eeb4ec 100644 --- a/website/templates/book.html +++ b/website/templates/book.html @@ -1,17 +1,17 @@ {% extends "base.html" %} -{% block title %}{% set this = section | default(value = page) %}{{ this.title }}{% endblock title %} +{%- block head -%}{%- set page = page | default(value = section) -%} +{%- set title = page.title -%} +{%- set meta_article_type = true -%} +{%- set meta_description = page.extra.summary | default(value = page.content | striptags | safe | linebreaksbr | replace(from = "
", to = " ") | replace(from = " ", to = " ") | trim | truncate(length = 200)) -%} +{%- set css = ["book.css"] -%} +{%- set js = ["book.js"] -%} +{%- endblock head -%} -{% block head %} - - -{% endblock head %} - -{% block content %} -{% set this = section | default(value = page) %} +{%- block content -%}{%- set page = page | default(value = section) -%} {# Search this page-or-section's ancestor tree for a section that identifies itself as a book, and save it to a `book` variable #} -{% for ancestor_path in this.ancestors | concat(with = this.relative_path) %} +{% for ancestor_path in page.ancestors | concat(with = page.relative_path) %} {# Get the ancestor section from this ancestor path string #} {% if ancestor_path is ending_with("/_index.md") %} {% set potential_book = get_section(path = ancestor_path) %} @@ -44,23 +44,23 @@ {% for chapter in chapters %}
    -
  • » {{ chapter.title }}
  • +
  • » {{ chapter.title }}
  • {% set_global flat_pages = flat_pages | concat(with = chapter) %} - {% if chapter == this %}{% set_global flat_index_of_this = flat_pages | length - 1 %}{% endif %} + {% if chapter == page %}{% set_global flat_index_of_this = flat_pages | length - 1 %}{% endif %} {% if chapter.pages %} - {% for page in chapter.pages | sort(attribute = "extra.order") %} + {% for chapter_page in chapter.pages | sort(attribute = "extra.order") %} - {% set_global flat_pages = flat_pages | concat(with = page) %} - {% if page == this %}{% set_global flat_index_of_this = flat_pages | length - 1 %}{% endif %} + {% set_global flat_pages = flat_pages | concat(with = chapter_page) %} + {% if chapter_page == page %}{% set_global flat_index_of_this = flat_pages | length - 1 %}{% endif %} -
  • » {{ page.title }}
  • +
  • » {{ chapter_page.title }}
  • {% endfor %} @@ -81,10 +81,10 @@ -

    {{ this.title }}

    +

    {{ page.title }}

- {{ this.content | safe }} + {{ page.content | safe }}

@@ -94,7 +94,7 @@ {% set prev = flat_pages | nth(n = flat_index_of_this - 1) %} {% endif %} {% if prev %} - + @@ -109,7 +109,7 @@ {% set next = flat_pages | nth(n = flat_index_of_this + 1) %} {% endif %} {% if next %} - + {{ next.title }} @@ -124,29 +124,29 @@