From 3f6e01ed65eb3eae0c579066c59456b588464707 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Wed, 3 Jun 2026 10:09:38 +0200 Subject: [PATCH] feat: add embed snippet to profile settings --- crates/adapters/template-askama/src/lib.rs | 1 + .../template-askama/templates/profile_settings.html | 6 ++++++ crates/presentation/src/handlers/html.rs | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/crates/adapters/template-askama/src/lib.rs b/crates/adapters/template-askama/src/lib.rs index 8ddc215..ba35958 100644 --- a/crates/adapters/template-askama/src/lib.rs +++ b/crates/adapters/template-askama/src/lib.rs @@ -379,6 +379,7 @@ pub struct ProfileSettingsTemplate<'a> { pub also_known_as: Option<&'a str>, pub profile_fields: &'a [(String, String)], pub saved: bool, + pub embed_url: String, } #[derive(Template)] diff --git a/crates/adapters/template-askama/templates/profile_settings.html b/crates/adapters/template-askama/templates/profile_settings.html index f46e9dc..86be469 100644 --- a/crates/adapters/template-askama/templates/profile_settings.html +++ b/crates/adapters/template-askama/templates/profile_settings.html @@ -56,4 +56,10 @@ + +
+

Embed widget

+

Add your diary to your blog or website:

+
<iframe src="{{ embed_url }}" width="100%" height="600" style="border:none;border-radius:8px" loading="lazy"></iframe>
+
{% endblock %} diff --git a/crates/presentation/src/handlers/html.rs b/crates/presentation/src/handlers/html.rs index cea5b43..7d290cc 100644 --- a/crates/presentation/src/handlers/html.rs +++ b/crates/presentation/src/handlers/html.rs @@ -1251,6 +1251,11 @@ pub async fn get_profile_settings( also_known_as: also_known_as.as_deref(), profile_fields: &profile_fields, saved, + embed_url: format!( + "{}/users/{}?embed=1", + state.app_ctx.config.base_url, + user_id.value() + ), }) .into_response() }