From 49e299d497bce12724d1e79ab5f2d1f5c3ffab26 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Tue, 10 Jan 2023 18:06:46 +0100
Subject: [PATCH] fix

---
 app/models/education/program.rb                                 | 2 +-
 .../communication/blocks/templates/programs/_static.html.erb    | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/models/education/program.rb b/app/models/education/program.rb
index 6340df323..6e139cc7d 100644
--- a/app/models/education/program.rb
+++ b/app/models/education/program.rb
@@ -134,7 +134,7 @@ class Education::Program < ApplicationRecord
   end
 
   def git_path(website)
-    "#{git_path_content_prefix(website)}programs/#{path}/_index.html" if for_website?(website)
+    Static.clean_path("#{git_path_content_prefix(website)}programs/#{path}/_index.html") if for_website?(website)
   end
 
   def path_in_website(website)
diff --git a/app/views/admin/communication/blocks/templates/programs/_static.html.erb b/app/views/admin/communication/blocks/templates/programs/_static.html.erb
index b64fcdec1..aa7ff4d5b 100644
--- a/app/views/admin/communication/blocks/templates/programs/_static.html.erb
+++ b/app/views/admin/communication/blocks/templates/programs/_static.html.erb
@@ -4,4 +4,5 @@
         - slug: "<%= element.program.slug %>"
           path: "<%= element.program.path %>"
           git_path: "<%= element.program.git_path(@website) %>"
+          path_in_website: "<%= element.program.path_in_website(@website) %>"
 <% end %>
-- 
GitLab