Commit c1cc63c2 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

SEO translations and calls changes.

parent f3c57a9a
......@@ -50,13 +50,13 @@ export class AppComponent implements OnInit {
}
return titles;
}),
).subscribe((titles) => {
).subscribe((titles): void => {
if (titles.length > 1) {
const title = titles.join(' - ');
this._seoSErvice.setRoutingTitle(title);
this._seoSErvice.setRoutingSEO(title);
}
else {
this._seoSErvice.setRoutingTitle('');
this._seoSErvice.setRoutingSEO('');
}
});
......
......@@ -2,11 +2,12 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { AppRoutes } from '../../../routes';
import { CMSContent } from '../../models/cms-content.model';
import { IPageHeaderInfo } from '../../../shared/models';
import { pageTitles, introText } from '../../../../i18n/traductions';
import { pageTitles, introText, metaDescription } from '../../../../i18n/traductions';
import { PaginatorOptions } from '../../../shared/models';
import { ElasticsearchService } from '../../../elasticsearch/services/elasticsearch.service';
import { DatasetResearchService } from '../../../datasets/services';
import { scopesResearch } from '../../../shared/variables';
import { Meta } from '@angular/platform-browser';
@Component({
selector: 'app-cms-posts-list',
......@@ -33,9 +34,12 @@ export class CMSPostsListComponent implements OnInit, OnDestroy {
constructor(
private _elasticsearchService: ElasticsearchService,
private _datasetResearchService: DatasetResearchService,
private _meta: Meta,
) { }
ngOnInit() {
this._meta.updateTag({ name: 'description', content: metaDescription.news });
this._datasetResearchService.resetResearch();
this._datasetResearchService.scopeReasearch = scopesResearch.post;
const countResults = [];
......
......@@ -42,9 +42,6 @@ export class HomeComponent implements OnInit {
) { }
ngOnInit() {
// Set the title and description for the home page
this._meta.updateTag({ name: 'description', content: metaDescription.home });
this._datasetResearchService.resetResearch(false);
this.latestPosts = [];
......
import { Injectable } from '@angular/core';
import { Meta, Title } from '@angular/platform-browser';
import { environment } from '../../../environments/environment';
import { pageTitles } from '../../../i18n/traductions';
import { metaDescription, pageTitles } from '../../../i18n/traductions';
import { AppRoutes } from '../../routes';
import { Metadata } from '../../shared/models';
import { CMSContent, Reuse } from '../models';
......@@ -16,13 +16,13 @@ export class SeoSErvice {
private _defaultTitle: string;
constructor(
private _titleService: Title,
private _metaService: Meta,
private _titleService: Title,
private _metaService: Meta
) {
this._lang = window.location.href.includes(environment.angularAppHost.en) ? 'en' : 'fr';
this._defaultImg = this._metaService.getTag("property='og:image'").content;
this._defaultDesc = this._metaService.getTag("name='description'").content;
this._defaultDesc = metaDescription.home;
this._defaultTitle = this._titleService.getTitle();
}
......@@ -50,10 +50,12 @@ export class SeoSErvice {
const imageUrl = (data.image != null) ?
data.image.url : this._defaultImg;
const description = metaDescription.dataset;
const meta = [
{ name: 'description', content: data.abstractTroncated },
{ name: 'description', content: description },
{ property: 'og:title', content: data.title },
{ property: 'og:description', content: data.abstractTroncated },
{ property: 'og:description', content: description},
{ property: 'og:image', content: imageUrl },
];
......@@ -61,10 +63,10 @@ export class SeoSErvice {
this._setTitle(data.title);
}
setRoutingTitle(title:string)
setRoutingSEO(title:string)
{
if (title=='') {
title=this._defaultTitle;
title=pageTitles.home;
}
const meta = [
......
......@@ -186,7 +186,7 @@ export const AppRoutes = {
uri: 'jeux-de-donnees',
title: {
fr: 'Jeux de données de la plateforme data de la Métropole de Lyon',
en: 'Datasets from the Lyon Metropolis data platform',
en: 'Data sets from the Metropole de Lyon data platform',
},
},
info: {
......@@ -241,8 +241,8 @@ export const AppRoutes = {
news: {
uri: 'actualites',
title: {
fr: 'L’actualité de la plateforme open-data de la Métropole de Lyon',
en: 'News from the Métropole de Lyon data platform'
fr: 'Actualités de la plateforme data de la Métropole de Lyon',
en: 'News from the Metropole de Lyon data platform'
}
},
reusesDetail: {
......
......@@ -217,9 +217,12 @@ export const geosource = {
},
};
export const metaDescription = {
home: "La plateforme des données des acteurs du territoire de la Métropole de Lyon. Elle permet la recherche et l'utilisation des données ouvertes (open data).",
research: 'La plateforme data.grandlyon.com offre un accès à plusieurs centaines de jeux de données. Ils peuvent être recherchés par mots-clés, par filtres, et triés suivant différents critères.',
dataset: "Des métadonnées décrivent la donnée : contexte et origine, producteur, thématique, statistiques, conditions d'accès (API).",
news: 'La Métropole de Lyon vous informe en continu sur les données ouvertes (open data) sur le territoire et les services offerts par la plateforme data du Grand Lyon',
};
export const introText = {
research: "La plateforme data.grandlyon.com offre un accès à plusieurs centaines de jeux de données. Recherchez-les grâce à la recherche par mot-clé et par filtres : partenaire producteur de la donnée, thématique (environnement, transport…), format… Et explorez-les en accédant à leur page détaillée : cartographie, tableau textuel des données, description, lien de téléchargement et accès par API.",
......@@ -258,8 +261,9 @@ export const subjects = [
];
export const pageTitles = {
home: 'data.granlyon.com : Open data de la Métropole de Lyon',
siteMap: 'Plan du site',
datasets: 'Jeux de données de la plateforme data de la Métropole de Lyon',
datasets: 'Jeux de données',
credits: 'Crédits',
partners: 'Partenaires',
changelog: 'Dernières évolutions',
......@@ -277,7 +281,7 @@ export const pageTitles = {
userPasswordUpdate: 'Modifier mon mot de passe',
contribution: 'Publier un jeu de données',
reuses: 'Réutilisations',
news: 'Actualités de la plateforme data de la Métropole de Lyon',
news: 'Actualités',
};
export const datatsetDataRepresentationType = {
......
......@@ -219,13 +219,16 @@ export const geosource = {
},
};
export const metaDescription = {
home: 'The data platform for stakeholders in the Lyon Metropolitan Area. It allows the research and use of open data.',
home: 'The data platform of the partners of the Metropole de Lyon territory. It allows the search and use of open data.',
research: 'The data.grandlyon.com platform offers access to several hundred datasets. They can be searched by keywords, by filters, and sorted according to different criteria.',
dataset: 'Metadata describe the data: context and origin, producer, subject, statistics, access conditions (API).',
news: 'The Metropole de Lyon informs you continuously about the open data on the territory and the services offered by the Greater Lyon data platform',
};
export const introText = {
research: "The data.grandlyon.com platform offers access to several hundred datasets. Search them using the keyword and filter search: partner producing the data, thematic (environment, transport, etc.), format, etc. And explore them by accessing their detailed page: mapping, textual table of data, description , download link and API access.",
news: "The Métropole de Lyon informs you of the latest news from its data platform: opening of new datasets available for the territory, examples of use, thematic files related to the published datasets, focus on the data partners of the Greater Lyon, events, new platform features ..."
research: "The data.grandlyon.com platform offers access to several hundred data sets. Search for them using keywords and filters: data producing partner, theme (environment, transport, etc.), format, etc. And explore them by accessing their detailed page: cartography, textual table of data, description, download link and API access.",
news: "The Metropole de Lyon informs you about the latest news of its data platform: opening of new datasets available for the territory, examples of use, thematic files related to the published datasets, focus on the data partners of Greater Lyon, events, new features of the platform..."
};
export const subjects = [
......@@ -260,11 +263,12 @@ export const subjects = [
];
export const pageTitles = {
home: 'data.granlyon.com : Open data of the Metropole de Lyon',
siteMap: 'Site map',
datasets: 'Datasets from the Lyon Metropolis data platform',
datasets: 'Data sets',
credits: 'Credits',
partners: 'Partners',
news: 'News from the Lyon Metropolis data platform',
news: 'News',
changelog: 'Last changes',
actors: 'Actors',
signup: 'Sign up',
......
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>data.grandlyon.com : plateforme open data de la métropole de Lyon</title>
<title>data.grandlyon.com : Open data de la Métropole de Lyon</title>
<meta name="description" content="Basé entièrement sur des briques logicielles Open Source, ce portail vous invite à découvrir les données des acteurs du territoire de la Métropole de Lyon">
<base href="/">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment