diff --git a/angular.json b/angular.json index a392419..5265dab 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,9 @@ "tsConfig": "src/tsconfig.app.json", "polyfills": "src/polyfills.ts", "assets": [ - "src/assets" + "src/assets", + "src/robots.txt", + "src/sitemap.xml" ], "styles": [ "src/styles.css", @@ -49,6 +51,10 @@ { "replace": "src/index.html", "with": "src/index.prod.html" + }, + { + "replace": "src/robots.txt", + "with": "src/robots.prod.txt" } ] }, @@ -112,7 +118,8 @@ ], "assets": [ "src/assets", - "src/robots.txt" + "src/robots.txt", + "src/sitemap.xml" ] } }, diff --git a/src/app/about/about.component.html b/src/app/about/about.component.html index 74a7e98..de93e79 100644 --- a/src/app/about/about.component.html +++ b/src/app/about/about.component.html @@ -1,4 +1,8 @@
+ +

About

diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts index c9ed7bd..e7b2b6e 100644 --- a/src/app/about/about.component.ts +++ b/src/app/about/about.component.ts @@ -1,7 +1,12 @@ -import {AfterViewChecked, Component, OnInit} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {faqs} from './faqs'; -import {ActivatedRoute} from '@angular/router'; -import {Title} from '@angular/platform-browser'; +import {ActivatedRoute, Router} from '@angular/router'; +import {Meta, Title} from '@angular/platform-browser'; +import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; +import {properties} from '../../environments/environment'; +import {Subscription} from 'rxjs'; +import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; +import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; @Component({ selector: 'about', @@ -10,18 +15,33 @@ import {Title} from '@angular/platform-browser'; }) export class AboutComponent implements OnInit { faqs: any[] = faqs; - - constructor(private title: Title, - private route: ActivatedRoute) { + properties: EnvProperties = properties; + description = "UsageCounts service is an OpenAIRE service built after the development of the Usage Statistics Service within OpenAIRE. UsageCounts forms metrics of usage activity of Open Access Repositories categorizing the data retrieved by country, number of downloads, number of views, number of repositories and all derivative quantitative open metrics, in a comprehensive way for all stakeholders. Architecture. "; + title = "OpenAIRE - UsageCounts | About"; + subs: Subscription[] = []; + constructor(private route: ActivatedRoute, + private router: Router, + private _title: Title, private _piwikService: PiwikService, + private _meta: Meta, private seoService: SEOService) { } ngOnInit() { - this.title.setTitle('OpenAIRE - UsageCounts | About'); - this.route.fragment.subscribe(fragment => { + this._title.setTitle(this.title); + this._meta.updateTag({content: this.description}, "name='description'"); + this._meta.updateTag({content: this.description}, "property='og:description'"); + this._meta.updateTag({content: this.title}, "property='og:title'"); + this._title.setTitle(this.title); + let url = this.properties.domain + this.properties.baseLink + this.router.url; + this.seoService.createLinkForCanonicalURL(url, false); + this._meta.updateTag({content: url}, "property='og:url'"); + if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { + this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe()); + } + this.subs.push(this.route.fragment.subscribe(fragment => { setTimeout(() => { this.goTo(fragment); }, 100); - }); + })); } goTo(id: string) { @@ -32,4 +52,9 @@ export class AboutComponent implements OnInit { window.scrollTo({top: y, behavior: 'smooth'}); } } + public ngOnDestroy() { + for (let sub of this.subs) { + sub.unsubscribe(); + } + } } diff --git a/src/app/about/about.module.ts b/src/app/about/about.module.ts index 9854e67..ed99980 100644 --- a/src/app/about/about.module.ts +++ b/src/app/about/about.module.ts @@ -3,6 +3,7 @@ import {CommonModule} from "@angular/common"; import {RouterModule} from "@angular/router"; import {AboutComponent} from "./about.component"; +import {Schema2jsonldModule} from '../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module'; import {IconsModule} from '../openaireLibrary/utils/icons/icons.module'; import {IconsService} from '../openaireLibrary/utils/icons/icons.service'; import {arrow_down} from '../openaireLibrary/utils/icons/icons'; @@ -13,6 +14,7 @@ import {arrow_down} from '../openaireLibrary/utils/icons/icons'; RouterModule.forChild([{ path: '', component: AboutComponent }]), + Schema2jsonldModule, IconsModule ], declarations: [AboutComponent], diff --git a/src/app/analytics/analytics.component.html b/src/app/analytics/analytics.component.html index ee5f918..abcfc65 100644 --- a/src/app/analytics/analytics.component.html +++ b/src/app/analytics/analytics.component.html @@ -1,4 +1,8 @@
+ +