From ecfc5ca919b18f5828c45695595d97adbfd96e26 Mon Sep 17 00:00:00 2001 From: alexbainter Date: Wed, 31 Dec 2025 12:29:30 -0600 Subject: [PATCH 1/2] Add GitHub logo to external GitHub links --- core/static/css/site.css | 6 +++ core/templates/core/schemas/detail.html | 28 +++++++--- .../core/schemas/detail_schema_ref.html | 4 +- core/templates/core/schemas/layout.html | 8 +-- core/templatetags/filters.py | 53 +++++++++++++++++++ core/views.py | 3 +- 6 files changed, 89 insertions(+), 13 deletions(-) diff --git a/core/static/css/site.css b/core/static/css/site.css index 2f729bd..4eef2ad 100644 --- a/core/static/css/site.css +++ b/core/static/css/site.css @@ -51,6 +51,12 @@ a:hover { color: var(--text-link-color-highlight); } +.text-with-icon { + display: flex; + align-items: center; + gap: 0.25rem; +} + input, select { border-radius: 8px; diff --git a/core/templates/core/schemas/detail.html b/core/templates/core/schemas/detail.html index 49d0f0e..9240170 100644 --- a/core/templates/core/schemas/detail.html +++ b/core/templates/core/schemas/detail.html @@ -1,25 +1,41 @@ {% extends "core/schemas/layout.html" %} +{% load filters %} {% block head_title %} {{ schema.name }} - Schemas.Pub {% endblock %} {% block schema_content %}
- {% if latest_readme_format == 'markdown' %} + {% if latest_readme.format == 'markdown' %}
{{ latest_readme_content }}
- {% elif latest_readme_format == 'plaintext' %} +
+ + {% elif latest_readme.format == 'plaintext' %}
{{ latest_readme_content }}
- {% elif latest_readme_url %} +
+ + {% elif latest_readme %} - {% endif %} + {% endif %}
{% endblock %} diff --git a/core/templates/core/schemas/detail_schema_ref.html b/core/templates/core/schemas/detail_schema_ref.html index dd4a4ab..e599221 100644 --- a/core/templates/core/schemas/detail_schema_ref.html +++ b/core/templates/core/schemas/detail_schema_ref.html @@ -1,4 +1,5 @@ {% extends "core/schemas/layout.html" %} +{% load filters %} {% load static %} {% block extra_head %} @@ -28,8 +29,9 @@

Unnamed definition

{{ schema_ref.content|escape }}
{% endif %} +

- View source + View source{{ schema_ref|branded_external_link_icon_for_reference_item }}

{% endblock %} diff --git a/core/templates/core/schemas/layout.html b/core/templates/core/schemas/layout.html index e8382bc..16fd7cb 100644 --- a/core/templates/core/schemas/layout.html +++ b/core/templates/core/schemas/layout.html @@ -50,9 +50,9 @@

diff --git a/core/templates/core/schemas/layout.html b/core/templates/core/schemas/layout.html index 16fd7cb..85c4b2a 100644 --- a/core/templates/core/schemas/layout.html +++ b/core/templates/core/schemas/layout.html @@ -91,6 +91,27 @@

{% endblock %}