jekyll-archive_link 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -11
- data/lib/jekyll/archive_link/tag.rb +8 -5
- data/lib/jekyll/archive_link/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d5d61c4cd35701985b111f753162f940b57a81d5a6264b25bade14187a4584c
|
4
|
+
data.tar.gz: 3789d323705fe039d2e62b980674a9ddaf88c4f1ebdba3264a04997bf04dfde4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7416790b693267f62d3437064cc0690d67bfb8d7fe21792c929ff908621eda5731bc037f499c99abe9469ec0f0f1d19f0984d9d16bddbe15916a19cb8f426c4
|
7
|
+
data.tar.gz: 3cc5b52b1c9903b63f97042da5d0f7f8b99631852998fe5c105cb69fa701d72d1d72261251338930ab1593e6b989a0d0ba61414472d3d76f14d3942fa626cc22
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,36 @@
|
|
1
|
-
# Jekyll::
|
1
|
+
# Jekyll::ArchiveLink
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Adds [InternetArchive Wayback Machine](https://archive.org) links for a given URL. Useful for preserving access to content on other sites that you do not control.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
10
8
|
|
11
9
|
```ruby
|
12
|
-
|
10
|
+
group :jekyll_plugins do
|
11
|
+
gem 'jekyll-archive_link'
|
12
|
+
end
|
13
13
|
```
|
14
14
|
|
15
|
-
|
15
|
+
Install via `$ bundle install`.
|
16
16
|
|
17
|
-
|
17
|
+
And then add this line to your Jekyll config file:
|
18
18
|
|
19
|
-
|
19
|
+
``` yaml
|
20
|
+
plugins:
|
21
|
+
- jekyll-archive_link
|
22
|
+
```
|
20
23
|
|
21
|
-
$ gem install jekyll-archive-link
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
To add an archive link to your Jekyll pages, embed the following view tag:
|
28
|
+
|
29
|
+
``` liquid
|
30
|
+
{% archive_url_link click me %}
|
31
|
+
{{ page.content_url }} <!-- Whatever attribute you use to define URLs -->
|
32
|
+
{% endarchive_url_link %}
|
33
|
+
```
|
26
34
|
|
27
35
|
## Development
|
28
36
|
|
@@ -32,7 +40,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
40
|
|
33
41
|
## Contributing
|
34
42
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
43
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bodacious/jekyll-archive_link.
|
36
44
|
|
37
45
|
## License
|
38
46
|
|
@@ -5,15 +5,18 @@ module Jekyll
|
|
5
5
|
require "liquid"
|
6
6
|
require_relative "url"
|
7
7
|
class Tag < Liquid::Block
|
8
|
-
attr_reader :url
|
8
|
+
attr_reader :link_text, :url
|
9
|
+
|
10
|
+
def initialize(tag_name, link_text, tokens)
|
11
|
+
super
|
12
|
+
@link_text = link_text
|
13
|
+
end
|
9
14
|
|
10
15
|
def render(context)
|
11
|
-
@url = super.to_s.strip
|
16
|
+
@url = super(context).to_s.strip
|
12
17
|
Jekyll::ArchiveLink.debug("Render called: #{@url}")
|
13
18
|
|
14
|
-
|
15
|
-
<a href="#{archive_url}">Archive link</a>
|
16
|
-
HTML
|
19
|
+
%[<a href="#{archive_url}">#{link_text}</a>]
|
17
20
|
end
|
18
21
|
|
19
22
|
def archive_url
|