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: d39b760e4b3dd56a1feefd2aa4149d8e8f8f8b20
4
- data.tar.gz: 721fc210a9c59c7bb43acbccedc3d2802bc9c3d5
3
+ metadata.gz: 065983f865e77de75e2248edfe93374ec4d1fe10
4
+ data.tar.gz: 07eeac3a6faf3131980227b61cc2fcb4ccdfc690
5
5
  SHA512:
6
- metadata.gz: 495b94ebf70ea1ed448cb4043382e3e6fe89778538c6a6640c453c595427fafba5cdd6e67b9f758d3fabe235b6b3a9dabd1664c462f0cee3f00f4c10b58c1a01
7
- data.tar.gz: 07827e7468ba84db98ff8021a0828a38dc7e2cf94957cfd62da379944a1cf4c3f779361305992c775117ec74f022cbed80bbfa59fe10d660930111833d7a9cd5
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
- a href="/custom.html"
17
- | My Custom Page
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'}], '|')
@@ -18,7 +18,7 @@ module Photish
18
18
  Photish::Command::Host.new(options).execute
19
19
  end
20
20
 
21
- desc "init", "Creates a basic Photish site sctructure"
21
+ desc "init", "Creates a basic Photish site structure"
22
22
  def init
23
23
  Photish::Command::Init.new(options).execute
24
24
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Photish
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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