Skip to content

Commit

Permalink
Added URL to values
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Nov 19, 2018
1 parent c3732cc commit 3f614db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/components/sharing-options/doc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
<div class="card card-body d-inline-block">
<sharing-options class="justify-content-center"></sharing-options>
<sharing-options url="https://pirhoo.com" class="justify-content-center"></sharing-options>
</div>
</div>
</template>
Expand Down
12 changes: 7 additions & 5 deletions src/components/SharingOptions.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<template>
<div class="sharing-options" :style="style">
<social-sharing v-bind="valuesFor('twitter')" :url="url" inline-template>
<social-sharing v-bind="valuesFor('twitter')" inline-template>
<network network="twitter" class="sharing-options__link">
<i class="fab fa-twitter"></i>
<span class="sr-only">Share on Twitter</span>
</network>
</social-sharing>
<social-sharing v-bind="valuesFor('facebook')" :url="url" inline-template>
<social-sharing v-bind="valuesFor('facebook')" inline-template>
<network network="facebook" class="sharing-options__link">
<i class="fab fa-facebook"></i>
<span class="sr-only">Share on Facebook</span>
</network>
</social-sharing>
<social-sharing v-bind="valuesFor('linkedin')" :url="url" inline-template>
<social-sharing v-bind="valuesFor('linkedin')" inline-template>
<network network="linkedin" class="sharing-options__link">
<i class="fab fa-linkedin"></i>
<span class="sr-only">Share on Linkedin</span>
</network>
</social-sharing>
<social-sharing v-bind="valuesFor('email')" :url="url" inline-template>
<social-sharing v-bind="valuesFor('email')" inline-template>
<network network="email" class="sharing-options__link">
<i class="fas fa-envelope"></i>
<span class="sr-only">Share by email</span>
Expand Down Expand Up @@ -69,7 +69,7 @@
default: () => ({})
},
valuesKeys: {
default: () => ['title', 'description', 'media', 'twitter-user'],
default: () => ['url', 'title', 'description', 'media', 'twitter-user'],
type: Array
},
noEmbed: {
Expand Down Expand Up @@ -112,11 +112,13 @@
},
metaValues () {
return {
'url': this.url,
'title': this.defaultValueFor('sharing-options.title'),
'description': this.defaultValueFor('sharing-options.description', 'meta[name="description]'),
'facebook_title': this.defaultValueFor('sharing-options.facebook_title', 'meta[property="og:title"]'),
'facebook_description': this.defaultValueFor('sharing-options.description', 'meta[property="og:description"]'),
'facebook_media': this.defaultValueFor('sharing-options.media', 'meta[property="og:image"]'),
'facebook_url': this.defaultValueFor('app.home', 'meta[property="og:url"]'),
'twitter_media': this.defaultValueFor('sharing-options.media', 'meta[name="twitter:image"]'),
'twitter_twitter-user': this.defaultValueFor('sharing-options.twitter-user', 'meta[name="twitter:site"]')
}
Expand Down

0 comments on commit 3f614db

Please sign in to comment.