share-to-fediverse-jekyll-theme 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_data/en.yml +3 -0
- data/_data/en.yml.orig +47 -0
- data/_data/es.yml +3 -0
- data/_data/es.yml.orig +47 -0
- data/_includes/share.html +12 -0
- data/_includes/share_box.html +16 -0
- data/_sass/accessibility.scss +13 -0
- data/_sass/helpers.scss +15 -0
- data/_sass/helpers.scss.orig +57 -0
- data/_sass/share.html +12 -0
- data/_sass/share_box.html +16 -0
- data/_sass/share_box.scss +26 -0
- data/_sass/toggler.scss +39 -0
- data/assets/css/styles.scss +1 -0
- data/assets/css/styles.scss.orig +31 -0
- data/assets/js/script.js +1 -1
- data/assets/js/script.js.orig +67 -0
- metadata +13 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f70a7cb2292f13a87fb137d0a64f7def5524287846207ff44f437cf44f814028
|
4
|
+
data.tar.gz: 0e1b31d2799da74dad71ac45b3a470f112b25abc8781479c91f9c2382e4a1a0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ab7dcb734e0f7f92a445064a4dea419d76862cb146fc7f375da47b2e136087f7821afc07979f98bec0fa3570e37a0d1d55b6003e662949041d7a00c4912521b
|
7
|
+
data.tar.gz: b03be2b7c6f1eb0895f0070cdbc2020ae30e18981cb142e5eebf4c291cf0f212d20fbb49a4a2b1414d780064db0fe02212a4639dd233726fc2d43cd3200d3e96
|
data/_data/en.yml
CHANGED
data/_data/en.yml.orig
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
locale: English
|
3
|
+
<<<<<<< HEAD
|
4
|
+
made_by: 'Made by [Sutty](https://sutty.nl/en/). [Follow us to the Fediverse](https://todon.nl/@sutty).'
|
5
|
+
home:
|
6
|
+
about: You're about to share
|
7
|
+
title: No title
|
8
|
+
description: No description
|
9
|
+
url: '#'
|
10
|
+
=======
|
11
|
+
date: '%m/%d/%Y'
|
12
|
+
layouts:
|
13
|
+
post: Article
|
14
|
+
menu:
|
15
|
+
title: Menu
|
16
|
+
items:
|
17
|
+
- title: Home
|
18
|
+
href: ''
|
19
|
+
share:
|
20
|
+
text: Share
|
21
|
+
icon: share-alt
|
22
|
+
items:
|
23
|
+
- title: Fediverse
|
24
|
+
url: "https://fediverse.sutty.nl/en/?u=%url&t=%title&d=%description"
|
25
|
+
icon: mastodon-alt
|
26
|
+
- title: Facebook
|
27
|
+
url: "https://www.facebook.com/sharer/sharer.php?u=%url&t=%title%0A%0A%description"
|
28
|
+
icon: facebook-official
|
29
|
+
- title: Twitter
|
30
|
+
url: "https://twitter.com/intent/tweet?url=%url&text=%title%0A%0A%description&hashtags=ContamosConVoz"
|
31
|
+
icon: twitter
|
32
|
+
- title: Whatsapp
|
33
|
+
url: "https://api.whatsapp.com/send?text=%title%0A%0A%description%0A%0A%url"
|
34
|
+
icon: whatsapp
|
35
|
+
- title: Telegram
|
36
|
+
url: "https://t.me/share/url?url=%url&text=%title%0A%0A%description"
|
37
|
+
icon: telegram
|
38
|
+
- title: Tumblr
|
39
|
+
url: "https://www.tumblr.com/widgets/share/tool?canonicalUrl=%url&title=%title&caption=%description&tags=ContamosConVoz"
|
40
|
+
icon: tumblr
|
41
|
+
- title: Reddit
|
42
|
+
url: "https://reddit.com/submit?url=%url&title=ConVozContamos%20-%20%title"
|
43
|
+
icon: reddit
|
44
|
+
- title: E-mail
|
45
|
+
url: "mailto:?subject=%title&body=%description%0A%0A%url"
|
46
|
+
icon: envelope
|
47
|
+
>>>>>>> 316041fe919fb439694e11d95c590f9056d52935
|
data/_data/es.yml
CHANGED
data/_data/es.yml.orig
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
locale: Castellano
|
3
|
+
<<<<<<< HEAD
|
4
|
+
made_by: 'Hecho por [Sutty](https://sutty.nl/es/). [Seguinos al Fediverso](https://todon.nl/@sutty).'
|
5
|
+
home:
|
6
|
+
about: Estás por compartir
|
7
|
+
title: No hay un título
|
8
|
+
description: No hay una descripción
|
9
|
+
url: '#'
|
10
|
+
=======
|
11
|
+
date: '%d/%m/%Y'
|
12
|
+
layouts:
|
13
|
+
post: Artículo
|
14
|
+
menu:
|
15
|
+
title: Menú
|
16
|
+
items:
|
17
|
+
- title: Inicio
|
18
|
+
href: ''
|
19
|
+
share:
|
20
|
+
text: Compartir
|
21
|
+
icon: share-alt
|
22
|
+
items:
|
23
|
+
- title: Fediverso
|
24
|
+
url: "https://fediverse.sutty.nl/es/?u=%url&t=%title&d=%description"
|
25
|
+
icon: mastodon-alt
|
26
|
+
- title: Facebook
|
27
|
+
url: "https://www.facebook.com/sharer/sharer.php?u=%url&t=%title%0A%0A%description"
|
28
|
+
icon: facebook-official
|
29
|
+
- title: Twitter
|
30
|
+
url: "https://twitter.com/intent/tweet?url=%url&text=%title%0A%0A%description&hashtags=ContamosConVoz"
|
31
|
+
icon: twitter
|
32
|
+
- title: Whatsapp
|
33
|
+
url: "https://api.whatsapp.com/send?text=%title%0A%0A%description%0A%0A%url"
|
34
|
+
icon: whatsapp
|
35
|
+
- title: Telegram
|
36
|
+
url: "https://t.me/share/url?url=%url&text=%title%0A%0A%description"
|
37
|
+
icon: telegram
|
38
|
+
- title: Tumblr
|
39
|
+
url: "https://www.tumblr.com/widgets/share/tool?canonicalUrl=%url&title=%title&caption=%description&tags=ContamosConVoz"
|
40
|
+
icon: tumblr
|
41
|
+
- title: Reddit
|
42
|
+
url: "https://reddit.com/submit?url=%url&title=ConVozContamos%20-%20%title"
|
43
|
+
icon: reddit
|
44
|
+
- title: Correo
|
45
|
+
url: "mailto:?subject=%title&body=%description%0A%0A%url"
|
46
|
+
icon: envelope
|
47
|
+
>>>>>>> 316041fe919fb439694e11d95c590f9056d52935
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{% assign url = site.url | append: include.url | uri_escape %}
|
2
|
+
{% assign title = include.title | default: site.title | uri_escape %}
|
3
|
+
{% assign description = include.description | default: '' | uri_escape %}
|
4
|
+
|
5
|
+
<a
|
6
|
+
target="_blank"
|
7
|
+
title="{{ include.share.title }}"
|
8
|
+
class="d-flex flex-column align-items-center p-3"
|
9
|
+
href="{{ include.share.url | replace: '%url', url | replace: '%title', title | replace: '%description', description }}">
|
10
|
+
<i class="fa fa-fw fa-2x fa-{{ include.share.icon }}"></i>
|
11
|
+
<span>{{ include.share.title }}</span>
|
12
|
+
</a>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<input type="checkbox" id="share" class="toggler" autocomplete="off" />
|
2
|
+
|
3
|
+
<label class="share btn border btn-block" for="share">
|
4
|
+
{{ site.i18n.share.text }}
|
5
|
+
<i class="fa fa-{{ site.i18n.share.icon }}"></i>
|
6
|
+
|
7
|
+
<div class="share-box toggled d-flex align-items-center justify-content-center">
|
8
|
+
<div class="box background-white color-redpink row no-gutters align-items-center justify-content-center p-3">
|
9
|
+
{% for share in site.i18n.share.items %}
|
10
|
+
<div class="col-4">
|
11
|
+
{% include_cached share.html share=share url=include.url title=include.title description=include.description %}
|
12
|
+
</div>
|
13
|
+
{% endfor %}
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</label>
|
data/_sass/helpers.scss
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
$bezier: cubic-bezier(0.75, 0, 0.25, 1);
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Crea una propiedad con prefijos de navegador
|
5
|
+
*/
|
6
|
+
$vendor-prefixes: ("", "-webkit-", "-ms-", "-o-", "-moz-");
|
7
|
+
@mixin vendor-prefix($property, $definition...) {
|
8
|
+
@each $prefix in $vendor-prefixes {
|
9
|
+
#{$prefix}$property: $definition;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
/*
|
14
|
+
* Crea clases para asignar colores según la lista de colores.
|
15
|
+
*/
|
1
16
|
@each $color, $_ in $colors {
|
2
17
|
.background-#{$color} {
|
3
18
|
background-color: var(--#{$color});
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<<<<<<< HEAD
|
2
|
+
=======
|
3
|
+
$bezier: cubic-bezier(0.75, 0, 0.25, 1);
|
4
|
+
|
5
|
+
/*
|
6
|
+
* Crea una propiedad con prefijos de navegador
|
7
|
+
*/
|
8
|
+
$vendor-prefixes: ("", "-webkit-", "-ms-", "-o-", "-moz-");
|
9
|
+
@mixin vendor-prefix($property, $definition...) {
|
10
|
+
@each $prefix in $vendor-prefixes {
|
11
|
+
#{$prefix}$property: $definition;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
/*
|
16
|
+
* Crea clases para asignar colores según la lista de colores.
|
17
|
+
*/
|
18
|
+
>>>>>>> 316041fe919fb439694e11d95c590f9056d52935
|
19
|
+
@each $color, $_ in $colors {
|
20
|
+
.background-#{$color} {
|
21
|
+
background-color: var(--#{$color});
|
22
|
+
}
|
23
|
+
|
24
|
+
.#{$color} {
|
25
|
+
color: var(--#{$color});
|
26
|
+
|
27
|
+
::-moz-selection,
|
28
|
+
::selection {
|
29
|
+
background: var(--#{$color});
|
30
|
+
color: white;
|
31
|
+
}
|
32
|
+
|
33
|
+
svg {
|
34
|
+
* {
|
35
|
+
fill: var(--#{$color});
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
.form-control {
|
40
|
+
border-color: var(--#{$color});
|
41
|
+
}
|
42
|
+
|
43
|
+
.btn {
|
44
|
+
background-color: var(--#{$color});
|
45
|
+
color: white;
|
46
|
+
border-color: var(--#{$color});
|
47
|
+
}
|
48
|
+
|
49
|
+
hr {
|
50
|
+
border-color: var(--#{$color});
|
51
|
+
}
|
52
|
+
|
53
|
+
a {
|
54
|
+
color: var(--#{$color});
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
data/_sass/share.html
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{% assign url = site.url | append: include.url | uri_escape %}
|
2
|
+
{% assign title = include.title | default: site.title | uri_escape %}
|
3
|
+
{% assign description = include.description | default: '' | uri_escape %}
|
4
|
+
|
5
|
+
<a
|
6
|
+
target="_blank"
|
7
|
+
title="{{ include.share.title }}"
|
8
|
+
class="d-flex flex-column align-items-center p-3"
|
9
|
+
href="{{ include.share.url | replace: '%url', url | replace: '%title', title | replace: '%description', description }}">
|
10
|
+
<i class="fa fa-fw fa-2x fa-{{ include.share.icon }}"></i>
|
11
|
+
<span>{{ include.share.title }}</span>
|
12
|
+
</a>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<input type="checkbox" id="share" class="toggler" autocomplete="off" />
|
2
|
+
|
3
|
+
<label class="share btn border btn-block" for="share">
|
4
|
+
{{ site.i18n.share.text }}
|
5
|
+
<i class="fa fa-{{ site.i18n.share.icon }}"></i>
|
6
|
+
|
7
|
+
<div class="share-box toggled d-flex align-items-center justify-content-center">
|
8
|
+
<div class="box background-white color-redpink row no-gutters align-items-center justify-content-center p-3">
|
9
|
+
{% for share in site.i18n.share.items %}
|
10
|
+
<div class="col-4">
|
11
|
+
{% include_cached share.html share=share url=include.url title=include.title description=include.description %}
|
12
|
+
</div>
|
13
|
+
{% endfor %}
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</label>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
input[type="checkbox"].toggler {
|
2
|
+
&:focus + label {
|
3
|
+
outline: none;
|
4
|
+
}
|
5
|
+
}
|
6
|
+
|
7
|
+
.share-box {
|
8
|
+
position: fixed;
|
9
|
+
top: 0;
|
10
|
+
left: 0;
|
11
|
+
width: 100vw;
|
12
|
+
height: 100vh;
|
13
|
+
background-color: rgba(0,0,0,.5);
|
14
|
+
|
15
|
+
@include vendor-prefix(transition, all 0.2s $bezier);
|
16
|
+
|
17
|
+
a {
|
18
|
+
border: $border-width solid transparent;
|
19
|
+
|
20
|
+
&:focus,
|
21
|
+
&:hover {
|
22
|
+
text-decoration: none;
|
23
|
+
border: $border-width solid $border-color;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
data/_sass/toggler.scss
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
/*
|
2
|
+
* Desplegar menúes sin javascript!
|
3
|
+
*
|
4
|
+
* Inspirado en https://dev.to/cydstumpel/creating-a-fold-out-navigation-with-css-only-4g9k
|
5
|
+
*/
|
6
|
+
|
7
|
+
// Comenzamos con un input checkbox con la clase toggler
|
8
|
+
input[type="checkbox"].toggler {
|
9
|
+
// Lo ocultamos pero todavía queremos que se le pueda dar foco con el
|
10
|
+
// teclado
|
11
|
+
opacity: 0;
|
12
|
+
position: absolute;
|
13
|
+
|
14
|
+
// Ocultamos el elemento colapsable
|
15
|
+
& ~ label {
|
16
|
+
.toggled {
|
17
|
+
z-index: 10;
|
18
|
+
visibility: hidden;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
// Al tildar el input, mostramos el elemento
|
23
|
+
&:checked ~ label {
|
24
|
+
.toggled {
|
25
|
+
visibility: visible;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
& + label {
|
30
|
+
border: none;
|
31
|
+
outline: none;
|
32
|
+
z-index: 11;
|
33
|
+
}
|
34
|
+
|
35
|
+
// Dar una guía visual de que estamos enfocando el input
|
36
|
+
&:focus + label {
|
37
|
+
outline: 1px dotted grey ;
|
38
|
+
}
|
39
|
+
}
|
data/assets/css/styles.scss
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
# Ponemos un frontmatter porque queremos que Jekyll procese este archivo
|
3
|
+
---
|
4
|
+
|
5
|
+
$mastodon: #191b22;
|
6
|
+
$mastodon-grey: #9baec8;
|
7
|
+
$success: $mastodon-grey;
|
8
|
+
|
9
|
+
$colors: (
|
10
|
+
"transparent": transparent,
|
11
|
+
"mastodon": $mastodon,
|
12
|
+
"mastodon-grey": $mastodon-grey
|
13
|
+
);
|
14
|
+
|
15
|
+
/*
|
16
|
+
* XXX: Solo importar los archivos necesarios de bootstrap para
|
17
|
+
* facilitar la reducción de CSS. Por ahora pedimos todo para poder
|
18
|
+
* empezar a trabajar en el HTML sin pensar en CSS.
|
19
|
+
*
|
20
|
+
* Los archivos se encuentran en node_modules/bootstrap/scss
|
21
|
+
*/
|
22
|
+
@import "bootstrap/scss/bootstrap";
|
23
|
+
<<<<<<< HEAD
|
24
|
+
@import "helpers";
|
25
|
+
=======
|
26
|
+
@import "fork-awesome/scss/fork-awesome";
|
27
|
+
@import "accessibility";
|
28
|
+
@import "helpers";
|
29
|
+
@import "toggler";
|
30
|
+
@import "share_box";
|
31
|
+
>>>>>>> 316041fe919fb439694e11d95c590f9056d52935
|
data/assets/js/script.js
CHANGED
@@ -19,7 +19,7 @@ const searchToObject = () => {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
|
22
|
-
document.addEventListener('DOMContentLoaded',
|
22
|
+
document.addEventListener('{%- if site.turbolinks.enabled -%}turbolinks:load{%- else -%}DOMContentLoaded{%- endif -%}', () => {
|
23
23
|
const urlShared = searchToObject();
|
24
24
|
|
25
25
|
document.querySelectorAll('a[lang]').forEach(a => a.href += window.location.search);
|
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
|
4
|
+
<<<<<<< HEAD
|
5
|
+
// https://stackoverflow.com/a/7090123
|
6
|
+
const searchToObject = () => {
|
7
|
+
var pairs = window.location.search.substring(1).split("&"),
|
8
|
+
obj = {},
|
9
|
+
pair,
|
10
|
+
i;
|
11
|
+
|
12
|
+
for (i in pairs) {
|
13
|
+
if (pairs[i] === "") continue;
|
14
|
+
|
15
|
+
pair = pairs[i].split("=");
|
16
|
+
obj[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
17
|
+
}
|
18
|
+
|
19
|
+
return obj;
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
document.addEventListener('DOMContentLoaded', e => {
|
24
|
+
const urlShared = searchToObject();
|
25
|
+
|
26
|
+
document.querySelectorAll('a[lang]').forEach(a => a.href += window.location.search);
|
27
|
+
|
28
|
+
['t','d','u'].forEach(field => {
|
29
|
+
if (urlShared[field] === undefined) return;
|
30
|
+
|
31
|
+
document.querySelector(`#${field}`).innerText = urlShared[field];
|
32
|
+
});
|
33
|
+
|
34
|
+
document.querySelector('#text').value = Object.values(urlShared).join("\n\n");
|
35
|
+
|
36
|
+
document.querySelector('form').addEventListener('submit', e => {
|
37
|
+
e.target.action = document.querySelector('#instance').value + '/share';
|
38
|
+
=======
|
39
|
+
document.addEventListener('{%- if site.turbolinks.enabled -%}turbolinks:load{%- else -%}DOMContentLoaded{%- endif -%}', () => {
|
40
|
+
document.querySelectorAll('.share').forEach(share => {
|
41
|
+
share.addEventListener('click', event => {
|
42
|
+
if (!Navigator.share) return;
|
43
|
+
|
44
|
+
event.preventDefault();
|
45
|
+
event.stopPropagation();
|
46
|
+
|
47
|
+
const title = document.querySelector('title').text;
|
48
|
+
|
49
|
+
try {
|
50
|
+
const text = document.querySelector('meta[property="og:description"]').content;
|
51
|
+
} catch {
|
52
|
+
const text = '';
|
53
|
+
}
|
54
|
+
|
55
|
+
try {
|
56
|
+
const url = document.querySelector('link[rel=canonical]').href;
|
57
|
+
} catch {
|
58
|
+
const url = document.location.href;
|
59
|
+
}
|
60
|
+
|
61
|
+
const data = { title: title, text: text, url: url };
|
62
|
+
|
63
|
+
if (Navigator.canShare(data)) Navigator.share(data).then();
|
64
|
+
});
|
65
|
+
>>>>>>> 316041fe919fb439694e11d95c590f9056d52935
|
66
|
+
});
|
67
|
+
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: share-to-fediverse-jekyll-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
@@ -149,7 +149,9 @@ files:
|
|
149
149
|
- README.md
|
150
150
|
- _config.yml
|
151
151
|
- _data/en.yml
|
152
|
+
- _data/en.yml.orig
|
152
153
|
- _data/es.yml
|
154
|
+
- _data/es.yml.orig
|
153
155
|
- _data/forms/contacto.yml
|
154
156
|
- _data/forms/fediverse.yml
|
155
157
|
- _data/layouts/post.yml
|
@@ -181,6 +183,8 @@ files:
|
|
181
183
|
- _includes/predefined_array.html
|
182
184
|
- _includes/section.html
|
183
185
|
- _includes/separator.html
|
186
|
+
- _includes/share.html
|
187
|
+
- _includes/share_box.html
|
184
188
|
- _includes/string.html
|
185
189
|
- _includes/submit.html
|
186
190
|
- _includes/text.html
|
@@ -188,9 +192,17 @@ files:
|
|
188
192
|
- _layouts/default.html
|
189
193
|
- _layouts/home.html
|
190
194
|
- _layouts/post.html
|
195
|
+
- _sass/accessibility.scss
|
191
196
|
- _sass/helpers.scss
|
197
|
+
- _sass/helpers.scss.orig
|
198
|
+
- _sass/share.html
|
199
|
+
- _sass/share_box.html
|
200
|
+
- _sass/share_box.scss
|
201
|
+
- _sass/toggler.scss
|
192
202
|
- assets/css/styles.scss
|
203
|
+
- assets/css/styles.scss.orig
|
193
204
|
- assets/js/script.js
|
205
|
+
- assets/js/script.js.orig
|
194
206
|
homepage: https://0xacab.org/sutty/jekyll/share-to-fediverse-jekyll-theme
|
195
207
|
licenses:
|
196
208
|
- Nonstandard
|