Skip to content
Snippets Groups Projects
Unverified Commit 0f404171 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

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


* added in core

* fix

* fix

* fix

* fix

* Fix #2644

* Update app/views/admin/application/static/_core.html.erb

Co-authored-by: default avatarSébastien Gaya <sebastien.gaya@gmail.com>

---------

Co-authored-by: default avatarSébastien Gaya <sebastien.gaya@gmail.com>
parent 718d1bb5
No related branches found
Tags v2.2.2
No related merge requests found
<%
# Partial arguments
# Partial arguments
forced_title ||= nil
skip_date ||= false
# Preparing variables
......@@ -73,4 +73,28 @@ meta:
updated_at: <%= about.updated_at&.iso8601 %>
<% if show_published_at %>
published_at: <%= about.published_at&.iso8601 %>
<% end %>
\ No newline at end of file
<% 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 %>"
<% if about.respond_to?(:language) && about.language.present? %>
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 %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment