photish 0.2.0 → 0.2.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065983f865e77de75e2248edfe93374ec4d1fe10
|
4
|
+
data.tar.gz: 07eeac3a6faf3131980227b61cc2fcb4ccdfc690
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ca0b8fe9f7c0ab35bd28c369fbfc53fcf269e2107a39bfc9649270304bbb2984de91a31e60c9289312af4710f9b3491fced3bcb2a5f6e85c774ec60a63214e4
|
7
|
+
data.tar.gz: 78e3cb4c65245c584a76a63d82bd8a8730ec62747a0084dc9667fd069d18019fd6432d2fa7195dc949abe101134762ad0aa66e810a27b2025e5ffb90a50c4c1f
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module Photish::Plugin::FooterLinks
|
4
|
+
|
5
|
+
def self.is_for?(type)
|
6
|
+
[
|
7
|
+
Photish::Plugin::Type::Collection,
|
8
|
+
Photish::Plugin::Type::Album,
|
9
|
+
Photish::Plugin::Type::Photo,
|
10
|
+
Photish::Plugin::Type::Image
|
11
|
+
].include?(type)
|
12
|
+
end
|
13
|
+
|
14
|
+
def links_with_seperator(links, seperator)
|
15
|
+
doc = Nokogiri::HTML::DocumentFragment.parse("")
|
16
|
+
Nokogiri::HTML::Builder.with(doc) do |doc|
|
17
|
+
links.each_with_index do |link, index|
|
18
|
+
if index == (links.count - 1)
|
19
|
+
text = link[:text]
|
20
|
+
else
|
21
|
+
text = "#{link[:text]} #{seperator} "
|
22
|
+
end
|
23
|
+
|
24
|
+
doc.a(text, href: link[:url])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
doc.to_html
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def text(link_text, seperator)
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
@@ -13,8 +13,5 @@ html
|
|
13
13
|
== yield
|
14
14
|
div.footer
|
15
15
|
| Site assets:
|
16
|
-
|
17
|
-
|
18
|
-
| |
|
19
|
-
a href="/styles/basic.css"
|
20
|
-
| CSS Download
|
16
|
+
== links_with_seperator([{text: 'My Custom Page', url: '/custom.html'},
|
17
|
+
{text: 'CSS Download', url: '/styles/basic.css'}], '|')
|
@@ -15,8 +15,8 @@ module Photish
|
|
15
15
|
Photish::Log::Logger.instance.setup_logging(config)
|
16
16
|
|
17
17
|
log_important_config_values
|
18
|
-
log_album_and_photo_names
|
19
18
|
load_all_plugins
|
19
|
+
log_album_and_photo_names
|
20
20
|
render_whole_site
|
21
21
|
log.info 'Site generation completed successfully'
|
22
22
|
end
|
data/lib/photish/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: photish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Lawson
|
@@ -327,6 +327,7 @@ files:
|
|
327
327
|
- lib/photish/assets/photos/Small Dogs/Sleepy Dog.jpg
|
328
328
|
- lib/photish/assets/photos/Small Dogs/Sleepy Dog.yml
|
329
329
|
- lib/photish/assets/photos/Small Dogs/Squishy Dogs/Big Ear Dog.jpg
|
330
|
+
- lib/photish/assets/site/_plugins/footer_links.rb
|
330
331
|
- lib/photish/assets/site/_plugins/yell_loud.rb
|
331
332
|
- lib/photish/assets/site/_templates/album.slim
|
332
333
|
- lib/photish/assets/site/_templates/collection.slim
|