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

changing titles, meta, etc. Adding Descriptions blocks on news list and datasets page

parent 047a8eda
......@@ -7,6 +7,7 @@ import { environment } from '../environments/environment';
import { NavigationHistoryService } from './core/services';
import { AppRoutes } from './routes';
import { SeoSErvice } from './editorialisation/services';
import { pageTitles } from '../i18n/traductions';
@Component({
selector: 'app-root',
......@@ -32,6 +33,7 @@ export class AppComponent implements OnInit {
this._navigationHistoryService.add(e['urlAfterRedirects']);
});
// Change the title using the title property passed in the data of each route
this._router.events.pipe(
filter(event => event instanceof NavigationEnd),
......
<div class="page-header-container">
<app-page-header [pageInfo]="pageHeaderInfo"></app-page-header>
<p *ngIf="intro">{{ intro }}</p>
</div>
<div class="main-content">
<div class="filter-button-touch column is-hidden-desktop"
(click)="toggleFilters()">
......
......@@ -14,6 +14,20 @@ $sticky-distance: $header-bar-height + 32px;
}
}
.page-header-container {
background-color: white;
padding: 0 1.25rem 0 1.25rem;
margin:2rem;
margin-bottom: 0rem;
border-radius: 8px;
box-shadow: 0px 6px 12px rgb(129 128 128 / 10%);
p {
padding-bottom:2em;
}
}
@media (max-width: $tablet) {
.header-dataset {
flex-direction: column-reverse;
......
......@@ -3,13 +3,13 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { Meta } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { metaDescription, introText, notificationMessages } from '../../../../i18n/traductions';
import { metaDescription, introText, notificationMessages, pageTitles } from '../../../../i18n/traductions';
import { Notification } from '../../../core/models';
import { NotificationService } from '../../../core/services';
import { CMSContent } from '../../../editorialisation/models';
import { IScope } from '../../../elasticsearch/models';
import { AppRoutes } from '../../../routes';
import { Dataset, IMetadataLink, PaginatorOptions } from '../../../shared/models';
import { Dataset, IMetadataLink, IPageHeaderInfo, PaginatorOptions } from '../../../shared/models';
import { SearchSuggestion } from '../../models';
import { DatasetResearchService, ResearchUrlService } from '../../services';
......@@ -24,6 +24,11 @@ export class ResultsComponent implements OnInit, OnDestroy {
results: Dataset[] | CMSContent[];
pageHeaderInfo: IPageHeaderInfo = {
title: pageTitles.datasets
};
intro: string = introText.research;
countResults: [];
hasParams: boolean = false;
searchChangeSub: Subscription;
......@@ -47,6 +52,8 @@ export class ResultsComponent implements OnInit, OnDestroy {
ngOnInit() {
console.log(`Titre vaut : ${ pageTitles.datasets }.`);
console.log(pageTitles);
// Set the title and description for the research page
this._meta.updateTag({ name: 'description', content: metaDescription.research });
......
import { Injectable } from '@angular/core';
import { Meta, Title } from '@angular/platform-browser';
import { environment } from '../../../environments/environment';
import { pageTitles } from '../../../i18n/traductions';
import { AppRoutes } from '../../routes';
import { Metadata } from '../../shared/models';
import { CMSContent, Reuse } from '../models';
......@@ -30,6 +31,7 @@ export class SeoSErvice {
const imageUrl = (post.content.og_image != null) ?
post.content.og_image : post.content.featureImage;
const meta = [
{ name: 'description', content: post.content.excerpt },
{ property: 'og:title', content: post.content.og_title },
......
......@@ -185,8 +185,8 @@ export const AppRoutes = {
datasets: {
uri: 'jeux-de-donnees',
title: {
fr: 'Jeux de données',
en: 'Datasets',
fr: 'Jeux de données de la plateforme data de la Métropole de Lyon',
en: 'Datasets from the Lyon Metropolis data platform',
},
},
info: {
......
......@@ -259,6 +259,7 @@ export const subjects = [
export const pageTitles = {
siteMap: 'Plan du site',
datasets: 'Jeux de données de la plateforme data de la Métropole de Lyon',
credits: 'Crédits',
partners: 'Partenaires',
changelog: 'Dernières évolutions',
......@@ -276,7 +277,7 @@ export const pageTitles = {
userPasswordUpdate: 'Modifier mon mot de passe',
contribution: 'Publier un jeu de données',
reuses: 'Réutilisations',
news: 'Actualités',
news: 'Actualités de la plateforme data de la Métropole de Lyon',
};
export const datatsetDataRepresentationType = {
......
......@@ -261,9 +261,10 @@ export const subjects = [
export const pageTitles = {
siteMap: 'Site map',
datasets: 'Datasets from the Lyon Metropolis data platform',
credits: 'Credits',
partners: 'Partners',
news: 'News',
news: 'News from the Lyon Metropolis data platform',
changelog: 'Last changes',
actors: 'Actors',
signup: 'Sign up',
......
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