"@angular/router": "~3.4.1",
"@angularclass/hmr": "^1.2.0",
"@angularclass/hmr-loader": "^3.0.2",
+ "@nglibs/meta": "^0.2.0-rc.3",
"@types/core-js": "^0.9.28",
"@types/node": "^6.0.38",
"@types/source-map": "^0.1.26",
"ng-router-loader": "^1.0.2",
"ng2-bootstrap": "1.1.16-10",
"ng2-file-upload": "^1.1.4-2",
- "ng2-meta": "https://github.com/chocobozzz/ng2-meta#build",
"ng2-smart-table": "0.5.2-1",
"ngc-webpack": "1.1.0",
"node-sass": "^4.1.1",
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { Router } from '@angular/router';
-import { MetaService } from 'ng2-meta';
-
import { AuthService } from './core';
import { UserService } from './shared';
constructor(
private router: Router,
- private metaService: MetaService,
private authService: AuthService,
private userService: UserService,
viewContainerRef: ViewContainerRef
import { BrowserModule } from '@angular/platform-browser';
import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
-import { MetaModule, MetaConfig } from 'ng2-meta';
+import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@nglibs/meta';
import 'bootstrap-loader';
import { ENV_PROVIDERS } from './environment';
import { SharedModule } from './shared';
import { VideosModule } from './videos';
-const metaConfig: MetaConfig = {
- //Append a title suffix such as a site name to all titles
- //Defaults to false
- useTitleSuffix: true,
- defaults: {
- title: 'PeerTube'
- }
-};
+export function metaFactory(): MetaLoader {
+ return new MetaStaticLoader({
+ pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
+ pageTitleSeparator: ' - ',
+ applicationName: 'PeerTube',
+ defaults: {
+ title: 'PeerTube',
+ description: 'PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser'
+ }
+ });
+}
// Application wide providers
const APP_PROVIDERS = [
AppRoutingModule,
- MetaModule.forRoot(metaConfig),
+ MetaModule.forRoot({
+ provide: MetaLoader,
+ useFactory: (metaFactory)
+ }),
AccountModule,
CoreModule,
import { Subscription } from 'rxjs/Subscription';
import * as videojs from 'video.js';
-import { MetaService } from 'ng2-meta';
+import { MetaService } from '@nglibs/meta';
import { NotificationsService } from 'angular2-notifications';
import { AuthService } from '../../core';
}
private setOpenGraphTags() {
+ this.metaService.setTitle(this.video.name);
+
this.metaService.setTag('og:type', 'video');
this.metaService.setTag('og:title', this.video.name);
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" content="PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser" />
<!-- The following comment is used by the server to prerender OpenGraph tags -->
<!-- opengraph tags -->