From e0e647b3a1dc4a945db1d4ea61b7946f267198dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Fri, 7 Jan 2022 17:51:02 +0100 Subject: [PATCH] fix --- app/models/communication/website.rb | 14 +++++++------- .../communication/website/pages/static.html.erb | 6 +++--- .../communication/website/posts/static.html.erb | 2 +- app/views/admin/education/programs/static.html.erb | 4 ++-- .../research/journal/articles/static.html.erb | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index b7a4d67ae..a8a6d12ca 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -46,15 +46,15 @@ class Communication::Website < ApplicationRecord end def git_dependencies_static - dependencies = [ - pages, pages.map(&:explicit_active_storage_blobs).flatten, - posts, posts.map(&:explicit_active_storage_blobs).flatten, - home, home.explicit_active_storage_blobs, - categories, menus, people, about - ] + dependencies = ( + pages + pages.map(&:active_storage_blobs).flatten + + posts + posts.map(&:active_storage_blobs).flatten + + [home] + home.explicit_active_storage_blobs + + categories + menus + people + [about] + ) if about.is_a? Education::School - dependencies << about.programs + dependencies += about.programs elsif about.is_a? Research::Journal dependencies.concat [about.articles, about.volumes] end diff --git a/app/views/admin/communication/website/pages/static.html.erb b/app/views/admin/communication/website/pages/static.html.erb index 58b3a4a9d..f228a2707 100644 --- a/app/views/admin/communication/website/pages/static.html.erb +++ b/app/views/admin/communication/website/pages/static.html.erb @@ -1,14 +1,14 @@ --- title: > <%= @page.title %> -url: "<%= @page.path %>" +url: "<%= @page.path %>/" position: <%= @page.position %> <% if @page.best_featured_image.attached? %> image: "<%= @page.best_featured_image.blob.id %>" image_alt: "<%= @page.featured_image_alt %>" <% end %> -<% if @page.category %> -category: "<%= @page.category.path %>" +<% if @page.related_category %> +category: "<%= @page.related_category.path %>/" <% end %> description: > <%= prepare_for_github @page.description, @page.university %> diff --git a/app/views/admin/communication/website/posts/static.html.erb b/app/views/admin/communication/website/posts/static.html.erb index 6197565f2..7e1e11984 100644 --- a/app/views/admin/communication/website/posts/static.html.erb +++ b/app/views/admin/communication/website/posts/static.html.erb @@ -12,7 +12,7 @@ authors: <% if @post.categories.any? %> categories: <% @post.categories.each do |category| %> - - "<%= category.path %>" + - "<%= category.path %>/" <% end %> <% end %> <% if @post.featured_image.attached? %> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index e9396b25a..0874d252f 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -1,7 +1,7 @@ --- title: > <%= @program.name %> -url: /<%= @website.programs_github_directory %><%= @program.path %> +url: /<%= @website.programs_github_directory %><%= @program.path %>/ description: > <%= prepare_for_github @program.description, @program.university %> position: <%= @program.position %> @@ -9,7 +9,7 @@ position: <%= @program.position %> image: "<%= @program.best_featured_image.blob.id %>" image_alt: "<%= @program.featured_image_alt %>" <% end %> -category: "<%= @website.categories.find_by(program_id: @program.id)&.path %>" +category: "<%= @website.categories.find_by(program_id: @program.id)&.path %>/" teachers: <% @program.teachers.includes(:person).ordered.each do |teacher| %> - person: "<%= teacher.person.slug %>" diff --git a/app/views/admin/research/journal/articles/static.html.erb b/app/views/admin/research/journal/articles/static.html.erb index b7c544705..a096e62f3 100644 --- a/app/views/admin/research/journal/articles/static.html.erb +++ b/app/views/admin/research/journal/articles/static.html.erb @@ -3,7 +3,7 @@ title: "<%= @article.title %>" description: "<%= @article.abstract %>" volume: "<%= @article.volume.id %>" publication: "<%= @article.published_at %>" -pdf: "<%= @article.pdf_path %>" +pdf: "<%= @article.pdf_path %>/" keywords: "<%= @article.keywords %>" researchers: <% @article.researchers.each do |researcher| %> -- GitLab