Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Données statiques pour les moteurs de recherche externes #2600

Merged
merged 14 commits into from
Feb 13, 2025
28 changes: 26 additions & 2 deletions app/views/admin/application/static/_core.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
# Partial arguments
# Partial arguments
forced_title ||= nil
skip_date ||= false
# Preparing variables
Expand Down Expand Up @@ -73,4 +73,28 @@ meta:
updated_at: <%= about.updated_at&.iso8601 %>
<% if show_published_at %>
published_at: <%= about.published_at&.iso8601 %>
<% end %>
<% end %>
<%
#############
# Search engine data
#############
search_title = title
search_title += " #{about.subtitle}" if show_subtitle && about.subtitle.present?
%>
search:
id: "<%= about.id %>"
url: "<%= hugo.permalink %>"
kind: "<%= about.class.model_name %>"
arnaudlevy marked this conversation as resolved.
Show resolved Hide resolved
<% if about.respond_to?(:language) %>
lang: "<%= about.language.iso_code %>"
<% end %>
title: >-
<%= prepare_text_for_static search_title %>
<% if about.respond_to?(:summary) %>
summary: >-
<%= prepare_html_for_static about.summary %>
<% end %>
<% if about.respond_to?(:contents_full_text) %>
body: >-
<%= prepare_text_for_static about.contents_full_text %>
<% end %>
Loading