[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 {
@Input() piwikSiteId = null;
@Input() pageTitle: string = null;
@Input() pageTitle: string = " Create links between research objects";
piwiksub:any;
@Input() communityId:string= null;
@ -60,7 +60,7 @@ export class LinkingGenericComponent {
this.properties = data.envSpecific;
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.updateDescription(description);
this.updateUrl(this.url);

View File

@ -211,7 +211,7 @@ import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component";
export class DepositFirstPageComponent {
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() piwikSiteId = null;
@ -244,7 +244,7 @@ export class DepositFirstPageComponent {
this.url = this.properties.baseLink+this._router.url;
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.updateDescription(description);
this.updateUrl(this.url);

View File

@ -144,8 +144,8 @@ export class SearchAllComponent {
this.subs.push(this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ";
var title = "OpenAIRE | Search publications, research data, projects... | OpenAIRE";
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 for research outcomes, projects, content providers & organizations";
this.properties = data.envSpecific;
var url = data.envSpecific.baseLink + this._router.url;
this._title.setTitle(title);
@ -155,7 +155,7 @@ export class SearchAllComponent {
this._meta.updateTag({content: url}, "property='og:url'");
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false);
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: `
<new-search-page
pageTitle="{{(simpleView?'':'Advanced ')}} Search for {{ pageTitle }}"
pageTitle="{{(simpleView?'':'Advanced ')}} Find research {{ pageTitle }}"
entityType="dataprovider"
type="content providers"
[results]="results"
@ -40,7 +40,7 @@ import {properties} from "../../../environments/environment";
[simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..."
[showResultCount]="(type=='all' || type == 'deposit')" [showLastIndex]="type!='deposit'"
[tableViewLink]="tableViewLink"
[sort]="false" [showBreadcrumb]="showBreadcrumb">
[sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription">
</new-search-page>
<!-- [filters]="filters"-->
@ -86,6 +86,7 @@ export class SearchDataProvidersComponent {
@Input() showSwitchSearchLink:boolean;
@Input() showBreadcrumb: boolean = false;
subs: any[] = [];
metaDescription = [];
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
this.results =[];
@ -96,6 +97,7 @@ export class SearchDataProvidersComponent {
ngOnInit() {
this.refineFields = DatasourcesHelperClass.getrefineFields(this.type);
this.pageTitle = DatasourcesHelperClass.getTitle(this.type);
this.metaDescription = DatasourcesHelperClass.getDescription(this.type)
if(this.showSwitchSearchLink == null){
this.showSwitchSearchLink = (this.type == "all");
}

View File

@ -30,6 +30,17 @@ export class DatasourcesHelperClass {
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 {
if (type == "registries") {
return ' datasourcetypeuiid = other ';

View File

@ -105,6 +105,8 @@ export class NewSearchPageComponent {
breadcrumbs:Breadcrumb[] = [];
url = null;
metaDescription = "";
@Input() basicMetaDescription = [];
@Input() entitiesSelection:boolean = true;
@Input() showSwitchSearchLink:boolean = true;
@ -141,22 +143,34 @@ export class NewSearchPageComponent {
this.resultsPerPage = data.envSpecific.resultsPerPage;
this.csvLimit = data.envSpecific.csvLimit;
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;
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.route.queryParams.subscribe(params => {
if (params['page'] && params['page']!=1) {
if (params['page'] && params['page'] != 1) {
HelperFunctions.scrollToId("searchForm");
}
this.customFilterEnabled = params['cf'] && params['cf'] == "true";
});
this.metaDescription = this.pageTitle;
this.updateTitle(this.pageTitle);
this.updateDescription();
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.updateDescription();
}
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.router.url, false);
@ -192,8 +206,8 @@ export class NewSearchPageComponent {
}
updateDescription() {
this.metaDescription = "Search results for ";
if(this.resultTypes){
// this.metaDescription2 = "";
/*if(this.resultTypes){
let array = [];
for(let type of this.resultTypeOptions){
if(this.resultTypes[type.id]== true){
@ -207,7 +221,7 @@ export class NewSearchPageComponent {
}
}else{
this.metaDescription = this.pageTitle + " ";
}
}*/
let filterArray = [];
for(let filter of this.filters){
if(filter.countSelectedValues> 0){
@ -225,7 +239,8 @@ export class NewSearchPageComponent {
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}, "property='og:description'");
}
@ -433,7 +448,9 @@ export class NewSearchPageComponent {
this.customFilter.selected = false;
}
this.filterFilterValues(this.filters);
this.updateDescription();
if(!this.includeOnlyResultsAndFilter) {
this.updateDescription();
}
return filters;
}