From ded2faaa76ecf72cc23d6d02ef69398af0fe7638 Mon Sep 17 00:00:00 2001
From: Henrik Askjer <henrik.askjer@uib.no>
Date: Tue, 20 Jul 2021 13:21:06 +0200
Subject: [PATCH] Get domain name from window.location

---
 src/components/Article.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/Article.vue b/src/components/Article.vue
index 4cd5592a..7dafe641 100644
--- a/src/components/Article.vue
+++ b/src/components/Article.vue
@@ -112,7 +112,8 @@ export default {
       }
     },
     share_link: function() {
-      return 'https://beta.ordbok.uib.no/' + this.dictionary + '/' + this.article.article_id + '/' + encodeURIComponent(this.article.lemmas[0].lemma)
+      let host =  window.location.hostname === 'localhost'? 'https://dev.ordbok.uib.no' : 'https://' + window.location.host
+      return host + "/" + this.dictionary + '/' + this.article.article_id + '/' + encodeURIComponent(this.article.lemmas[0].lemma)
     },
     dictionary: function() {
       return this.article.dictionary
-- 
GitLab