- link to doi.tethys subdomain in search results

This commit is contained in:
Arno Kaimbacher 2021-06-02 10:17:13 +02:00
parent b6338b0543
commit 8d8fafd3db
3 changed files with 11 additions and 2 deletions

View file

@ -15,6 +15,15 @@ export default class VsResults extends Vue {
return this.data;
};
getDomainWithoutSubdomain () {
const urlParts = new URL(window.location.href).hostname.split('.')
return urlParts
.slice(0)
.slice(-(urlParts.length === 4 ? 3 : 2))
.join('.')
}
truncate(text, limit) {
text = text === undefined ? '' : text;
const content = text.split(' ').slice(0, limit);