-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip seo upgrade, need fixing sitemap.xml * fix loading lib http on server side * fix loading seo sub class * fix all
- Loading branch information
Showing
64 changed files
with
428 additions
and
455 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import {Component, OnInit} from "@angular/core"; | ||
import {Title} from "@angular/platform-browser"; | ||
|
||
@Component({ template: ''}) | ||
export abstract class PacifistaPage implements OnInit { | ||
|
||
protected title: string = ''; | ||
protected canonicalPath: string = ''; | ||
protected pageDescription: string = "Bienvenue sur Pacifista, le serveur Minecraft français survie créatif en 1.19 ! Rejoignez une communauté bienveillante, profitez d'un staff attentif et découvrez nos plugins faits maison."; | ||
protected pageImage: string = 'https://pacifista.fr/assets/img/pacifista-logo.webp'; | ||
|
||
/** | ||
* seo | ||
* @param titleService the titleServiceManager | ||
* @param doc Inject(DOCUMENT) private doc: Document | ||
*/ | ||
constructor(protected titleService: Title, | ||
private doc: Document) { | ||
} | ||
|
||
ngOnInit(): void { | ||
this.updateTitle(); | ||
this.updateCanonicalPath(); | ||
this.updateMetaTags(); | ||
this.onPageInit(); | ||
} | ||
|
||
protected onPageInit() { | ||
} | ||
|
||
private updateTitle(): void { | ||
const prefix = this.title.length > 0 ? this.title + ' - ' : ''; | ||
this.titleService.setTitle(prefix + 'Pacifista Minecraft - Serveur Minecraft Survie Creatif Français en 1.19'); | ||
} | ||
|
||
private updateCanonicalPath(): void { | ||
const canonical = this.doc.createElement('link'); | ||
canonical.setAttribute('rel', 'canonical'); | ||
canonical.setAttribute('href', 'https://pacifista.fr/' + this.canonicalPath); | ||
this.doc.head.appendChild(canonical); | ||
} | ||
|
||
private updateMetaTags(): void { | ||
this.setMetaTag('description', this.pageDescription) | ||
|
||
this.setMetaTag('og:title', this.titleService.getTitle()); | ||
this.setMetaTag('og:description', this.pageDescription); | ||
this.setMetaTag('og:image', this.pageImage); | ||
this.setMetaTag('og:url', 'https://pacifista.fr/' + this.canonicalPath); | ||
|
||
this.setMetaTag('twitter:title', this.titleService.getTitle()); | ||
this.setMetaTag('twitter:description', this.pageDescription); | ||
this.setMetaTag('twitter:image', this.pageImage); | ||
this.setMetaTag('twitter:url', 'https://pacifista.fr/' + this.canonicalPath); | ||
} | ||
|
||
private setMetaTag(name: string, content: string): void { | ||
const meta = this.doc.createElement('meta'); | ||
meta.setAttribute('name', name); | ||
meta.setAttribute('property', name); | ||
meta.setAttribute('content', content); | ||
this.doc.head.appendChild(meta); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import {Component} from '@angular/core'; | ||
import {Component, Inject} from '@angular/core'; | ||
import {Title} from "@angular/platform-browser"; | ||
import {PacifistaPage} from "../../components/pacifista-page/pacifista-page"; | ||
import {DOCUMENT} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'app-accueil', | ||
templateUrl: './accueil.component.html', | ||
styleUrls: ['./accueil.component.scss'] | ||
}) | ||
export class AccueilComponent { | ||
export class AccueilComponent extends PacifistaPage { | ||
|
||
constructor(title: Title, | ||
@Inject(DOCUMENT) doc: Document) { | ||
super(title, doc); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, Inject} from '@angular/core'; | ||
import {Title} from "@angular/platform-browser"; | ||
import {PacifistaPage} from "../../components/pacifista-page/pacifista-page"; | ||
import {DOCUMENT} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'app-join', | ||
templateUrl: './join.component.html', | ||
styleUrls: ['./join.component.scss'] | ||
}) | ||
export class JoinComponent { | ||
export class JoinComponent extends PacifistaPage { | ||
|
||
constructor(private titleService: Title) { | ||
const title: string = titleService.getTitle(); | ||
protected override readonly title: string = 'Se connecter' | ||
protected override readonly canonicalPath: string = 'join' | ||
protected override readonly pageDescription: string = 'Découvrez comment rejoindre Pacifista en 1.19 : votre guide pour jouer sur notre serveur Minecraft survie, créatif français !'; | ||
|
||
if (!title.startsWith("Nous rejoindre")) { | ||
titleService.setTitle('Nous rejoindre - ' + title); | ||
} | ||
constructor(title: Title, | ||
@Inject(DOCUMENT) doc: Document) { | ||
super(title, doc); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, Inject} from '@angular/core'; | ||
import {Title} from "@angular/platform-browser"; | ||
import {PacifistaPage} from "../../../components/pacifista-page/pacifista-page"; | ||
import {DOCUMENT} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'app-cgu', | ||
templateUrl: './cgu.component.html', | ||
styleUrls: ['./cgu.component.scss'] | ||
}) | ||
export class CguComponent { | ||
export class CguComponent extends PacifistaPage { | ||
|
||
constructor(private titleService: Title) { | ||
const title: string = titleService.getTitle(); | ||
protected override readonly title: string = "CGU"; | ||
protected override readonly canonicalPath: string = "cgu"; | ||
protected override readonly pageDescription: string = "Conditions générales d'utilisation de Pacifista."; | ||
|
||
if (!title.startsWith("CGU")) { | ||
titleService.setTitle('CGU - ' + title); | ||
} | ||
constructor(title: Title, | ||
@Inject(DOCUMENT) doc: Document) { | ||
super(title, doc); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import {Component} from '@angular/core'; | ||
import {Component, Inject} from '@angular/core'; | ||
import {Title} from "@angular/platform-browser"; | ||
import {PacifistaPage} from "../../../components/pacifista-page/pacifista-page"; | ||
import {DOCUMENT} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'app-cgv', | ||
templateUrl: './cgv.component.html', | ||
styleUrls: ['./cgv.component.scss'] | ||
}) | ||
export class CgvComponent { | ||
export class CgvComponent extends PacifistaPage { | ||
|
||
constructor(private titleService: Title) { | ||
const title: string = titleService.getTitle(); | ||
protected override readonly title: string = 'CGV'; | ||
protected override readonly canonicalPath: string = 'cgv'; | ||
protected override readonly pageDescription: string = 'Conditions générales de vente de Pacifista.'; | ||
|
||
if (!title.startsWith("CGV")) { | ||
titleService.setTitle('CGV - ' + title); | ||
} | ||
constructor(title: Title, | ||
@Inject(DOCUMENT) doc: Document) { | ||
super(title, doc); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.