jekyll-pizzaforukraine 1.0.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 +7 -0
- data/.gitignore +11 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +57 -0
- data/Rakefile +1 -0
- data/jekyll-pizzaforukraine.gemspec +23 -0
- data/lib/jekyll-pizzaforukraine/version.rb +5 -0
- data/lib/jekyll-pizzaforukraine.rb +38 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 86077720bda0939f3e2747a7907af6aa45cf824ef677de89b23627860a0e1363
|
4
|
+
data.tar.gz: a017e546905b46a14e89d259bf6ebefe765ab67e39bc1bceec09651d4923f9bc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f98c5d865dba4afae93cf284440eda1576ca440a586e44af2f3b71c7d8fa7b66cd7acb7271ec3c9d4e3cb790766543843f2d3f75432c8d2aef88dc335afc41b4
|
7
|
+
data.tar.gz: 8a1091d727c1fd5ce33562fddb01f351c22b56daea50efb6e9621d0363dee859e7baafc4679c45f673a5615f4f859bb243d1f14ea7bc409fffa12fa66a5cc3c3
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Dommmel
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Jekyll Pizza for Ukraine
|
2
|
+
|
3
|
+
This Jekyll plugin provides a tag that requests a random picture from the Pizza For Ukraine random picture api and generates a (responsive) html snippet to embed the picture into your site; honestly this tool is fine tuned for [fuzzyblog](https://fuzzyblog.io/blog/). I'm happy to extend it; contact me if it doesn't meet your needs.
|
4
|
+
|
5
|
+
**Note**: This plugin was written by taking [dommmel's jekyll youtube plugin](https://github.com/dommmel/jekyll-youtube) and customizing it for a random picture inserter. Any errors are mine not theirs and I appreciate the bootstrap that jekyll youtube gave me.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
group :jekyll_plugins do
|
13
|
+
gem "jekyll-pizzaforukraine"
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Alternatively install the gem yourself as:
|
22
|
+
|
23
|
+
$ gem install jekyll-pizzaforukraine
|
24
|
+
|
25
|
+
and put this in your ``_config.yml``
|
26
|
+
|
27
|
+
```yaml
|
28
|
+
plugins: [jekyll-pizzaforukraine]
|
29
|
+
# This will require each of these gems automatically.
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
Embed it as a tag where you want an image to come out:
|
35
|
+
|
36
|
+
```
|
37
|
+
{% pizzaforukraine %}
|
38
|
+
```
|
39
|
+
|
40
|
+
## Result
|
41
|
+
|
42
|
+
By default the plugin will output the following code
|
43
|
+
|
44
|
+
|
45
|
+
```markup
|
46
|
+
{:.center}
|
47
|
+

|
48
|
+
|
49
|
+
{:.center}
|
50
|
+
Pizza courtesy of Pizza for Ukraine!
|
51
|
+
|
52
|
+
{:.center}
|
53
|
+
[Donate Now to Pizza for Ukraine](https://www.pizzaforukraine.com/)
|
54
|
+
|
55
|
+
|
56
|
+
```
|
57
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jekyll-pizzaforukraine/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jekyll-pizzaforukraine"
|
8
|
+
spec.version = Jekyll::PizzaForUkraine::VERSION
|
9
|
+
spec.authors = ["Scott Johnson"]
|
10
|
+
spec.email = ["fuzzygroup@gmail@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{jekyll plugin to generate html snippets for embedding Pizza for Ukraine random pictures}
|
13
|
+
spec.description = %q{jekyll plugin to generate html snippets for embedding Pizza for Ukraine random pictures}
|
14
|
+
spec.homepage = "https://github.com/fuzzygroup/jekyll-pizzaforukraine"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
#spec.add_dependency 'jekyll'
|
21
|
+
spec.add_development_dependency "bundler"#, "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake"#, "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "jekyll"
|
2
|
+
require "jekyll-pizzaforukraine/version"
|
3
|
+
class pizzaforukraineEmbed < Liquid::Tag
|
4
|
+
|
5
|
+
def initialize(tagName, content, tokens)
|
6
|
+
super
|
7
|
+
@content = content
|
8
|
+
end
|
9
|
+
|
10
|
+
def render(context)
|
11
|
+
picture_api = "https://pizzaforukraine.com/api/randompic"
|
12
|
+
|
13
|
+
@random_picture_url = Net::HTTP.get(URI.parse(picture_api))
|
14
|
+
|
15
|
+
# TODO; left in place for future extensibility
|
16
|
+
tmpl_path = File.join Dir.pwd, "_includes", "youtube.html"
|
17
|
+
if 3 == 4 && File.exist?(tmpl_path)
|
18
|
+
tmpl = File.read tmpl_path
|
19
|
+
site = context.registers[:site]
|
20
|
+
tmpl = (Liquid::Template.parse tmpl).render site.site_payload.merge!({"youtube_id" => @youtube_id})
|
21
|
+
else
|
22
|
+
%Q{
|
23
|
+
{:.center}
|
24
|
+
|
25
|
+
{:.center}
|
26
|
+
Pizza courtesy of Pizza for Ukraine!
|
27
|
+
|
28
|
+
{:.center}
|
29
|
+
[Donate Now to Pizza for Ukraine](https://www.pizzaforukraine.com/)
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
Liquid::Template.register_tag "pizzaforukraine", self
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-pizzaforukraine
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Scott Johnson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: jekyll plugin to generate html snippets for embedding Pizza for Ukraine
|
42
|
+
random pictures
|
43
|
+
email:
|
44
|
+
- fuzzygroup@gmail@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- jekyll-pizzaforukraine.gemspec
|
55
|
+
- lib/jekyll-pizzaforukraine.rb
|
56
|
+
- lib/jekyll-pizzaforukraine/version.rb
|
57
|
+
homepage: https://github.com/fuzzygroup/jekyll-pizzaforukraine
|
58
|
+
licenses:
|
59
|
+
- MIT
|
60
|
+
metadata: {}
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubygems_version: 3.3.7
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: jekyll plugin to generate html snippets for embedding Pizza for Ukraine random
|
80
|
+
pictures
|
81
|
+
test_files: []
|