Skip to content

Commit 2b172f4

Browse files
committed
chore(docs): add explanation of how SEO is working
1 parent 1981f2f commit 2b172f4

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

Client/app/app.module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ import { ConnectionResolver } from './shared/route.resolver';
3434
},
3535
{
3636
path: 'home', component: HomeComponent,
37+
38+
// *** SEO Magic ***
39+
// We're using "data" in our Routes to pass in our <title> <meta> <link> tag information
40+
// Note: This is only happening for ROOT level Routes, you'd have to add some additional logic if you wanted this for Child level routing
41+
// When you change Routes it will automatically append these to your document for you on the Server-side
42+
// - check out app.component.ts to see how it's doing this
3743
data: {
3844
title: 'Homepage',
3945
meta: [{ name: 'description', content: 'This is an example Description Meta tag!' }],

Client/app/browser-app.module.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import { AppModule } from './app.module';
88
import { AppComponent } from './app.component';
99

1010
export function createConfig(): SignalRConfiguration {
11-
const c = new SignalRConfiguration();
12-
c.hubName = 'Ng2SignalRHub';
13-
c.qs = { user: 'donald' };
14-
c.url = 'http://ng2-signalr-backend.azurewebsites.net/';
15-
c.logging = true;
16-
return c;
11+
const signalRConfig = new SignalRConfiguration();
12+
13+
signalRConfig.hubName = 'Ng2SignalRHub';
14+
signalRConfig.qs = { user: 'donald' };
15+
signalRConfig.url = 'http://ng2-signalr-backend.azurewebsites.net/';
16+
signalRConfig.logging = true;
17+
18+
return signalRConfig;
1719
}
1820

1921
@NgModule({

Client/app/shared/link.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export class LinkService {
6363
// }
6464

6565
private _parseSelector(tag: LinkDefinition): string {
66-
const attr: string = tag.name ? 'name' : 'property';
66+
// Possibly re-work this
67+
const attr: string = tag.rel ? 'rel' : 'hreflang';
6768
return `${attr}="${tag[attr]}"`;
6869
}
6970

Client/app/shared/route.resolver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Injectable } from '@angular/core';
32
import { Resolve } from '@angular/router';
43

0 commit comments

Comments
 (0)