]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Use instance name for page titles
authorChocobozzz <me@florianbigard.com>
Thu, 22 Mar 2018 13:13:30 +0000 (14:13 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 22 Mar 2018 13:14:31 +0000 (14:14 +0100)
client/src/app/app.module.ts
client/src/app/core/server/server.service.ts

index cae99786b32911c9d7f67700a72793709f03b50e..77d68a4ec1ad5a236b16d684a2b2f56b00aade64 100644 (file)
@@ -1,6 +1,7 @@
 import { NgModule } from '@angular/core'
 import { BrowserModule } from '@angular/platform-browser'
 import { AboutModule } from '@app/about'
+import { ServerService } from '@app/core'
 import { ResetPasswordModule } from '@app/reset-password'
 
 import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
@@ -17,15 +18,14 @@ import { SharedModule } from './shared'
 import { SignupModule } from './signup'
 import { VideosModule } from './videos'
 
-export function metaFactory (): MetaLoader {
+export function metaFactory (serverService: ServerService): MetaLoader {
   return new MetaStaticLoader({
     pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
     pageTitleSeparator: ' - ',
-    applicationName: 'PeerTube',
+    get applicationName () { return serverService.getConfig().instance.name },
     defaults: {
-      title: 'PeerTube',
-      description: 'PeerTube, a federated (ActivityPub) video streaming platform  ' +
-                   'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. '
+      get title () { return serverService.getConfig().instance.name },
+      get description () { return serverService.getConfig().instance.shortDescription }
     }
   })
 }
@@ -57,7 +57,8 @@ export function metaFactory (): MetaLoader {
 
     MetaModule.forRoot({
       provide: MetaLoader,
-      useFactory: (metaFactory)
+      useFactory: (metaFactory),
+      deps: [ ServerService ]
     })
   ],
   providers: [ ]
index bd85d9f0f109c2dc278d16ad9735d22fd206de37..0b63ef5be2fd47e2ce3d978fb46c9c5f8b3467e1 100644 (file)
@@ -21,7 +21,8 @@ export class ServerService {
   private config: ServerConfig = {
     instance: {
       name: 'PeerTube',
-      shortDescription: '',
+      shortDescription: 'PeerTube, a federated (ActivityPub) video streaming platform  ' +
+                        'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.',
       defaultClientRoute: '',
       customizations: {
         javascript: '',