[Trunk|Library]

Update meta tags and description


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59291 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-08-19 10:16:43 +00:00
parent 92e10e92a6
commit 30fb2d9369
6 changed files with 51 additions and 21 deletions

View File

@ -19,7 +19,7 @@ declare var UIkit:any;
}) })
export class LinkingGenericComponent { export class LinkingGenericComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() pageTitle: string = null; @Input() pageTitle: string = " Create links between research objects";
piwiksub:any; piwiksub:any;
@Input() communityId:string= null; @Input() communityId:string= null;
@ -60,7 +60,7 @@ export class LinkingGenericComponent {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.url = data.envSpecific.baseLink+this._router.url; this.url = data.envSpecific.baseLink+this._router.url;
var description = "Openaire, linking, claim, publication, research data, software, other research product, project, community"; var description = "Linking is a functionality provided by OpenAIRE, in order to link research results with a project, a research community or other research results.";
this.updateTitle(this.pageTitle); this.updateTitle(this.pageTitle);
this.updateDescription(description); this.updateDescription(description);
this.updateUrl(this.url); this.updateUrl(this.url);

View File

@ -211,7 +211,7 @@ import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component";
export class DepositFirstPageComponent { export class DepositFirstPageComponent {
public url: string = null; public url: string = null;
public title: string = "Deposit your research - Learn How"; public title: string = "Deposit or publish your research in Open Access";
@Input() public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass(); @Input() public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@ -244,7 +244,7 @@ export class DepositFirstPageComponent {
this.url = this.properties.baseLink+this._router.url; this.url = this.properties.baseLink+this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false); this.seoService.createLinkForCanonicalURL(this.url, false);
var description = "Openaire, Zenodo, repositories, open access, content provider, compatibility, deposit"; var description = "Find the appropriate repository or journal or use Zenodo repository to deposit your research and publish in the Open Access journals that suit your needs.";
this.updateTitle(this.title); this.updateTitle(this.title);
this.updateDescription(description); this.updateDescription(description);
this.updateUrl(this.url); this.updateUrl(this.url);

View File

@ -144,8 +144,8 @@ export class SearchAllComponent {
this.subs.push(this.route.data this.subs.push(this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects "; var description = "Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Research Graph. ";
var title = "OpenAIRE | Search publications, research data, projects... | OpenAIRE"; var title = "OpenAIRE |Search for research outcomes, projects, content providers & organizations";
this.properties = data.envSpecific; this.properties = data.envSpecific;
var url = data.envSpecific.baseLink + this._router.url; var url = data.envSpecific.baseLink + this._router.url;
this._title.setTitle(title); this._title.setTitle(title);
@ -155,7 +155,7 @@ export class SearchAllComponent {
this._meta.updateTag({content: url}, "property='og:url'"); this._meta.updateTag({content: url}, "property='og:url'");
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false);
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subs.push(this._piwikService.trackView(this.properties, "OpenAIRE |Search publications, research data, projects...", this.piwikSiteId).subscribe()); this.subs.push(this._piwikService.trackView(this.properties, title, this.piwikSiteId).subscribe());
} }

View File

@ -18,7 +18,7 @@ import {properties} from "../../../environments/environment";
template: ` template: `
<new-search-page <new-search-page
pageTitle="{{(simpleView?'':'Advanced ')}} Search for {{ pageTitle }}" pageTitle="{{(simpleView?'':'Advanced ')}} Find research {{ pageTitle }}"
entityType="dataprovider" entityType="dataprovider"
type="content providers" type="content providers"
[results]="results" [results]="results"
@ -40,7 +40,7 @@ import {properties} from "../../../environments/environment";
[simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..." [simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..."
[showResultCount]="(type=='all' || type == 'deposit')" [showLastIndex]="type!='deposit'" [showResultCount]="(type=='all' || type == 'deposit')" [showLastIndex]="type!='deposit'"
[tableViewLink]="tableViewLink" [tableViewLink]="tableViewLink"
[sort]="false" [showBreadcrumb]="showBreadcrumb"> [sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription">
</new-search-page> </new-search-page>
<!-- [filters]="filters"--> <!-- [filters]="filters"-->
@ -86,6 +86,7 @@ export class SearchDataProvidersComponent {
@Input() showSwitchSearchLink:boolean; @Input() showSwitchSearchLink:boolean;
@Input() showBreadcrumb: boolean = false; @Input() showBreadcrumb: boolean = false;
subs: any[] = []; subs: any[] = [];
metaDescription = [];
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) { constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
this.results =[]; this.results =[];
@ -96,6 +97,7 @@ export class SearchDataProvidersComponent {
ngOnInit() { ngOnInit() {
this.refineFields = DatasourcesHelperClass.getrefineFields(this.type); this.refineFields = DatasourcesHelperClass.getrefineFields(this.type);
this.pageTitle = DatasourcesHelperClass.getTitle(this.type); this.pageTitle = DatasourcesHelperClass.getTitle(this.type);
this.metaDescription = DatasourcesHelperClass.getDescription(this.type)
if(this.showSwitchSearchLink == null){ if(this.showSwitchSearchLink == null){
this.showSwitchSearchLink = (this.type == "all"); this.showSwitchSearchLink = (this.type == "all");
} }

View File

@ -30,6 +30,17 @@ export class DatasourcesHelperClass {
return "Content Providers" return "Content Providers"
} }
} }
public static getDescription(type: "all" | "registries" | "journals" | "compatible" | "deposit") {
if (type == "registries") {
return ["Discover research Entity Registries.","For each entity are available description and the research projects managed. Categorized by type and OpenAIRE compatibility level."];
} else if (type == "journals") {
return ["Discover research Journals. ","For each entity are available description, subjects, related content providers, publications and research outcomes per year and type."];
} else if (type == "compatible") {
return ["Discover publication, data, software, istitutional and thematic repositories.","Available repository research outcomes per year and type."];
} else {
return ["Discover worldwide research content providers and correlated research.","Statistics data about produced research outocomes per year available."];
}
}
public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit"): string { public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit"): string {
if (type == "registries") { if (type == "registries") {
return ' datasourcetypeuiid = other '; return ' datasourcetypeuiid = other ';

View File

@ -105,6 +105,8 @@ export class NewSearchPageComponent {
breadcrumbs:Breadcrumb[] = []; breadcrumbs:Breadcrumb[] = [];
url = null; url = null;
metaDescription = ""; metaDescription = "";
@Input() basicMetaDescription = [];
@Input() entitiesSelection:boolean = true; @Input() entitiesSelection:boolean = true;
@Input() showSwitchSearchLink:boolean = true; @Input() showSwitchSearchLink:boolean = true;
@ -143,7 +145,7 @@ export class NewSearchPageComponent {
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack; this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
this.updateUrl(data.envSpecific.baseLink + this.router.url); this.updateUrl(data.envSpecific.baseLink + this.router.url);
this.url = data.envSpecific.baseLink + this.router.url; this.url = data.envSpecific.baseLink + this.router.url;
if (typeof document !== 'undefined' && this.isPiwikEnabled) { if (typeof document !== 'undefined' && this.isPiwikEnabled && !this.includeOnlyResultsAndFilter) {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe();
} }
}); });
@ -153,10 +155,22 @@ export class NewSearchPageComponent {
} }
this.customFilterEnabled = params['cf'] && params['cf'] == "true"; this.customFilterEnabled = params['cf'] && params['cf'] == "true";
}); });
this.metaDescription = this.pageTitle; if (!this.includeOnlyResultsAndFilter) {
if(this.basicMetaDescription.length == 0 ){
if (this.entityType == "result") {
this.basicMetaDescription = ["Discover" + (this.properties.adminToolsCommunity == 'openaire'?"over 100 million of":"")+" research outcomes ", "categorized by research type, year range, funder, languages, community and content providers."];
} else if (this.entityType == "project") {
this.basicMetaDescription = ["Discover research projects and correlated research categorized by Funder and active year. ", "Statistics data about produced research outcomes per year available."];
} else if (this.entityType == "organization") {
this.basicMetaDescription = ["Discover worldwide research organizations from over 100 countries and correlated research. ", "Funding, content providers, research pubblications and research data available."];
}else{
this.basicMetaDescription.push(this.pageTitle)
}
}
this.metaDescription = this.basicMetaDescription.join(" ");
this.updateTitle(this.pageTitle); this.updateTitle(this.pageTitle);
this.updateDescription(); this.updateDescription();
}
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.router.url, false); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.router.url, false);
@ -192,8 +206,8 @@ export class NewSearchPageComponent {
} }
updateDescription() { updateDescription() {
this.metaDescription = "Search results for "; // this.metaDescription2 = "";
if(this.resultTypes){ /*if(this.resultTypes){
let array = []; let array = [];
for(let type of this.resultTypeOptions){ for(let type of this.resultTypeOptions){
if(this.resultTypes[type.id]== true){ if(this.resultTypes[type.id]== true){
@ -207,7 +221,7 @@ export class NewSearchPageComponent {
} }
}else{ }else{
this.metaDescription = this.pageTitle + " "; this.metaDescription = this.pageTitle + " ";
} }*/
let filterArray = []; let filterArray = [];
for(let filter of this.filters){ for(let filter of this.filters){
if(filter.countSelectedValues> 0){ if(filter.countSelectedValues> 0){
@ -225,7 +239,8 @@ export class NewSearchPageComponent {
filterArray.push(field.value); filterArray.push(field.value);
} }
} }
this.metaDescription+= (filterArray.length > 0?" filtered for: ":"") + filterArray.join(", ") + " "; this.metaDescription= (filterArray.length > 0?( this.basicMetaDescription[0] + " Filtered by: " + filterArray.join(", ") + " ")
:this.basicMetaDescription.join(" "));
this._meta.updateTag({content: this.metaDescription}, "name='description'"); this._meta.updateTag({content: this.metaDescription}, "name='description'");
this._meta.updateTag({content: this.metaDescription}, "property='og:description'"); this._meta.updateTag({content: this.metaDescription}, "property='og:description'");
} }
@ -433,7 +448,9 @@ export class NewSearchPageComponent {
this.customFilter.selected = false; this.customFilter.selected = false;
} }
this.filterFilterValues(this.filters); this.filterFilterValues(this.filters);
if(!this.includeOnlyResultsAndFilter) {
this.updateDescription(); this.updateDescription();
}
return filters; return filters;
} }