-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.js
1 lines (1 loc) · 7.64 KB
/
index.js
1
(function () {var a={data:function(){return{headline:null,site_title:null,this_page_title:null,url:null,meta_image:null}},created:function(){var t=this;this.load().then(function(e){t.headline=e.headline,t.page_title=e.title.value,t.meta_url=e.url,t.uid=e.uid,t.siteTitleAfterPageTitle=e.siteTitleAfterPageTitle,t.siteTitleAsHomePageTitle=e.siteTitleAsHomePageTitle,t.separator=e.separator}),this.$api.site.get().then(function(e){t.site_title=e.title,t.site_meta_title=e.content.meta_title})},computed:{meta_title:function(){var t=this.$store.getters["content/values"]().meta_title;return this.site_title==this.page_title?""==t&&(t=this.site_title):t="home"==this.uid&&this.siteTitleAsHomePageTitle?this.site_meta_title||this.site_title:1==this.siteTitleAfterPageTitle?""==t?this.page_title+this.separator+this.site_title:t+this.separator+this.site_title:""==t?this.site_title+this.separator+this.page_title:this.site_title+this.separator+t,t},meta_description:function(){var t=this.$store.getters["content/values"]().meta_description;return t.length<1?"[Description Missing]":t},store_image:function(){return this.$store.getters["content/values"]().meta_image}},watch:{store_image:{handler:function(){var t=this;0===this.store_image.length?this.meta_image=null:this.$api.files.get(this.$store.getters["content/model"]().api,this.store_image[0].filename,{view:"compact"}).then(function(e){t.meta_image=e.url})},immediate:!0}}};if(typeof a==="function"){a=a.options}Object.assign(a,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_c("div",{staticClass:"k-field-label"},[_c("span",{staticClass:"google-icon"}),_vm._v(" "+_vm._s(_vm.headline)+" ")]),_vm._v(" "),_c("div",{staticClass:"google-search-preview"},[_c("div",{staticClass:"google-search-preview__content-container"},[_c("h2",{staticClass:"google-search-preview__headline"},[_vm._v(" "+_vm._s(_vm.meta_title)+" ")]),_vm._v(" "),_c("span",{staticClass:"google-search-preview__url"},[_vm._v(_vm._s(_vm.meta_url))]),_vm._v(" "),_c("p",{staticClass:"google-search-preview__paragraph"},[_vm._v(" "+_vm._s(_vm.meta_description)+" ")])])]),_vm._v(" "),_vm.siteTitleAsHomePageTitle&&_vm.uid=="home"?_c("div",{staticClass:"k-field-help k-text",attrs:{"data-theme":"help"}},[_c("p",[_vm._v("Using the site title as home page title.")])]):_vm._e()])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var b={data:function(){return{headline:"Basic Meta Information",site_title:null,page_title:null,url:null,og_image:null}},created:function(){var t=this;this.load().then(function(e){t.headline=e.headline,t.page_title=e.title.value,t.url=e.url}),this.$api.site.get().then(function(e){t.site_title=e.title})},computed:{og_title:function(){var t=this.$store.getters["content/values"]().og_title,e=this.$store.getters["content/values"]().meta_title,i=this.page_title;return t.length<1&&(t=e.length>0?e:i),t},og_description:function(){var t=this.$store.getters["content/values"]().og_description,e=this.$store.getters["content/values"]().meta_description;return t.length<1&&(t=e,e.length<1&&(t="[OG Description and Fallback Description Missing]")),t},og_site_name:function(){var t=this.$store.getters["content/values"]().og_site_name;return t.length<1?(t=this.site_title,t):t},store_image:function(){return this.$store.getters["content/values"]().og_image}},watch:{store_image:{handler:function(){var t=this;0===this.store_image.length?this.og_image=this.site_og_image_url:this.$api.files.get(this.$store.getters["content/model"]().api,this.store_image[0].filename,{view:"compact"}).then(function(e){t.og_image=e.url})},immediate:!0}}};if(typeof b==="function"){b=b.options}Object.assign(b,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_c("div",{staticClass:"k-field-label"},[_c("span",{staticClass:"facebook-icon"}),_vm._v(" "+_vm._s(_vm.headline)+" ")]),_vm._v(" "),_c("div",{staticClass:"open-graph-preview"},[_c("div",{staticClass:"open-graph-preview__image-container"},[this.store_image.length?_c("img",{staticClass:"open-graph-preview__preview-image",attrs:{"src":_vm.og_image}}):_vm._e()]),_vm._v(" "),_c("div",{staticClass:"open-graph-preview__content-container"},[_c("span",{staticClass:"open-graph-preview__url"},[_vm._v(_vm._s(_vm.og_site_name))]),_vm._v(" "),_c("h2",{staticClass:"open-graph-preview__preview-headline"},[_vm._v(" "+_vm._s(_vm.og_title)+" ")]),_vm._v(" "),_c("p",{staticClass:"open-graph-preview__preview-paragraph"},[_vm._v(" "+_vm._s(_vm.og_description)+" ")])])])])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());var c={data:function(){return{headline:"Basic Meta Information",site_title:null,page_title:null,url:null,twitter_image:null}},created:function(){var t=this;this.load().then(function(e){t.headline=e.headline,t.url=e.url,t.page_title=e.title.value,t.twitter_url=e.url})},computed:{twitter_card_type:function(){var t=this.$store.getters["content/values"]().twitter_card_type;return t},twitter_title:function(){var t=this.$store.getters["content/values"]().twitter_title,e=this.$store.getters["content/values"]().meta_title,i=this.page_title;return t.length<1&&(t=e.length>0?e:i),t},twitter_description:function(){var t=this.$store.getters["content/values"]().twitter_description,e=this.$store.getters["content/values"]().meta_description;return t.length<1&&(t=e,e.length<1&&(t="[Twitter Description and Fallback Description Missing]")),t},store_image:function(){return this.$store.getters["content/values"]().twitter_image}},watch:{store_image:{handler:function(){var t=this;0===this.store_image.length?this.twitter_image=null:this.$api.files.get(this.$store.getters["content/model"]().api,this.store_image[0].filename,{view:"compact"}).then(function(e){t.twitter_image=e.url})},immediate:!0}}};if(typeof c==="function"){c=c.options}Object.assign(c,function(){var render=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",[_c("div",{staticClass:"k-field-label"},[_c("span",{staticClass:"twitter-icon"}),_vm._v(" "+_vm._s(_vm.headline)+" ")]),_vm._v(" "),_c("div",{staticClass:"twitter-cards"},[_vm.twitter_card_type==="summary_large_image"?[_c("div",{staticClass:"twitter-card twitter-card--horizontal"},[_c("div",{staticClass:"twitter-card__image"},[this.store_image.length?_c("img",{staticClass:"twitter-card__preview-image",attrs:{"src":_vm.twitter_image}}):_vm._e()]),_vm._v(" "),_c("div",{staticClass:"twitter-card__content-container"},[_c("h2",{staticClass:"twitter-card__preview-headline"},[_vm._v(_vm._s(_vm.twitter_title))]),_vm._v(" "),_c("p",{staticClass:"twitter-card__preview-paragraph"},[_vm._v(" "+_vm._s(_vm.twitter_description)+" ")]),_vm._v(" "),_c("span",{staticClass:"twitter-card__url"},[_vm._v(_vm._s(_vm.twitter_url))])])])]:[_c("div",{staticClass:"twitter-card"},[_c("div",{staticClass:"twitter-card__image"},[this.store_image.length?_c("img",{staticClass:"twitter-card__preview-image",attrs:{"src":_vm.twitter_image}}):_vm._e()]),_vm._v(" "),_c("div",{staticClass:"twitter-card__content-container"},[_c("h2",{staticClass:"twitter-card__preview-headline"},[_vm._v(_vm._s(_vm.twitter_title))]),_vm._v(" "),_c("p",{staticClass:"twitter-card__preview-paragraph"},[_vm._v(" "+_vm._s(_vm.twitter_description)+" ")]),_vm._v(" "),_c("span",{staticClass:"twitter-card__url"},[_vm._v(_vm._s(_vm.twitter_url))])])])]],2)])};var staticRenderFns=[];return{render:render,staticRenderFns:staticRenderFns,_compiled:true,_scopeId:null,functional:undefined}}());panel.plugin("diesdasdigital/kirby-meta-knight",{sections:{google_search_preview:a,facebook_sharing_preview:b,twitter_card_preview:c}});})();