Use instance name for page titles
This commit is contained in:
parent
0c49373af9
commit
63ac2857aa
|
@ -1,6 +1,7 @@
|
||||||
import { NgModule } from '@angular/core'
|
import { NgModule } from '@angular/core'
|
||||||
import { BrowserModule } from '@angular/platform-browser'
|
import { BrowserModule } from '@angular/platform-browser'
|
||||||
import { AboutModule } from '@app/about'
|
import { AboutModule } from '@app/about'
|
||||||
|
import { ServerService } from '@app/core'
|
||||||
import { ResetPasswordModule } from '@app/reset-password'
|
import { ResetPasswordModule } from '@app/reset-password'
|
||||||
|
|
||||||
import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
|
import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
|
||||||
|
@ -17,15 +18,14 @@ import { SharedModule } from './shared'
|
||||||
import { SignupModule } from './signup'
|
import { SignupModule } from './signup'
|
||||||
import { VideosModule } from './videos'
|
import { VideosModule } from './videos'
|
||||||
|
|
||||||
export function metaFactory (): MetaLoader {
|
export function metaFactory (serverService: ServerService): MetaLoader {
|
||||||
return new MetaStaticLoader({
|
return new MetaStaticLoader({
|
||||||
pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
|
pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
|
||||||
pageTitleSeparator: ' - ',
|
pageTitleSeparator: ' - ',
|
||||||
applicationName: 'PeerTube',
|
get applicationName () { return serverService.getConfig().instance.name },
|
||||||
defaults: {
|
defaults: {
|
||||||
title: 'PeerTube',
|
get title () { return serverService.getConfig().instance.name },
|
||||||
description: 'PeerTube, a federated (ActivityPub) video streaming platform ' +
|
get description () { return serverService.getConfig().instance.shortDescription }
|
||||||
'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. '
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,8 @@ export function metaFactory (): MetaLoader {
|
||||||
|
|
||||||
MetaModule.forRoot({
|
MetaModule.forRoot({
|
||||||
provide: MetaLoader,
|
provide: MetaLoader,
|
||||||
useFactory: (metaFactory)
|
useFactory: (metaFactory),
|
||||||
|
deps: [ ServerService ]
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
providers: [ ]
|
providers: [ ]
|
||||||
|
|
|
@ -21,7 +21,8 @@ export class ServerService {
|
||||||
private config: ServerConfig = {
|
private config: ServerConfig = {
|
||||||
instance: {
|
instance: {
|
||||||
name: 'PeerTube',
|
name: 'PeerTube',
|
||||||
shortDescription: '',
|
shortDescription: 'PeerTube, a federated (ActivityPub) video streaming platform ' +
|
||||||
|
'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.',
|
||||||
defaultClientRoute: '',
|
defaultClientRoute: '',
|
||||||
customizations: {
|
customizations: {
|
||||||
javascript: '',
|
javascript: '',
|
||||||
|
|
Loading…
Reference in New Issue