From e3ecf86d36c9a263ac08a0d56c8a4ee8edb89ce1 Mon Sep 17 00:00:00 2001 From: Paillat-dev Date: Sat, 19 Sep 2026 16:22:19 +0200 Subject: [PATCH 1/4] feat: Embed components --- overrides/main.html | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 overrides/main.html diff --git a/overrides/main.html b/overrides/main.html new file mode 100644 index 00000000..1136b92b --- /dev/null +++ b/overrides/main.html @@ -0,0 +1,72 @@ +{% extends "base.html" %} +{% block extrahead %} +{% set ns = namespace(title="", content="", readtime_s="", icon_href="https://guide.pycord.dev/img/logo.png") %} +{% set ns.title = page.meta.title if page.meta and page.meta.title else page.title|striptags %} +{% set ns.content = page.meta.description if page.meta and page.meta.description else config.site_description %} + +{% if page.url %} +{% set chars = page.content|striptags|length %} +{% if chars > 300 %} +{% set minutes = (chars / 1590)|round|int %} +{% if minutes < 1 %}{% set minutes = 1 %}{% endif %} +{% set ns.readtime_s = lang.t("readtime.one") if minutes == 1 else lang.t("readtime.other")|replace("#", minutes|string) %} +{% set stripped = page.content|striptags %} +{% if stripped|length > 250 %} +{% set ns.content = stripped[:247] ~ "..." %} +{% else %} +{% set ns.content = stripped %} +{% endif %} +{% endif %} +{% endif %} + +{% endblock %} \ No newline at end of file From e19f39ab7701b47bb31aa8671963df6b146524a4 Mon Sep 17 00:00:00 2001 From: Paillat-dev Date: Sat, 19 Sep 2026 16:27:56 +0200 Subject: [PATCH 2/4] feat: Add separatpr --- overrides/main.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/overrides/main.html b/overrides/main.html index 1136b92b..ec987727 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -46,6 +46,11 @@ } ] }, + { + "type": 14, + "divider": false, + "spacing": 1 + }, { "type": 1, "components": [ From ac0dd93f9188d77137fafc33d167497bd37db765 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Sat, 19 Sep 2026 20:57:15 +0200 Subject: [PATCH 3/4] Update main.html Signed-off-by: Lala Sabathil --- overrides/main.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overrides/main.html b/overrides/main.html index ec987727..15b88881 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -34,7 +34,7 @@ "accessory": { "type": 11, "media": { - "url": {{ icon_href | tojson }} + "url": {{ ns.icon_href | tojson }} }, "description": null, "spoiler": false @@ -74,4 +74,4 @@ } } -{% endblock %} \ No newline at end of file +{% endblock %} From e4746189cbb090e2f50d4d28d74f28eb6da7a55d Mon Sep 17 00:00:00 2001 From: Paillat-dev Date: Sat, 7 Nov 2026 00:32:44 +0100 Subject: [PATCH 4/4] feat: Better embeds --- overrides/main.html | 47 ++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/overrides/main.html b/overrides/main.html index 15b88881..f8ba1699 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -1,24 +1,31 @@ {% extends "base.html" %} {% block extrahead %} -{% set ns = namespace(title="", content="", readtime_s="", icon_href="https://guide.pycord.dev/img/logo.png") %} -{% set ns.title = page.meta.title if page.meta and page.meta.title else page.title|striptags %} -{% set ns.content = page.meta.description if page.meta and page.meta.description else config.site_description %} - -{% if page.url %} -{% set chars = page.content|striptags|length %} -{% if chars > 300 %} -{% set minutes = (chars / 1590)|round|int %} -{% if minutes < 1 %}{% set minutes = 1 %}{% endif %} -{% set ns.readtime_s = lang.t("readtime.one") if minutes == 1 else lang.t("readtime.other")|replace("#", minutes|string) %} -{% set stripped = page.content|striptags %} -{% if stripped|length > 250 %} -{% set ns.content = stripped[:247] ~ "..." %} -{% else %} -{% set ns.content = stripped %} -{% endif %} -{% endif %} -{% endif %} - + {% endblock %}