forked from nestjs/docs.nestjs.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
312fb9c
commit 44f25c8
Showing
111 changed files
with
3,154 additions
and
377 deletions.
There are no files selected for viewing
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,15 @@ | ||
RewriteEngine On | ||
RewriteBase / | ||
|
||
#if the request is not secure | ||
RewriteCond %{HTTPS} off | ||
#redirect to the secure version | ||
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] | ||
|
||
#These are your existing rules | ||
RewriteCond %{REQUEST_FILENAME} -s [OR] | ||
RewriteCond %{REQUEST_FILENAME} -l [OR] | ||
RewriteCond %{REQUEST_FILENAME} -d | ||
RewriteRule ^.*$ - [NC,L] | ||
|
||
RewriteRule ^(.*) /index.html [NC,L] |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||
import { Router, NavigationEnd } from '@angular/router'; | ||
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; | ||
import { Title } from '@angular/platform-browser'; | ||
|
||
import { TITLE_SUFFIX, HOMEPAGE_TITLE } from './constants'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class AppComponent implements OnInit { | ||
constructor(private readonly router: Router) { } | ||
constructor( | ||
private readonly titleService: Title, | ||
private readonly router: Router, | ||
private readonly activatedRoute: ActivatedRoute) {} | ||
|
||
ngOnInit() { | ||
this.router.events | ||
.filter((ev) => ev instanceof NavigationEnd) | ||
.subscribe(() => window.scroll(0, 0)); | ||
.subscribe((ev) => { | ||
window.scroll(0, 0); | ||
this.updateTitle(); | ||
}); | ||
} | ||
|
||
updateTitle() { | ||
const route = this.activatedRoute.snapshot.firstChild; | ||
if (!route) { | ||
return undefined; | ||
} | ||
const childRoute = route.firstChild; | ||
const { data: { title } } = childRoute; | ||
const pageTitle = title ? title : HOMEPAGE_TITLE; | ||
|
||
this.titleService.setTitle(pageTitle + TITLE_SUFFIX); | ||
} | ||
} |
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,2 @@ | ||
export const HOMEPAGE_TITLE = 'Documentation'; | ||
export const TITLE_SUFFIX = ' | Nest - A progressive Node.js web framework'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.