Skip to content

Commit

Permalink
Added option to include Font Awesome 5.1.0 if required.
Browse files Browse the repository at this point in the history
- Option to include Font Awesome 5.1.0 (default true).
- Some small CSS fixes.
  • Loading branch information
AmauryCarrade committed Jul 7, 2018
1 parent 4987cf2 commit 84c88fa
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# v1.0.1
## 07-07-2018

1. [](#bugfix)
* Fixes broken icons if the template does not provide Font Awesome 5.1.0+.
* Small CSS fixes on the default theme (and every theme, for that matter).

# v1.0.0
## 07/07/2018
## 07-07-2018

1. [](#new)
* First version
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ enabled: true
built_in_css: true
built_in_js: true

# If your theme does not provide Font Awesome 5, required for
# the default embeds to work, check this.
include_font_awesome_5: true

# The plugin can download images, videos, and GIFs, to ensure a
# complete independence from the social networks, at the cost of
# some disk space.
Expand Down
2 changes: 1 addition & 1 deletion assets/css-compiled/sse.min.css

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion assets/scss/sse/_twitter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@

.sse-status-network-icon {
align-self: start;
font-size: 1.8rem;
color: $twitter-blue;
}
}
Expand Down Expand Up @@ -307,7 +308,7 @@
figure.sse-quoted-tweet-image {
width: 16rem;

margin: 0 0 .8rem .8rem;
margin: .8rem 0 .8rem .8rem;

@include mobile {
margin: 0;
Expand All @@ -316,6 +317,7 @@

img {
width: 100%;
position: initial;
}

& + .sse-quoted-tweet-content {
Expand Down
15 changes: 13 additions & 2 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Static Social Embeds
version: 1.0.0
version: 1.0.1
description: |
Embeds social status (like tweets, instagram posts, toots, etc.) in articles without using their embed iframe,
but rather statically without any dependency to the service.
Expand Down Expand Up @@ -47,7 +47,7 @@ form:
type: bool
built_in_js:
type: toggle
label: PLUGIN_SSE.ADMIN.MAIN.BUILT_IN_js.LABEL
label: PLUGIN_SSE.ADMIN.MAIN.BUILT_IN_JS.LABEL
help: PLUGIN_SSE.ADMIN.MAIN.BUILT_IN_JS.HELP
highlight: 1
default: 1
Expand All @@ -56,6 +56,17 @@ form:
0: PLUGIN_ADMIN.NO
validate:
type: bool
include_font_awesome_5:
type: toggle
label: PLUGIN_SSE.ADMIN.MAIN.INCLUDE_FONT_AWESOME_5.LABEL
help: PLUGIN_SSE.ADMIN.MAIN.INCLUDE_FONT_AWESOME_5.HELP
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
section_downloads:
type: section
title: PLUGIN_SSE.ADMIN.DOWNLOADS.TITLE
Expand Down
9 changes: 6 additions & 3 deletions languages/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ PLUGIN_SSE:
TITLE: Main Settings
ENABLED: Plugin status
BUILT_IN_CSS:
LABEL: Use the built-in CSS
LABEL: Use the built-in CSS?
HELP: If disabled, you or your theme will have to supply CSS for this plugin. You can check out the built-in CSS for inspiration.
BUILT_IN_js:
LABEL: Use the built-in JS
BUILT_IN_JS:
LABEL: Use the built-in JS?
HELP: If disabled, you or your theme will have to supply JS for this plugin. You can check out the built-in JS for inspiration.
INCLUDE_FONT_AWESOME_5:
LABEL: Include Font Awesome 5?
HELP: Default embeds require Font Awesome 5.1.0 or newer. Disable this option if your theme provides Font Awesome 5.1.0+ or if you use custom embeds and don't need that.
DOWNLOADS:
TITLE: Download Options
HELP_1: |
Expand Down
7 changes: 6 additions & 1 deletion languages/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@ PLUGIN_SSE:
BUILT_IN_CSS:
LABEL: Utiliser le CSS intégré ?
HELP: Si désactivé, votre thème devra fournir le CSS nécessaire. Vous pouvez consulter le CSS inclu pour inspiration.
BUILT_IN_js:
BUILT_IN_JS:
LABEL: Utiliser le Javascript intégré ?
HELP: Si désactivé, votre thème devra fournir le javascript nécessaire. Vous pouvez consulter le javascript inclu pour inspiration.
INCLUDE_FONT_AWESOME_5:
LABEL: Inclure Font Awesome 5 ?
HELP: |
Les intégrations par défaut dépendent de Font Awesome version 5.1.0 ou plus récent.
Désactivez cette option si votre thème fournit Font Awesome 5.1.0+, ou si vous utilisez des gabaris personnalisées et que vous n'en avez pas besoin.
DOWNLOADS:
TITLE: Options de téléchargement
HELP_1: |
Expand Down
5 changes: 5 additions & 0 deletions static-social-embeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public function onTwigTemplatePaths()
*/
public function onAssetsInitialized()
{
if ($this->config->get('plugins.static-social-embeds.include_font_awesome_5', true))
{
$this->grav['assets']->add('https://use.fontawesome.com/releases/v5.1.0/css/all.css');
}

if ($this->config->get('plugins.static-social-embeds.use_built_in_css', true))
{
$this->grav['assets']->add('plugin://static-social-embeds/assets/css-compiled/sse.min.css', 4);
Expand Down
4 changes: 4 additions & 0 deletions static-social-embeds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ enabled: true
built_in_css: true
built_in_js: true

# If your theme does not provide Font Awesome 5, required for
# the default embeds to work, check this.
include_font_awesome_5: true

# The plugin can download images, videos, and GIFs, to ensure a
# complete independence from the social networks, at the cost of
# some disk space.
Expand Down

0 comments on commit 84c88fa

Please sign in to comment.