Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sommerregen committed Aug 8, 2015
2 parents 2751b7a + 1ea3fbc commit 135ad7e
Show file tree
Hide file tree
Showing 11 changed files with 976 additions and 123 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
assets/logo.svg
*.xcf
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v1.3.0
## 08/08/2015

1. [](#new)
* Added admin configurations **(requires Grav 0.9.34+)**
* Added multi-language support **(requires Grav 0.9.33+)**
* Added default title message for external links
2. [](#improved)
* Switched to `onBuildPagesInitialized` event **(requires Grav 0.9.29+)**
* Updated `README.md`
3. [](#bugfix)
* Fixed [#4](https://github.com/Sommerregen/grav-plugin-external-links/issues/4) (Problem with non UTF-8 characters)

# v1.2.2
## 05/10/2015

Expand All @@ -19,9 +32,6 @@
* Allow multiple classes to exclude in option `exclude.classes`
* Improved process engine to ensure not to alter HTML tags or HTML entities in content
* Refactored code
3. [](#bugfix)
* Fixed self-closing tags in HTML5 and ensured to return contents compliant to HTML(5)
* Fixed LightSlider issue

# v1.1.3
## 02/10/2015
Expand All @@ -37,7 +47,7 @@
2. [](#improved)
* Improved usage example in README.md
3. [](#bugfix)
* Fixed issue with LightSlider plugin
* Fixed [#1](https://github.com/Sommerregen/grav-plugin-external-links/issues/4) (Issue with LightSlider plugin)

# v1.1.1
## 02/06/2015
Expand All @@ -62,7 +72,7 @@
* Improved and corrected calculations of image size
3. [](#bugfix)
* Fixed some typo in the documentation
* Fixed and removed additional <body> tag from page content
* Fixed and removed additional `<body>` tag from page content

# v1.0.1
## 01/29/2015
Expand Down
710 changes: 708 additions & 2 deletions LICENSE

Large diffs are not rendered by default.

52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# [Grav External Links Plugin][project]
# [![Grav External Links Plugin](assets/logo.png)][project]

[![Release](https://img.shields.io/github/release/sommerregen/grav-plugin-external-links.svg)][project] [![Issues](https://img.shields.io/github/issues/sommerregen/grav-plugin-external-links.svg)][issues] [![Dual license](https://img.shields.io/badge/dual%20license-MIT%2FGPL-blue.svg)](LICENSE "License") <span style="float:right;">[![Flattr](https://api.flattr.com/button/flattr-badge-large.png)][flattr] [![PayPal](https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)][paypal]</span>

> This plugin adds small icons to external and mailto links, informing users the link will take them to a new site or open their email client.
##### Table of Contents:

* [About](#about)
* [Installation and Updates](#installation-and-updates)
* [Usage](#usage)
* [Example](#example)
* [Contributing](#contributing)
* [Licencse](#license)

## About

`External Links` is a plugin for [GetGrav.org](http://getgrav.org) used to differentiate between internal and external links. It also includes the ability of adding "rel=nofollow" to links as and determines how external links shall be opened via the "target" attribute. [Wikipedia](https://www.wikipedia.org/) is a well-known example.
`External Links` is a plugin for [GetGrav.org](http://getgrav.org) used to differentiate between internal and external links. It also includes the ability of adding "rel=nofollow" to links and determines how external links shall be opened via the "target" attribute. [Wikipedia](https://www.wikipedia.org/) is a well-known example.

Furthermore it enables you to specify multiple domains, each of them on a new line to prevent them from being seen as external sites.

Expand All @@ -14,9 +25,9 @@ If you are interested in seeing this plugin in action, here is a screenshot:

## Installation and Updates

Installing or updating the `External Links` plugin can be done in one of two ways. Using the GPM (Grav Package Manager) installation method or manual install or update method by downloading [this plugin](https://github.com/sommerregen/grav-plugin-external-links) and extracting all plugin files to
Installing or updating the `External Links` plugin can be done in one of two ways. Using the GPM (Grav Package Manager) installation update method (i.e. `bin/gpm install external_links`) or manual install by downloading [this plugin](https://github.com/sommerregen/grav-plugin-external-links) and extracting all plugin files to

/your/site/grav/user/plugins/external_links
/your/site/grav/user/plugins/external_links

For more informations, please check the [Installation and update guide](docs/INSTALL.md).

Expand All @@ -26,7 +37,7 @@ The `External Links` plugin comes with some sensible default configuration, that

### Config Defaults

```
```yaml
# Global plugin configurations

enabled: true # Set to false to disable this plugin completely
Expand All @@ -44,6 +55,8 @@ exclude:
# Global and page specific configurations

process: true # Filter external links

title: true # Sets default title for external links
no_follow: true # Add rel="nofollow" to all external links
target: "_blank" # Set target attribute of link

Expand All @@ -55,9 +68,8 @@ If you need to change any value, then the best process is to copy the [external_

If you want to alter the settings for one or a few pages only, you can do so by adding page specific configurations into your page headers, e.g.

```
external_links:
process: false
```yaml
external_links: false
```
to switch off `External Links` plugin just for this page.
Expand All @@ -66,7 +78,7 @@ to switch off `External Links` plugin just for this page.

By default `External Links` adds a small icon to external or mailto links and opens by default links in a new tab. Any links in your Markdown file i.e. of the form

```
```markdown
[External Link text](http://domain.com)
or
Expand All @@ -76,21 +88,21 @@ or

will then be recognized as an external link (an icon on the right is showing up), whereas

```
```markdown
[My arcticle](my-article)
```

will not. You can exclude specific domains not to be seen as external either by adding them to the `exlcude.domains` option or by adding a class (default: `exclude`) to the desired links as in the following:

```
```markdown
[Domain without external link icon](http://my-specific-domain.com) {.exclude}
```

> Please note that **Markdown Extra** should be enabled in your `user/config/systems.yaml` via `pages.markdown.extra: true` in order to add classes to these links.

Sometimes you maybe wish to explicitly set a link to be "external". Although this should happen in really rare cases, since `External links` plugin will automatically detect external links, it is possible. Provided that **Markdown Extra** is enabled, adding the class `external` to the link will do the trick:

```
```markdown
[Always show external link icon](my-external-article) {.external}
```

Expand All @@ -100,9 +112,7 @@ Something you might want to do is to override the look and feel of the external

Copy the stylesheet [assets/css/external_links.css](assets/css/external_links.css) into the `css` folder of your custom theme, and add it to the list of CSS files.

```
/your/site/grav/user/themes/custom-theme/css/external_links.css
```
user/themes/custom-theme/css/external_links.css

After that set the `built_in_css` option of the `External Links` plugin to `false`. That's it.

Expand All @@ -121,26 +131,32 @@ You can contribute at any time! Before opening any issue, please search for exis

After that please note:

* If you find a bug or would like to make a feature request or suggest an improvement, [please open a new issue][issues]. If you have any interesting ideas for additions to the syntax please do suggest them as well!
* If you find a bug, would like to make a feature request or suggest an improvement, [please open a new issue][issues]. If you have any interesting ideas for additions to the syntax please do suggest them as well!
* Feature requests are more likely to get attention if you include a clearly described use case.
* If you wish to submit a pull request, please make again sure that your request match the [guidelines for contributing](docs/CONTRIBUTING.md) and that you keep track of adding unit tests for any new or changed functionality.

### Support and donations

If you like my project, feel free to support me via [![Flattr](https://api.flattr.com/button/flattr-badge-large.png)][flattr] or by sending me some bitcoins to **1HQdy5aBzNKNvqspiLvcmzigCq7doGfLM4**.
If you like my project, feel free to support me via [![Flattr](https://api.flattr.com/button/flattr-badge-large.png)][flattr] or by sending me some bitcoins to [**1HQdy5aBzNKNvqspiLvcmzigCq7doGfLM4**][bitcoin].

Thanks!

## License

Copyright (c) 2015 [Benjamin Regler][github]. See also the list of [contributors] who participated in this project.

[Licensed](LICENSE) for use under the terms of the [MIT license][mit-license].
[Dual-licensed](LICENSE) for use under the terms of the [MIT][mit-license] or [GPLv3][gpl-license] licenses.

![GNU license - Some rights reserved][gnu]

[github]: https://github.com/sommerregen/ "GitHub account from Benjamin Regler"
[gpl-license]: http://opensource.org/licenses/GPL-3.0 "GPLv3 license"
[mit-license]: http://www.opensource.org/licenses/mit-license.php "MIT license"

[flattr]: https://flattr.com/submit/auto?user_id=Sommerregen&url=https://github.com/sommerregen/grav-plugin-external-links "Flatter my GitHub project"
[paypal]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SYFNP82USG3RN "Donate for my GitHub project using PayPal"
[bitcoin]: bitcoin:1HQdy5aBzNKNvqspiLvcmzigCq7doGfLM4?label=GitHub%20project "Donate for my GitHub project using BitCoin"
[gnu]: https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/License_icon-gpl-88x31.svg/88px-License_icon-gpl-88x31.svg.png "GNU license - Some rights reserved"

[project]: https://github.com/sommerregen/grav-plugin-external-links
[issues]: https://github.com/sommerregen/grav-plugin-external-links/issues "GitHub Issues for Grav External Links Plugin"
Expand Down
23 changes: 23 additions & 0 deletions assets/css/external_links.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
a.external-link.icon, a.external-link.no-image, a.external, a.external {
background: url(../images/link.png) right center no-repeat;
padding-right: 12px;
position: relative;
}
a.mailto {
background: url(../images/mail.png) right center no-repeat;
padding-right: 12px;
}

.external-link[data-title]:after {
background-color: #444;
color: #fff;
content: attr(data-title);
display: inline;
font-size: xx-small;
font-weight: bold;
margin: -1em 0 0 16px;
min-width: 45em;
opacity: 0;
padding: .25em .5em;
position: absolute;
top: 50%;
transition: all 1s ease-in-out 1s;
visibility: hidden;
}

.external-link[data-title]:hover:after {
opacity: 1;
visibility: visible;
}

/* Hide link or mailto icons when printing. */
@media print {
a.external, a.external-link, a.mailto {
Expand Down
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 135ad7e

Please sign in to comment.