Skip to content
Snippets Groups Projects
Commit 46bbdc28 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

cleanup des tags meta pour structure qui marchent pas

parent 0ce86d9a
No related branches found
No related tags found
1 merge request!946Improve publication on LinkedIn
Pipeline #115702 passed
......@@ -43,6 +43,7 @@ const routes: Routes = [
},
{
path: 'acteurs',
title: buildTitle('Cartographie'),
runGuardsAndResolvers: 'always',
resolve: {
structure: StructureResolver,
......
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Meta, Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { Meta } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import * as _ from 'lodash';
import { NeedsTypes } from '../form/orientation-form-view/enums/orientation.enums';
import { GeoJson } from '../map/models/geojson.model';
......@@ -42,9 +42,7 @@ export class CartoComponent implements OnInit {
private structureService: StructureService,
private geoJsonService: GeojsonService,
private activatedRoute: ActivatedRoute,
private router: Router,
private profileService: ProfileService,
private title: Title,
private meta: Meta,
) {}
......@@ -60,17 +58,9 @@ export class CartoComponent implements OnInit {
}
}
this.activatedRoute.data.subscribe((data) => {
if (data.structure) {
this.setMetaTags(data.structure);
} else {
this.title.setTitle("Cartographie | Réseau des acteurs de l'inclusion numérique de la métropole de Lyon");
this.meta.updateTag({
name: 'description',
content:
'Recense tous les lieux, accompagnements et ateliers de médiation numérique de la Métropole de Lyon.',
});
}
this.meta.updateTag({
name: 'description',
content: 'Recense tous les lieux, accompagnements et ateliers de médiation numérique de la Métropole de Lyon.',
});
}
......@@ -219,7 +209,6 @@ export class CartoComponent implements OnInit {
public showDetailStructure(structure: Structure): void {
this.currentStructure = new Structure(structure);
this.setMetaTags(this.currentStructure);
}
public switchMapList(): void {
......@@ -238,23 +227,4 @@ export class CartoComponent implements OnInit {
public selectStructureRDV(structure: Structure): void {
this.structureSelectionRDV.emit(structure);
}
private setMetaTags(structure: Structure): void {
// Set page title
this.title.setTitle(
structure.structureName + " | Réseau des acteurs de l'inclusion numérique de la métropole de Lyon",
);
// Set meta tags (for linkedin and social networks publication)
this.meta.updateTag({ name: 'title', content: structure.structureName });
this.meta.updateTag({ property: 'og:title', content: structure.structureName });
this.meta.updateTag({ name: 'description', content: structure.description });
this.meta.updateTag({ property: 'og:description', content: structure.description });
this.meta.updateTag({ property: 'og:type', content: 'article' });
this.meta.updateTag({
property: 'og:image',
content: `${window.location.origin}/assets/logos/resin-logo-structure.png`,
});
this.meta.updateTag({ property: 'og:url', content: `${window.location.origin}${this.router.url}` });
}
}
import { animate, style, transition, trigger } from '@angular/animations';
import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { Owner } from '../../../models/owner.model';
import { Structure } from '../../../models/structure.model';
......@@ -69,7 +68,6 @@ export class StructureDetailsComponent implements OnInit {
private router: Router,
private utils: Utils,
private usersService: UserService,
private title: Title,
) {}
async ngOnInit(): Promise<void> {
......@@ -139,7 +137,6 @@ export class StructureDetailsComponent implements OnInit {
}
public close(): void {
this.title.setTitle("Cartographie | Réseau des acteurs de l'inclusion numérique de la métropole de Lyon");
this.router.navigate([], {
queryParams: {
structure: null,
......
src/assets/logos/resin-logo-structure.png

15 KiB

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