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

Adding meta robots input texts for pages and content entries #1403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/api/locomotive/api/entities/content_entry_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ContentEntryEntity < BaseEntity

expose :_label, :_position, :_visible

expose :seo_title, :meta_keywords, :meta_description
expose :seo_title, :meta_keywords, :meta_description, :meta_robots

expose :dynamic_fields

Expand Down
2 changes: 1 addition & 1 deletion app/api/locomotive/api/entities/page_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PageEntity < BaseEntity
end

# SEO
expose :seo_title, :meta_keywords, :meta_description
expose :seo_title, :meta_keywords, :meta_description, :meta_robots

end

Expand Down
2 changes: 1 addition & 1 deletion app/api/locomotive/api/forms/content_entry_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ContentEntryForm < BaseForm

attr_accessor :content_type, :dynamic_attributes

attrs :_slug, :_position, :_visible, :seo_title, :meta_keywords, :meta_description
attrs :_slug, :_position, :_visible, :seo_title, :meta_keywords, :meta_description, :meta_robots

def initialize(content_type, attributes)
self.content_type = content_type
Expand Down
2 changes: 1 addition & 1 deletion app/api/locomotive/api/forms/page_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PageForm < BaseForm
attrs :templatized, :target_klass_slug

# SEO
attrs :seo_title, :meta_keywords, :meta_description
attrs :seo_title, :meta_keywords, :meta_description, :meta_robots

# Editable elements
attrs :editable_elements_attributes
Expand Down
2 changes: 2 additions & 0 deletions app/api/locomotive/api/resources/page_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def url_builder
optional :seo_title
optional :meta_keywords
optional :meta_description
optional :meta_robots
optional :display_settings
end
end
Expand Down Expand Up @@ -111,6 +112,7 @@ def url_builder
optional :seo_title
optional :meta_keywords
optional :meta_description
optional :meta_robots
optional :display_settings
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/locomotive/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/controllers/locomotive/page_content_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def site_params

def page_params
params.require(:page).permit(:title, :slug, :published, :listed,
:seo_title, :meta_keywords, :meta_description,
:seo_title, :meta_keywords, :meta_description, :meta_robots,
:sections_content, :sections_dropzone_content)
end

Expand Down
1 change: 1 addition & 0 deletions app/javascript/src/locomotive/editor/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function saveContent(url, site, page, locale) {
seo_title: page.seo_title,
meta_keywords: page.meta_keywords,
meta_description: page.meta_description,
meta_robots: page.meta_robots,
sections_content: JSON.stringify(page.sectionsContent),
sections_dropzone_content: JSON.stringify(page.sectionsDropzoneContent)
}
Expand Down
6 changes: 6 additions & 0 deletions app/javascript/src/locomotive/editor/views/seo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const SeoForm = ({ page, errors, updatePageSetting, moreSettingPath, ...props })
getValue={() => page.meta_description || ''}
handleChange={value => updatePageSetting('meta_description', value)}
/>

<TextInput
label={i18n.t('views.seo.meta_robots_label')}
getValue={() => page.meta_robots || ''}
handleChange={value => updatePageSetting('meta_robots', value)}
/>
</div>
</View>
)
Expand Down
1 change: 1 addition & 0 deletions app/models/locomotive/concerns/shared/seo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Seo
field :seo_title, type: String, localize: true
field :meta_keywords, type: String, localize: true
field :meta_description, type: String, localize: true
field :meta_robots, type: String, localize: true
end

end # Seo
Expand Down
3 changes: 2 additions & 1 deletion app/policies/locomotive/page_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def show?
end

def permitted_attributes
attributes = [:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url, :redirect_type, :seo_title, :meta_description, :meta_keywords]
attributes = [:title, :layout_id, :slug, :parent_id, :listed, :published, :redirect, :redirect_url,
:redirect_type, :seo_title, :meta_description, :meta_keywords, :meta_robots]
if site_admin_or_designer?
attributes += [:cache_enabled, :cache_control, :cache_vary]
attributes += [:handle]
Expand Down
2 changes: 1 addition & 1 deletion app/services/locomotive/content_entry_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def permitted_attributes
# needed to get the custom fields
_entry = content_type.entries.build

default = %w(_slug _position _visible seo_title meta_keywords meta_description)
default = %w(_slug _position _visible seo_title meta_keywords meta_description meta_robots)
dynamic = _entry.custom_fields_safe_setters
referenced = {}

Expand Down
1 change: 1 addition & 0 deletions app/views/locomotive/content_entries/form/_seo.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
= f.input :seo_title
= f.input :meta_keywords
= f.input :meta_description
= f.input :meta_robots

= render 'locomotive/content_entries/form/actions', f: f
2 changes: 1 addition & 1 deletion app/views/locomotive/page_content/edit.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ json.data do
end

json.page do
json.(@page, :id, :title, :seo_title, :meta_description, :meta_keywords, :listed, :published)
json.(@page, :id, :title, :seo_title, :meta_description, :meta_keywords, :meta_robots, :listed, :published)

json.slug @page.slug if display_slug?(@page)

Expand Down
1 change: 1 addition & 0 deletions app/views/locomotive/pages/form/_seo.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
= f.input :seo_title
= f.input :meta_keywords
= f.input :meta_description
= f.input :meta_robots

= render 'locomotive/pages/form/actions', f: f
1 change: 1 addition & 0 deletions config/locales/editor.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ en:
title_label: "SEO title"
meta_keywords_label: "META keywords"
meta_description_label: "META description"
meta_robots_label: "META robots"

settings:
title_label: "Title"
Expand Down
1 change: 1 addition & 0 deletions config/locales/editor.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ fr:
title_label: "Titre SEO"
meta_keywords_label: "Mots-clés META"
meta_description_label: "Description META"
meta_robots_label: "Robots META"

settings:
title_label: "Titre"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ca:
seo_title: "Definir un títol de la pàgina que ha de ser utilitzat com el valor de l'etiqueta del títol a la secció de capçalera. Deixiu-ho buit si vol utilitzar el valor per defecte de la configuració del lloc."
meta_keywords: "Anul·la les paraules clau del lloc usades dins de l'etiqueta de capçalera de la pàgina. Estan separades per una coma."
meta_description: "Anul·la la descripció de la web feta servir a l'etiqueta de capçalera."
meta_robots: "Afegeix les etiquetes per modificar el posicionament SEO de la pàgina. Estan separades per una coma. Ex: 'noindex,nofollow'."
is_layout: "Si és veritat, aquesta pàgina es pot utilitzar com un disseny per a altres pàgines."
allow_layout: "Permetre als autors canviar o no el disseny de la pàgina."
site:
Expand All @@ -105,6 +106,7 @@ ca:
_visible: "Per defecte, la entrada serà mostrada en el lloc web. Per tant es pot fer servir com un atribut publicat."
seo_title: "El valor que entris reemplaçarà el títol SEO de la pàgina plantilla relativa al teu model."
meta_keywords: "Anul•la les paraules clau del lloc web fetes servir dintre d'una etiqueta head de la pàgina. Són separades per comes."
meta_robots: "Afegeix les etiquetes per modificar el posicionament SEO de la pàgina. Estan separades per una coma. Ex: 'noindex,nofollow'."
meta_description: "Anul•la la meta descripció feta servir dins l'etiqueta head de la pàgina."
content_type:
public_submission_accounts: "Quan es crea una entrada, envia un correu de notificació a la llista dels comptes d'acontinuació."
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ cs:
seo_title: "Definujte název stránky, který můžete použít jako titulek. Nechte prázdné, pokud chcete použít výchozí hodnotu v nastavení webové stránky."
meta_keywords: "Přepíše meta klíčová slova používaná v rámci webových stránek. Jsou oddělena čárkou."
meta_description: "Přepíše meta popis používaný v rámci webových stránek."
meta_robots: "Přidáním značek upravíte umístění SEO stránky. Jsou odděleny čárkou. Příklad: 'noindex,nofollow'."
is_layout: "Pokud je to pravda, můžete použít rozvržení této stránky, pro jiné stránky."
allow_layout: "Autoři, pojďme změnit, nebo nechme původní rozložení této stránky."
site:
Expand All @@ -106,6 +107,7 @@ cs:
seo_title: "Hodnota, kterou zadáte nahradí název SEO titulek stránky šablony, vztahující se k modelu."
meta_keywords: "Přepíše meta klíčová slova používaná v rámci webových stránek. Jsou oddělena čárkou."
meta_description: "Přepíše meta tag popis používaný v rámci webových stránek."
meta_robots: "Přidáním značek upravíte umístění SEO stránky. Jsou odděleny čárkou. Příklad: 'noindex,nofollow'."
content_type:
public_submission_accounts: "Když je vytvořen záznam, poslat oznámení e-mailem na účty, které jsou uvedeny níže."
image_resize_form:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ de:
seo_title: "Einen Seitentitel festlegen der als Wert für den Title-Tag im Head-Bereich dient. Leer lassen um den Standardwert aus den Einstellungen zu verwenden."
meta_keywords: "Überschreibt die Standard Meta-Schlüsselwörter im Head-Tag der Seite. Durch Kommas getrennt."
meta_description: "Überschreibt die Standard Meta-Beschreibung im Head-Tag der Seite."
meta_robots: "Fügen Sie die Tags hinzu, um die SEO-Positionierung der Seite zu ändern. Sie werden durch ein Komma getrennt. Beispiel: „noindex, nofollow“."
is_layout: "Wenn eingeschaltet, kann diese Seite als Layout für andere Seiten dienen."
allow_layout: "Autoren erlauben das Layout der Seite zu verändern."
site:
Expand All @@ -106,6 +107,7 @@ de:
seo_title: "Dieser Wert ersetzt den SEO-Titel der Vorlagenseite, die diesem Modell zugewiesen ist."
meta_keywords: "Überschreibt die Standard Meta-Schlüsselwörter die im Head-Bereich der Seite genutzt werden. Durch Kommas getrennt."
meta_description: "Überschreibt die Standard Meta-Beschreibung die im Head-Bereich der Seite genutzt wird."
meta_robots: "Fügen Sie die Tags hinzu, um die SEO-Positionierung der Seite zu ändern. Sie werden durch ein Komma getrennt. Beispiel: „noindex, nofollow“."
content_type:
public_submission_accounts: "Sende eine Benachrichtigung an unten angeführte Konten, wenn ein Eintrag erstellt wird."
image_resize_form:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ el:
seo_title: "Ορίστε έναν τίτλο σελίδας που θα πρέπει να χρησιμοποιείται ως τιμή για την ετικέτα title του head. Αφήστε το κενό αν θέλετε να χρησιμοποιηθεί η προεπιλογή από τις ρυθμίσεις της τοποθεσίας."
meta_keywords: "Υπερβαίνει τα meta keywords της τοποθεσίας που χρισιμοποιεούνται στην ετικέτα head της σελίδας. Διαχωρίζονται με κώμα."
meta_description: "Υπερβαίνει το meta description της τοποθεσίας που χρησιμοποιείται στην ετικέτα head της σελίδας."
meta_robots: "Προσθέστε τις ετικέτες για να τροποποιήσετε τη θέση SEO της σελίδας. Χωρίζονται με κόμμα. Π.χ.: 'noindex,nofollow'."
is_layout: "Αν είναι true, αυτη η σελίδα μπορεί να χρησιμοποιειθεί ως πρότυπο για άλλες σελίδες."
allow_layout: "Επιτρέψτε τους authors να αλλάξουν ή όχι την διάταξη αυτής της σελίδας."
site:
Expand All @@ -106,6 +107,7 @@ el:
seo_title: "Η τιμή που θα εισάγετε θα αντικαταστήσει τον τίτλο του SEO της templatized σελίδας σχετικής με το μοντέλο σας."
meta_keywords: "Υπερβαίνει τα meta keywords της τοποθεσίας που χρισιμοποιεούνται στην ετικέτα head της σελίδας. Διαχωρίζονται με κώμα."
meta_description: "Υπερβαίνει το meta description της τοποθεσίας που χρησιμοποιείται στην ετικέτα head της σελίδας."
meta_robots: "Προσθέστε τις ετικέτες για να τροποποιήσετε τη θέση SEO της σελίδας. Χωρίζονται με κόμμα. Π.χ.: 'noindex,nofollow'."
content_type:
public_submission_accounts: "Όταν δημιουργηθεί ένα στοιχείο, να σταλεί ειδοποίηση στα email των λογαριασμών που εμφανίζονται παρακάτω."
image_resize_form:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ en:
seo_title: "Define a page title which should be used as the value for the title tag in the head section. Leave it empty if you want to use the default value from the site settings."
meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma."
meta_description: "Overrides the site's meta description used within the head tag of the page."
meta_robots: "Add the tags to modify the SEO ranking of the page. They are separated by a comma. Ex: 'noindex,nofollow'."
is_layout: "If true, this page can used as a layout for other pages."
allow_layout: "Let authors change or not the layout of that page."
site:
Expand Down Expand Up @@ -126,6 +127,7 @@ en:
seo_title: "The value you fill in will replace the SEO title of the templatized page related to your model."
meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma."
meta_description: "Overrides the site's meta description used within the head tag of the page."
meta_robots: "Add the tags to modify the SEO ranking of the page. They are separated by a comma. Ex: 'noindex,nofollow'."
content_entry_import:
col_sep: "The String placed between each field. ',' by default."
quote_char: "The character used to quote fields. '\"' by default."
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ es:
seo_title: "Define un titulo de pagina que debe ser usado como valor para una etiqueta de titulo en la seccion principal. Dejalo vacio si quieres usar el valor predetermiado de la configuracion del sitio."
meta_keywords: "Sobreescribe las meta keywords del sitio usadas como la etiqueta principal de la pagina. Estan separadas por una coma."
meta_description: "Sobreescribe la descripcion meta del sitio usada dentro de la etiqueta principal de la pagina."
meta_robots: "Añade las etiquetas para modificar el posicionamiento SEO de la pagina. Estan separadas por una coma. Ej: 'noindex,nofollow'"
is_layout: "Si es true, esta pagina puede ser usada como layout para otras paginas."
allow_layout: "Permitir a los autores cambiar o no la plantilla de la pagina."
site:
Expand All @@ -108,6 +109,7 @@ es:
seo_title: "El valor que escribas reemplazara el titulo SEO de la pagina con plantilla relacionada con tu modelo."
meta_keywords: "Sobreescribe las meta keywords del sitio usadas como la etiqueta principal de la pagina. Estan separadas por una coma."
meta_description: "Sobreescribe la descripcion meta del sitio usada dentro de la etiqueta principal de la pagina."
meta_robots: "Añade las etiquetas para modificar el posicionamiento SEO de la pagina. Estan separadas por una coma. Ej: 'noindex,nofollow'"
content_type:
public_submission_accounts: "Cuando una entrada sea creada, enviar una notificacion por email a las cuentas listadas debajo."
image_resize_form:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.fi-FI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fi-FI:
seo_title: "Define a page title which should be used as the value for the title tag in the head section. Leave it empty if you want to use the default value from the site settings."
meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma."
meta_description: "Overrides the site's meta description used within the head tag of the page."
meta_robots: "Lisää tageja muokataksesi sivun SEO-sijaintia. Ne erotetaan pilkulla. Esim: 'noindex,nofollow'."
is_layout: "If true, this page can used as a layout for other pages."
allow_layout: "Let authors change or not the layout of that page."
site:
Expand All @@ -106,6 +107,7 @@ fi-FI:
seo_title: "The value you fill in will replace the SEO title of the templatized page related to your model."
meta_keywords: "Overrides the site's meta keywords used within the head tag of the page. They are separated by a comma."
meta_description: "Overrides the site's meta description used within the head tag of the page."
meta_robots: "Lisää tageja muokataksesi sivun SEO-sijaintia. Ne erotetaan pilkulla. Esim: 'noindex,nofollow'."
content_type:
public_submission_accounts: "When an entry is created, send a notification email to the accounts listed below."
image_resize_form:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/simple_form.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ fr:
seo_title: "Ce titre sera utilisé par le tag HTML TITLE de votre page. Laissez le vide si voulez utiliser le titre défini dans les paramètres du site."
meta_keywords: "Surcharge les META KEYWORDS définis dans les paramètres du site. Ils sont séparés par des virgules."
meta_description: "Surcharge la META DESCRIPTION définie dans les paramètres du site. "
meta_robots: "Ajoutez les balises pour modifier le positionnement SEO de la page. Ils sont séparés par une virgule. Ex : 'noindex,nofollow'."
is_layout: "Si cette option est activée, la page pourra être utilisée comme gabarit pour d'autres pages."
allow_layout: "Laisse les auteurs la possibilité d'utiliser un autre gabarit pour cette page."
site:
Expand Down Expand Up @@ -113,6 +114,7 @@ fr:
seo_title: "Cette valeur sera utilisée dans le tag HTML TITLE de la page gabarit associé à ce modèle."
meta_keywords: "Surcharge les META KEYWORDS définis dans les paramètres du site. Ils sont séparés par des virgules."
meta_description: "Surcharge la META DESCRIPTION définie dans les paramètres du site. "
meta_robots: "Ajoutez les balises pour modifier le positionnement SEO de la page. Ils sont séparés par une virgule. Ex : 'noindex,nofollow'."
content_type:
public_submission_accounts: "Quand un élément est crée, un email de notification est envoyé à tous les comptes listés ci-dessous."
image_resize_form:
Expand Down
Loading