add: open graph tags for posts and notes

This commit is contained in:
trisua 2025-06-21 21:32:51 -04:00
parent af6fbdf04e
commit 0c509b7001
4 changed files with 97 additions and 20 deletions

View file

@ -1,5 +1,43 @@
(text "{% extends \"root.html\" %} {% block head %}")
(text "{% if journal -%}") (title (text "{{ journal.title }}")) (text "{% else %}") (title (text "Journals - {{ config.name }}")) (text "{%- endif %}")
(text "{% if note and journal and owner -%}")
(meta
("name" "og:title")
("content" "{{ note.title }}"))
(meta
("name" "description")
("content" "View this note from the {{ journal.title }} journal on {{ config.name }}!"))
(meta
("name" "og:description")
("content" "View this note from the {{ journal.title }} journal on {{ config.name }}!"))
(meta
("property" "og:type")
("content" "website"))
(meta
("name" "og:image")
("content" "{{ config.host|safe }}/api/v1/auth/user/{{ owner.username }}/avatar?selector_type=username"))
(meta
("name" "twitter:image")
("content" "{{ config.host|safe }}/api/v1/auth/user/{{ owner.username }}/avatar?selector_type=usernamev"))
(meta
("name" "twitter:card")
("content" "summary"))
(meta
("name" "twitter:title")
("content" "{{ note.title }}"))
(meta
("name" "twitter:description")
("content" "View this note from the {{ journal.title }} journal on {{ config.name }}!"))
(text "{%- endif %}")
(link ("rel" "stylesheet") ("data-turbo-temporary" "true") ("href" "/css/chats.css?v=tetratto-{{ random_cache_breaker }}"))
(style

View file

@ -48,7 +48,7 @@
(a
("href" "/requests")
("class" "button {% if selected == 'requests' -%}active{%- endif %}")
("title" "Chats")
("title" "Requests")
(icon (text "inbox"))
(span
("class" "notification tr {% if user.request_count <= 0 -%}hidden{%- endif %}")
@ -58,7 +58,7 @@
(a
("href" "/notifs")
("class" "button {% if selected == 'notifications' -%}active{%- endif %}")
("title" "Chats")
("title" "Notifications")
(icon (text "bell"))
(span
("class" "notification tr {% if user.notification_count <= 0 -%}hidden{%- endif %}")

View file

@ -2,6 +2,41 @@
(title
(text "Post - {{ config.name }}"))
(meta
("name" "og:title")
("content" "{% if owner.settings.display_name -%} {{ owner.settings.display_name }} {%- else -%} {{ owner.username }} {%- endif %}'s post"))
(meta
("name" "description")
("content" "View this post from @{{ owner.username }} on {{ config.name }}!"))
(meta
("name" "og:description")
("content" "View this post from @{{ owner.username }} on {{ config.name }}!"))
(meta
("property" "og:type")
("content" "website"))
(meta
("name" "og:image")
("content" "{{ config.host|safe }}/api/v1/auth/user/{{ owner.username }}/avatar?selector_type=username"))
(meta
("name" "twitter:image")
("content" "{{ config.host|safe }}/api/v1/auth/user/{{ owner.username }}/avatar?selector_type=usernamev"))
(meta
("name" "twitter:card")
("content" "summary"))
(meta
("name" "twitter:title")
("content" "{% if owner.settings.display_name -%} {{ owner.settings.display_name }} {%- else -%} {{ owner.username }} {%- endif %}'s post"))
(meta
("name" "twitter:description")
("content" "View this post from @{{ owner.username }} on {{ config.name }}!"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex-col gap-2")