From 8aa2ae762af9b7efe8620f58d590fcc649dd6f5c Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 28 Oct 2024 13:26:47 -0400 Subject: [PATCH 01/21] fix: link to the activity id --- _includes/head.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index 4a43101e..82880b33 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -54,13 +54,13 @@ {% if page.activity %} - + {% endif %} {%- if site.actor -%} - + {%- endif -%} From ec7e22e5485c01f232a79f764b62f40cf4892c7c Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 28 Oct 2024 18:06:50 -0400 Subject: [PATCH 02/21] Update activity_pub.yml with corrected link to the activity id --- _data/activity_pub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/activity_pub.yml b/_data/activity_pub.yml index 4a2b12e2..b98b16ab 100644 --- a/_data/activity_pub.yml +++ b/_data/activity_pub.yml @@ -144,7 +144,7 @@ notifications: created_at: 1726241977 dripline/storing-metadata-at-starling-lab.jsonld: action: done - id: https://staging.hypha.coop/dripline/storing-metadata-at-starling-lab.jsonld + id: https://hypha.hypha.coop/dripline/storing-metadata-at-starling-lab.jsonld created_at: 1728400393 actor_url: https://hypha.coop/about.jsonld actor: "@dripline@hypha.coop" From 5376bcad136e7941a412d28d5eb947df9f91c5bb Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 28 Oct 2024 18:08:19 -0400 Subject: [PATCH 03/21] Refactor post.html to include activity_pub interactions and replies --- _layouts/dripline/post.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_layouts/dripline/post.html b/_layouts/dripline/post.html index 57792a2a..9bd8af29 100644 --- a/_layouts/dripline/post.html +++ b/_layouts/dripline/post.html @@ -21,6 +21,13 @@

{{ page.date | date: site.date_format }} {{ content }} + {% if page.activity.inReplyTo %} + {% include activity_pub/replying_to.html activity=page.activity.inReplyTo %} + {% endif %} + + {% if page.activity %} + {% include activity_pub/interactions.html activity=page.activity profile=site.actor %} + {% endif %} From 03f0ec68bb53602f8e03dba53eb1b0ed12918df3 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 28 Oct 2024 18:08:56 -0400 Subject: [PATCH 04/21] Include activity_pub interactions and replies --- _includes/activity_pub/actor.html | 11 +++ _includes/activity_pub/actor_mention.html | 28 +++++++ _includes/activity_pub/button.html | 22 ++++++ _includes/activity_pub/button_bar.html | 16 ++++ _includes/activity_pub/cards.html | 28 +++++++ .../activity_pub/fediverse_interactions.html | 2 + _includes/activity_pub/generic_modal.html | 55 +++++++++++++ _includes/activity_pub/image_modal.html | 27 +++++++ _includes/activity_pub/interactions.html | 78 +++++++++++++++++++ _includes/activity_pub/login_modal.html | 69 ++++++++++++++++ _includes/activity_pub/reaction.html | 45 +++++++++++ _includes/activity_pub/reactions.html | 17 ++++ _includes/activity_pub/replying_to.html | 23 ++++++ _includes/activity_pub/text_modal.html | 16 ++++ _includes/activity_pub/toot_card.html | 0 _includes/activity_pub/url.html | 8 ++ _includes/activity_pub/video_modal.html | 20 +++++ _includes/bootstrap/custom_select.html | 18 +++++ _includes/date.html | 12 +++ _includes/external_link.html | 16 ++++ _includes/fa.html | 0 21 files changed, 511 insertions(+) create mode 100644 _includes/activity_pub/actor.html create mode 100644 _includes/activity_pub/actor_mention.html create mode 100644 _includes/activity_pub/button.html create mode 100644 _includes/activity_pub/button_bar.html create mode 100644 _includes/activity_pub/cards.html create mode 100644 _includes/activity_pub/fediverse_interactions.html create mode 100644 _includes/activity_pub/generic_modal.html create mode 100644 _includes/activity_pub/image_modal.html create mode 100644 _includes/activity_pub/interactions.html create mode 100644 _includes/activity_pub/login_modal.html create mode 100644 _includes/activity_pub/reaction.html create mode 100644 _includes/activity_pub/reactions.html create mode 100644 _includes/activity_pub/replying_to.html create mode 100644 _includes/activity_pub/text_modal.html create mode 100644 _includes/activity_pub/toot_card.html create mode 100644 _includes/activity_pub/url.html create mode 100644 _includes/activity_pub/video_modal.html create mode 100644 _includes/bootstrap/custom_select.html create mode 100644 _includes/date.html create mode 100644 _includes/external_link.html create mode 100644 _includes/fa.html diff --git a/_includes/activity_pub/actor.html b/_includes/activity_pub/actor.html new file mode 100644 index 00000000..a3dfc215 --- /dev/null +++ b/_includes/activity_pub/actor.html @@ -0,0 +1,11 @@ +{% comment %} + Render actor's name if it's available, otherwise just return the link. + + @param actor [ActivityDrop] Actor +{% endcomment %} + +{% if include.actor.available %} + {{ include.actor.name | strip_html }} +{% else %} + {{ include.actor }} +{% endif %} diff --git a/_includes/activity_pub/actor_mention.html b/_includes/activity_pub/actor_mention.html new file mode 100644 index 00000000..fb36e0e6 --- /dev/null +++ b/_includes/activity_pub/actor_mention.html @@ -0,0 +1,28 @@ +{% comment %} + @param actor [ActivityDrop] Actor + @param without_link [Boolean] Don't link +{% endcomment %} + +{% if include.actor.available %} + {% assign id = include.actor.id | strip_html %} + {% assign instance_hostname = id | split: '/' %} + {% assign instance_hostname = instance_hostname[2] %} + + {% capture mention %} + @{{- include.actor.preferredUsername | strip_html -}}@{{- instance_hostname -}} + {% endcapture %} + + {% capture mention %} + + {% if include.without_link %} + {{- mention -}} + {% else %} + {% include external_link.html class="u-url mention" href=id text=mention %} + {% endif %} + + {% endcapture %} + + {{ mention | normalize_whitespace }} +{% else %} + {{ include.actor }} +{% endif %} diff --git a/_includes/activity_pub/button.html b/_includes/activity_pub/button.html new file mode 100644 index 00000000..791dc7cf --- /dev/null +++ b/_includes/activity_pub/button.html @@ -0,0 +1,22 @@ +{%- comment -%} + Un botón con link, por ejemplo para Support Us. Si el link es externo, + agregar el parámetro de seguridad noopener. + + @param :fa [String] + @param :header [Capture] el contenido del encabezado + @param :body [Capture] el contenido del cuerpo principal + @param :footer [Capture] el contenido del footer + @param :header_class [String] las clases que lleva el encabezado + @param :body_class [String] las clases que lleva el cuerpo principal + @param :footer_class [String] las clases que lleva el footer + @param :content_class [String] las clases que lleva todo el bloque de contenido + @param :button_class [String] las clases que lleva cada botón +{%- endcomment -%} + +
+ + + {% include activity_pub/generic_modal.html header=include.header body=include.body footer=include.footer header_class=include.header_class body_class=include.body_class footer_class=include.footer_class content_class=include.content_class %} +
diff --git a/_includes/activity_pub/button_bar.html b/_includes/activity_pub/button_bar.html new file mode 100644 index 00000000..2050c644 --- /dev/null +++ b/_includes/activity_pub/button_bar.html @@ -0,0 +1,16 @@ +{%- comment -%} + Botonera para botones de íconos. + + @param :uri [String] La URL sobre la que se interactua + @param :profile [ActivityDrop] Actor +{%- endcomment -%} + +{% assign uri = include.uri | default: include.url | default: 'YOU FORGOT THIS PARAM' | strip_html %} +{% assign actions = site.data.actions.actions %} + +
+ {% for action in actions %} + {% assign fa = action.icon %} + {% include activity_pub/login_modal.html action=action fa=fa uri=uri profile=include.profile description=action.title %} + {% endfor %} +
diff --git a/_includes/activity_pub/cards.html b/_includes/activity_pub/cards.html new file mode 100644 index 00000000..6829352f --- /dev/null +++ b/_includes/activity_pub/cards.html @@ -0,0 +1,28 @@ +{%- comment -%} + Nested cards + + @param :profile [ActivityDrop] Actor + @param :activity [ActivityDrop] Note + @param :replies [ActivityDrop] Collection +{%- endcomment -%} + +{% + include activity_pub/toot_card.html + profile=include.profile + activity=include.activity + component_class="my-3" +%} + +{% if include.replies.available %} + {% assign replies = include.replies.all_items | sort: 'published' %} + {% for reply in replies %} +
+ {% + include activity_pub/cards.html + profile=reply.attributedTo + activity=reply + replies=reply.replies + %} +
+ {% endfor %} +{% endif %} diff --git a/_includes/activity_pub/fediverse_interactions.html b/_includes/activity_pub/fediverse_interactions.html new file mode 100644 index 00000000..5deaacb2 --- /dev/null +++ b/_includes/activity_pub/fediverse_interactions.html @@ -0,0 +1,2 @@ +{% assign extra = 'data-action="tabs#toggle" data-tabs-target="value"' %} +{% include bootstrap/custom_select.html extra=extra options=site.i18n.fediverse_interactions %} diff --git a/_includes/activity_pub/generic_modal.html b/_includes/activity_pub/generic_modal.html new file mode 100644 index 00000000..aa991f47 --- /dev/null +++ b/_includes/activity_pub/generic_modal.html @@ -0,0 +1,55 @@ +{%- comment -%} + Modal preparado para recibir contenido + header y footer + + @param :header [Capture] contenido del header + @param :body [Capture] contenido del modal + @param :footer [Capture] contenido del footer + @param :header_class [String] clases del header + @param :body_class [String] clases del cuerpo principal + @param :footer_class [String] clases del header + @param :content_class [String] clases todo el bloque +{%- endcomment -%} + +{% assign header = include.header %} +{% assign header_class = include.header_class %} +{% assign body = include.body %} +{% assign body_class = include.body_class %} +{% assign footer = include.footer %} +{% assign footer_class = include.footer_class %} +{% assign content_class = include.content_class %} + + diff --git a/_includes/activity_pub/image_modal.html b/_includes/activity_pub/image_modal.html new file mode 100644 index 00000000..ef0eeea8 --- /dev/null +++ b/_includes/activity_pub/image_modal.html @@ -0,0 +1,27 @@ +{%- comment -%} + Modal con imagen + + @param :image [Image] la imagen que queremos en el modal, contiene url y alt text +{%- endcomment -%} + +{% assign extra = 'data-action="click->modal#show"' %} +{% assign alt = include.image.name | strip_html | escape %} +{% assign src = include.image.url | strip_html | uri_escape %} + +{% capture body %} + {{ alt }} +{% endcapture %} + +
+ {% + include embed_responsive.html + x=16 + y=9 + src=src + alt=alt + extra=extra + width=300 + img_class="cursor-pointer min-w-100px w-100 object-fit-cover" + %} + {% include activity_pub/generic_modal.html header_class="text-white" body=body body_class="d-flex justify-content-center" footer_class="d-none" content_class="background-transparent border-0" %} +
diff --git a/_includes/activity_pub/interactions.html b/_includes/activity_pub/interactions.html new file mode 100644 index 00000000..e6fbf8c3 --- /dev/null +++ b/_includes/activity_pub/interactions.html @@ -0,0 +1,78 @@ +{% comment %} + @param activity [ActivityDrop] +{% endcomment %} + +{% assign items = site.i18n.fediverse_interactions %} +{% assign reactions = '' | split: ',' %} +{% assign activities = reactions %} + +{% if page.activity.replies.available %} + {% assign activities = page.activity.replies.all_items | sort: 'published' %} +{% endif %} + +{% if include.activity.likes.available %} + {% assign reactions = reactions | concat: include.activity.likes.all_items %} +{% endif %} + +{% if include.activity.shares.available %} + {% assign reactions = reactions | concat: include.activity.shares.all_items %} +{% endif %} + +{% assign reactions = reactions | sort: 'published' %} + +{% assign all_interactions = activities | concat: reactions | sort: 'published' %} + +
+ {% include activity_pub/button_bar.html uri=include.activity.id profile=include.profile %} + +
+ +

{{ site.i18n.ver_interacciones }}

+ + diff --git a/_includes/activity_pub/login_modal.html b/_includes/activity_pub/login_modal.html new file mode 100644 index 00000000..e0a144d3 --- /dev/null +++ b/_includes/activity_pub/login_modal.html @@ -0,0 +1,69 @@ +{%- comment -%} + Modal para loguearse al fediverso + + @param :action [String] acción que le usuarie quiere realizar desde el fediverso + @param :fa [String] nombre del ícono que usa fork-awesome + @param :uri [String] la URL sobre la que se interactúa + @param :profile [ActivityDrop] Actor +{%- endcomment -%} + +{% assign action = include.action %} +{% assign fa = include.fa %} +{% capture name %} + {% include activity_pub/actor.html actor=include.profile %} +{% endcapture %} + +{% capture header %} + +
+ + + {{ site.i18n.login_modal[action.title].text | replace: "$usuarie", name }} +
+ × + {{ site.i18n.close }} +
+
+
+{% endcapture %} + +{% capture body %} +

{{site.i18n.login_modal.top_text | markdownify | replace: "$action", site.i18n.login_modal[action.title].title }}

+
{{site.i18n.login_modal.question | markdownify}}
+
+
+
+
+ + +
+ {{- site.i18n.login_modal.authorize_interaction_unsupported -}} +
+
+ +
+ +
+
+
+
+{{site.i18n.login_modal.small_text}} +{{site.i18n.login_modal.bottom_text | markdownify}} +{% endcapture %} + +{% capture footer %} +{% endcapture %} + +{% include activity_pub/button.html header=header body=body footer=footer header_class="justify-content-center border-bottom-0" body_class="justify-content-center" footer_class="border-top-0" content_class="p-2" button_class="mx-1" fa=action.icon description=include.description %} diff --git a/_includes/activity_pub/reaction.html b/_includes/activity_pub/reaction.html new file mode 100644 index 00000000..d0c0eb33 --- /dev/null +++ b/_includes/activity_pub/reaction.html @@ -0,0 +1,45 @@ +{%- comment -%} + Reacción + + @param :activity [String] Reacción de le usuarie + @param :fa [String] nombre del ícono que usa fork-awesome + @param :actor [String] Usuarie +{%- endcomment -%} + +{% assign published = include.activity.published | strip_html %} + +
+
+ {% include date.html date=published format=site.i18n.date.format %} + {% include date.html date=published format=site.i18n.time.format %} +
+ +
+ {% if include.previous.actor == include.activity.actor %} +
+

+ {% include activity_pub/actor.html actor=include.activity.actor %} +

+
+
+

+ {% include activity_pub/actor_mention.html actor=include.activity.actor without_link=true %} +

+
+ {% else %} +
+

{% include activity_pub/actor.html actor=include.activity.actor %}

+
+
+ {% include activity_pub/actor_mention.html actor=include.activity.actor %} +
+ {% endif %} +
+ +
+ {% assign icon = include.activity.type | equals: 'Announce' | ternary: 'retweet', 'star-o' %} + {% assign description = site.i18n.activities[include.activity.type] %} + + {%- include fa.html icon=icon class="lead" description=description -%} +
+
diff --git a/_includes/activity_pub/reactions.html b/_includes/activity_pub/reactions.html new file mode 100644 index 00000000..bc5ffc8f --- /dev/null +++ b/_includes/activity_pub/reactions.html @@ -0,0 +1,17 @@ +{%- comment -%} + Reacciones + + @param :reactions [Array] Reacciones + @param :actor [String] Usuarie +{%- endcomment -%} + +{% for reaction in include.reactions %} + {% assign minus = forloop.index0 | minus: 1 %} + {% assign previous = include.reactions[minus] %} + + {% + include activity_pub/reaction.html + activity=reaction + previous=previous + %} +{% endfor %} diff --git a/_includes/activity_pub/replying_to.html b/_includes/activity_pub/replying_to.html new file mode 100644 index 00000000..d6d154f3 --- /dev/null +++ b/_includes/activity_pub/replying_to.html @@ -0,0 +1,23 @@ +{%- comment -%} + Texto + enlace al post/artículo al cual se responde + + @param :activity [ActivityDrop] Activity +{%- endcomment -%} + +{% if include.activity.available %} + {%- capture uri -%} + {%- include activity_pub/url.html activity=include.activity -%} + {%- endcapture -%} + + {% capture text %} + {{- include.activity.name | default: include.activity.summary | strip_html | default: site.i18n.reply.link_text -}} + {% endcapture %} + +
+ + {{- site.i18n.reply.text -}} + + + {% include external_link.html href=uri class="h2" text=text %} +
+{% endif %} diff --git a/_includes/activity_pub/text_modal.html b/_includes/activity_pub/text_modal.html new file mode 100644 index 00000000..6aeca64f --- /dev/null +++ b/_includes/activity_pub/text_modal.html @@ -0,0 +1,16 @@ +{%- comment -%} + Modal para mostrar texto + + @param :text [String] contenido del modal + @param :fa [String] nombre del ícono que usa fork-awesome +{%- endcomment -%} + +{% capture body %} +{{ include.text }} +{% endcapture %} + +{% capture footer %} +{% endcapture %} + +{% assign fa = include.fa %} +{% include activity_pub/button.html body=body footer=footer body_class="justify-content-center" footer_class="border-top-0 d-none" content_class="p-2" fa=fa %} diff --git a/_includes/activity_pub/toot_card.html b/_includes/activity_pub/toot_card.html new file mode 100644 index 00000000..e69de29b diff --git a/_includes/activity_pub/url.html b/_includes/activity_pub/url.html new file mode 100644 index 00000000..fda593cb --- /dev/null +++ b/_includes/activity_pub/url.html @@ -0,0 +1,8 @@ +{%- comment -%} + Finds the URL + + @param activity [ActivityDrop] +{%- endcomment -%} + +{%- assign uri = include.activity.url | find: 'rel', 'canonical' -%} +{{- uri.href | default: include.activity.url | default: include.activity.id | strip_html -}} diff --git a/_includes/activity_pub/video_modal.html b/_includes/activity_pub/video_modal.html new file mode 100644 index 00000000..55458d32 --- /dev/null +++ b/_includes/activity_pub/video_modal.html @@ -0,0 +1,20 @@ +{%- comment -%} + Modal con imagen + + @param :image [Image] la imagen que queremos en el modal, contiene url y alt text +{%- endcomment -%} + +{% capture body %} + +{% endcapture %} + +
+
+ +
+ {% include activity_pub/generic_modal.html header_class="text-white" body=body body_class="d-flex justify-content-center" footer_class="d-none" content_class="background-transparent border-0" %} +
diff --git a/_includes/bootstrap/custom_select.html b/_includes/bootstrap/custom_select.html new file mode 100644 index 00000000..e9934ef1 --- /dev/null +++ b/_includes/bootstrap/custom_select.html @@ -0,0 +1,18 @@ +{% comment %} + +@param class [String] Extra classes +@param extra [String] Extra attributes +@param options [Array] Options + @param selected [Boolean] Default option + @param extra [String] Extra attributes + @param value [String] Value + @param title [String] Title +{% endcomment %} + + diff --git a/_includes/date.html b/_includes/date.html new file mode 100644 index 00000000..77180e95 --- /dev/null +++ b/_includes/date.html @@ -0,0 +1,12 @@ +{% comment %} + La fecha de un artículo + + @param :date [String] La fecha con formato + @param :extra [String] Atributos extra +{% endcomment %} + + diff --git a/_includes/external_link.html b/_includes/external_link.html new file mode 100644 index 00000000..d921f931 --- /dev/null +++ b/_includes/external_link.html @@ -0,0 +1,16 @@ +{%- comment -%} + +Link externo. + +@param :href [String] La URL +@param :class [String] Las clases del link +@param :text [String] El texto que llevará el link +{%- endcomment -%} + +
+ {{ include.text }} + diff --git a/_includes/fa.html b/_includes/fa.html new file mode 100644 index 00000000..e69de29b From ff48a6b828369201c8fa89d27394a6439b460d4d Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Wed, 27 Nov 2024 11:11:30 -0600 Subject: [PATCH 05/21] Disable non-functional interaction section in ActivityPub template --- _includes/activity_pub/interactions.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/_includes/activity_pub/interactions.html b/_includes/activity_pub/interactions.html index e6fbf8c3..5813c23f 100644 --- a/_includes/activity_pub/interactions.html +++ b/_includes/activity_pub/interactions.html @@ -23,10 +23,18 @@ {% assign all_interactions = activities | concat: reactions | sort: 'published' %}
+ +
+ +
{% unless activities == empty %} {% for activity in activities %} From 4efcc9caeb88582cfed161fc100868098e9f528e Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Wed, 27 Nov 2024 11:23:59 -0600 Subject: [PATCH 06/21] Add conditional rendering for interactions in ActivityPub template --- _includes/activity_pub/interactions.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/activity_pub/interactions.html b/_includes/activity_pub/interactions.html index 5813c23f..5d12b6e1 100644 --- a/_includes/activity_pub/interactions.html +++ b/_includes/activity_pub/interactions.html @@ -22,6 +22,7 @@ {% assign all_interactions = activities | concat: reactions | sort: 'published' %} +{% unless activities == empty %}
{% assign items = site.i18n.fediverse_interactions %} {% assign reactions = '' | split: ',' %} -{% assign activities = reactions %} +{% assign activities = '' | split: ',' %} + {% if page.activity.replies.available %} - {% assign activities = page.activity.replies.all_items | sort: 'published' %} -{% endif %} - -{% if include.activity.likes.available %} - {% assign reactions = reactions | concat: include.activity.likes.all_items %} -{% endif %} - -{% if include.activity.shares.available %} - {% assign reactions = reactions | concat: include.activity.shares.all_items %} + {% assign activities = page.activity.replies.all_items | where_exp: "item", "item.inReplyTo" | sort: 'published' %} {% endif %} + {% assign reactions = reactions | sort: 'published' %} -{% assign all_interactions = activities | concat: reactions | sort: 'published' %} + +{% assign all_interactions = activities %} + {% unless activities == empty %}
- - -
- - +
-
+ +
{% unless activities == empty %} {% for activity in activities %} - {% include activity_pub/cards.html activity=activity profile=activity.attributedTo replies=activity.replies %} +
+
+ {% include activity_pub/cards.html activity=activity profile=activity.attributedTo replies=activity.replies %} +
+
{% endfor %} {% else %} -

+

{{ site.i18n.no_interactions_yet.conversation }} -

+

{% endunless %}
-
+ +
{% unless reactions == empty %} {% include activity_pub/reactions.html reactions=reactions %} {% else %} -

+

{{ site.i18n.no_interactions_yet.reactions }} -

+

{% endunless %}
-
+ +
+

+ Replies from the Fediverse +

{% unless all_interactions == empty %} {% for interaction in all_interactions %} - {% assign minus = forloop.index0 | minus: 1 %} - {% assign previous = all_interactions[minus] %} - {% if interaction.type == 'Announce' or interaction.type == 'Like' %} - {% include activity_pub/reaction.html activity=interaction previous=previous %} - {% else %} - {% include activity_pub/cards.html activity=interaction profile=interaction.attributedTo replies=interaction.replies %} + {% if interaction.inReplyTo %} +
+ {% include activity_pub/cards.html activity=interaction profile=interaction.attributedTo replies=interaction.replies %} +
{% endif %} {% endfor %} {% else %} -

+

{{ site.i18n.no_interactions_yet.both }} -

+

{% endunless %}
-{% endunless %} \ No newline at end of file +{% endunless %} From c068b413db5879f5e3b87a77ba2f2ccdd0fa6bb0 Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Mon, 2 Dec 2024 11:19:48 -0600 Subject: [PATCH 12/21] Stles for AP replies --- _sass/_activity_pub.scss | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 _sass/_activity_pub.scss diff --git a/_sass/_activity_pub.scss b/_sass/_activity_pub.scss new file mode 100644 index 00000000..9fd73cb4 --- /dev/null +++ b/_sass/_activity_pub.scss @@ -0,0 +1,21 @@ +.h-100.object-fit-cover { + max-width: 20px; + height: auto; + object-fit: cover; + } + + + .embed-responsive { + width: 25px; + } + + .embed-responsive img { + object-fit: cover; /* Ensures the image fills the square */ + width: 100%; + height: 100%; + } + + .interaction-card .content > p { + margin-top: 0; + } + \ No newline at end of file From 302ed038a172ba8eb1b86c699b6330d36d2ef822 Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Mon, 2 Dec 2024 11:28:14 -0600 Subject: [PATCH 13/21] fix: adjust margin classes for improved layout in toot card --- _includes/activity_pub/toot_card.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/activity_pub/toot_card.html b/_includes/activity_pub/toot_card.html index 9d4968f3..749f91aa 100644 --- a/_includes/activity_pub/toot_card.html +++ b/_includes/activity_pub/toot_card.html @@ -26,7 +26,7 @@

{% include activity_pub/actor_mention.html actor=include.profile %}

-
+
{% capture content %}
{{ include.activity.content | sanitize_html }} @@ -56,7 +56,7 @@ element_text=content summary_class="align-items-center btn-lg btn-secondary p-2 text-left f-16" component_class="my-3" - font_size="ml-3 lead" + font_size="ml3 lead" %} {% else %} {{ content }} From 0ba8fb7f6e28028d7463d2ad5f99f9a9c909cc2b Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Mon, 2 Dec 2024 11:28:32 -0600 Subject: [PATCH 14/21] Add activity_pub to the main SCSS imports --- assets/css/main.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/css/main.scss b/assets/css/main.scss index 7d5dc514..ae21c49f 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -8,5 +8,6 @@ "hypha", "openings", "dripline", - "utilities" + "utilities", + "activity_pub" ; \ No newline at end of file From 3ef5e7bde5c28d4eb702d6b4b672a862ce78b28b Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Mon, 2 Dec 2024 11:28:56 -0600 Subject: [PATCH 15/21] Remove unnecessary horizontal rule and adjust styling for combined interactions --- _includes/activity_pub/interactions.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_includes/activity_pub/interactions.html b/_includes/activity_pub/interactions.html index 8948acd6..087c806e 100644 --- a/_includes/activity_pub/interactions.html +++ b/_includes/activity_pub/interactions.html @@ -21,7 +21,6 @@ {% unless activities == empty %}
-
@@ -52,8 +51,8 @@
-
-

+
+

Replies from the Fediverse

{% unless all_interactions == empty %} From 5a47f9620073da33002a36c77dc4bfa550c22978 Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Tue, 3 Dec 2024 09:48:13 -0600 Subject: [PATCH 16/21] Remove unused ActivityPub modal components --- _includes/activity_pub/button.html | 22 -------- .../activity_pub/fediverse_interactions.html | 2 - _includes/activity_pub/generic_modal.html | 48 ---------------- _includes/activity_pub/image_modal.html | 27 --------- _includes/activity_pub/login_modal.html | 56 ------------------- _includes/activity_pub/text_modal.html | 16 ------ 6 files changed, 171 deletions(-) delete mode 100644 _includes/activity_pub/button.html delete mode 100644 _includes/activity_pub/fediverse_interactions.html delete mode 100644 _includes/activity_pub/generic_modal.html delete mode 100644 _includes/activity_pub/image_modal.html delete mode 100644 _includes/activity_pub/login_modal.html delete mode 100644 _includes/activity_pub/text_modal.html diff --git a/_includes/activity_pub/button.html b/_includes/activity_pub/button.html deleted file mode 100644 index 388d678f..00000000 --- a/_includes/activity_pub/button.html +++ /dev/null @@ -1,22 +0,0 @@ -{%- comment -%} - Un botón con link, por ejemplo para Support Us. Si el link es externo, - agregar el parámetro de seguridad noopener. - - @param :fa [String] - @param :header [Capture] el contenido del encabezado - @param :body [Capture] el contenido del cuerpo principal - @param :footer [Capture] el contenido del footer - @param :header_class [String] las clases que lleva el encabezado - @param :body_class [String] las clases que lleva el cuerpo principal - @param :footer_class [String] las clases que lleva el footer - @param :content_class [String] las clases que lleva todo el bloque de contenido - @param :button_class [String] las clases que lleva cada botón -{%- endcomment -%} - -
- - - {% include activity_pub/generic_modal.html header=include.header body=include.body footer=include.footer header_class=include.header_class body_class=include.body_class footer_class=include.footer_class content_class=include.content_class %} -
diff --git a/_includes/activity_pub/fediverse_interactions.html b/_includes/activity_pub/fediverse_interactions.html deleted file mode 100644 index 5deaacb2..00000000 --- a/_includes/activity_pub/fediverse_interactions.html +++ /dev/null @@ -1,2 +0,0 @@ -{% assign extra = 'data-action="tabs#toggle" data-tabs-target="value"' %} -{% include bootstrap/custom_select.html extra=extra options=site.i18n.fediverse_interactions %} diff --git a/_includes/activity_pub/generic_modal.html b/_includes/activity_pub/generic_modal.html deleted file mode 100644 index 7eaa32b5..00000000 --- a/_includes/activity_pub/generic_modal.html +++ /dev/null @@ -1,48 +0,0 @@ -{%- comment -%} - Modal preparado para recibir contenido + header y footer - - @param :header [Capture] contenido del header - @param :body [Capture] contenido del modal - @param :footer [Capture] contenido del footer - @param :header_class [String] clases del header - @param :body_class [String] clases del cuerpo principal - @param :footer_class [String] clases del header - @param :content_class [String] clases todo el bloque -{%- endcomment -%} - -{% assign header = include.header %} -{% assign header_class = include.header_class %} -{% assign body = include.body %} -{% assign body_class = include.body_class %} -{% assign footer = include.footer %} -{% assign footer_class = include.footer_class %} -{% assign content_class = include.content_class %} - - diff --git a/_includes/activity_pub/image_modal.html b/_includes/activity_pub/image_modal.html deleted file mode 100644 index 52ed58af..00000000 --- a/_includes/activity_pub/image_modal.html +++ /dev/null @@ -1,27 +0,0 @@ -{%- comment -%} - Modal con imagen - - @param :image [Image] la imagen que queremos en el modal, contiene url y alt text -{%- endcomment -%} - -{% assign extra = 'data-action="click->modal#show"' %} -{% assign alt = include.image.name | strip_html | escape %} -{% assign src = include.image.url | strip_html | uri_escape %} - -{% capture body %} - {{ alt }} -{% endcapture %} - -
- {% - include embed_responsive.html - x=16 - y=9 - src=src - alt=alt - extra=extra - width=300 - img_class="cursor-pointer min-w-100px w-100 object-fit-cover" - %} - {% include activity_pub/generic_modal.html header_class="text-white" body=body body_class="d-flex justify-content-center" footer_class="d-none" content_class="background-transparent border-0" %} -
diff --git a/_includes/activity_pub/login_modal.html b/_includes/activity_pub/login_modal.html deleted file mode 100644 index 641f2432..00000000 --- a/_includes/activity_pub/login_modal.html +++ /dev/null @@ -1,56 +0,0 @@ -{%- comment -%} - Modal para loguearse al fediverso - - @param :action [String] acción que le usuarie quiere realizar desde el fediverso - @param :fa [String] nombre del ícono que usa fork-awesome - @param :uri [String] la URL sobre la que se interactúa - @param :profile [ActivityDrop] Actor -{%- endcomment -%} - -{% assign action = include.action %} -{% assign fa = include.fa %} -{% capture name %} - {% include activity_pub/actor.html actor=include.profile %} -{% endcapture %} - -{% capture header %} - -
- - -{{ site.i18n.login_modal[action.title].text | replace: "$usuarie", name }} -
-× -{{ site.i18n.close }} -
-
-
-{% endcapture %} - -{% capture body %} -

{{site.i18n.login_modal.top_text | markdownify | replace: "$action", site.i18n.login_modal[action.title].title }}

-
{{site.i18n.login_modal.question | markdownify}}
-
-
-
-
- - -
- {{- site.i18n.login_modal.authorize_interaction_unsupported -}} -
-
-
- -
-
-
-
-{{site.i18n.login_modal.small_text}} -{{site.i18n.login_modal.bottom_text | markdownify}} -{% endcapture %} - -{% capture footer %} -{% endcapture %} - -{% include activity_pub/button.html header=header body=body footer=footer header_class="justify-content-center border-bottom-0" body_class="justify-content-center" footer_class="border-top-0" content_class="p-2" button_class="mx-1" fa=action.icon description=include.description %} diff --git a/_includes/activity_pub/text_modal.html b/_includes/activity_pub/text_modal.html deleted file mode 100644 index 6aeca64f..00000000 --- a/_includes/activity_pub/text_modal.html +++ /dev/null @@ -1,16 +0,0 @@ -{%- comment -%} - Modal para mostrar texto - - @param :text [String] contenido del modal - @param :fa [String] nombre del ícono que usa fork-awesome -{%- endcomment -%} - -{% capture body %} -{{ include.text }} -{% endcapture %} - -{% capture footer %} -{% endcapture %} - -{% assign fa = include.fa %} -{% include activity_pub/button.html body=body footer=footer body_class="justify-content-center" footer_class="border-top-0 d-none" content_class="p-2" fa=fa %} From 023950fa2f0729a08fc79e7eb8ccb4f3abd9373c Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Tue, 3 Dec 2024 12:55:19 -0600 Subject: [PATCH 17/21] Add padding-top to activity_pub image for improved spacing --- _sass/_activity_pub.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/_sass/_activity_pub.scss b/_sass/_activity_pub.scss index 9fd73cb4..9cd478aa 100644 --- a/_sass/_activity_pub.scss +++ b/_sass/_activity_pub.scss @@ -2,6 +2,7 @@ max-width: 20px; height: auto; object-fit: cover; + padding-top: 8px; } From e5ad601de13d5614168954ed69a961e35c75ed60 Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Tue, 3 Dec 2024 12:55:43 -0600 Subject: [PATCH 18/21] Update ActivityPub actor URLs to use production domain --- _data/activity_pub.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_data/activity_pub.yml b/_data/activity_pub.yml index 445d4aa6..39394d89 100644 --- a/_data/activity_pub.yml +++ b/_data/activity_pub.yml @@ -138,6 +138,6 @@ notifications: id: https://hypha.coop/dripline/dweb-camp-recap-a-cybernetic-ecology.jsonld created_at: 1732545569 last_modified_at: 1732631737 -actor_url: https://staging.hypha.coop/about.jsonld -actor: "@dripline@staging.hypha.coop" -public_key_url: https://staging.hypha.coop/about.jsonld#main-key +actor_url: https://hypha.coop/about.jsonld +actor: "@dripline@hypha.coop" +public_key_url: https://hypha.coop/about.jsonld#main-key From 76c4e0e77b8c4a7b9d503ba13a7f5324b0e828c8 Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Tue, 3 Dec 2024 12:57:49 -0600 Subject: [PATCH 19/21] Fix conditional attributes for external links to improve security --- _includes/external_link.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_includes/external_link.html b/_includes/external_link.html index d921f931..d8b82d01 100644 --- a/_includes/external_link.html +++ b/_includes/external_link.html @@ -10,7 +10,9 @@ + {% if include.href contains 'https://' or include.href contains 'http://' %} + rel="noopener" target="_blank" + {% endif %} +> {{ include.text }} From a078865e236a39fe453491bf83b2e94f2860e9da Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Tue, 3 Dec 2024 13:37:30 -0600 Subject: [PATCH 20/21] Set fallback alt text for images in picture component --- _includes/picture.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/picture.html b/_includes/picture.html index d7040638..eeceb073 100644 --- a/_includes/picture.html +++ b/_includes/picture.html @@ -26,5 +26,5 @@ {{ include.alt | escape_once }} - + alt="{{ include.alt | default: 'Image from Mastodon' | escape_once }}" /> + From ae37cd18ca34c5f810b15fa96108bc5468716c22 Mon Sep 17 00:00:00 2001 From: tripledoublev Date: Tue, 3 Dec 2024 17:03:22 -0600 Subject: [PATCH 21/21] Add locale configuration to site settings --- _config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_config.yml b/_config.yml index 349c8bde..c7257e02 100644 --- a/_config.yml +++ b/_config.yml @@ -12,6 +12,7 @@ rss: "/feed.xml" url: "https://hypha.coop" lang: "en" footer: Hypha Worker Co-operative Inc.
Ontario Corporation No. 5019866 +locale: "en" description: >- We cultivate collective growth and meaningful livelihoods through learning and building technologies together.