bookends 0.6.0 → 2.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 +4 -4
- data/.gitignore +3 -0
- data/README.md +28 -24
- data/Rakefile +7 -3
- data/bin/bookends +5 -0
- data/bookends.gemspec +5 -2
- data/fixtures/dummy-jekyll/README.md +64 -0
- data/fixtures/dummy-jekyll/_config.yml +8 -0
- data/fixtures/dummy-jekyll/_layouts/default.html +118 -0
- data/fixtures/dummy-jekyll/_layouts/post.html +14 -0
- data/fixtures/dummy-jekyll/_sass/_base.scss +478 -0
- data/fixtures/dummy-jekyll/_sass/_google-cse.scss +372 -0
- data/fixtures/dummy-jekyll/_sass/_header.scss +780 -0
- data/fixtures/dummy-jekyll/_sass/_legacy.scss +567 -0
- data/fixtures/dummy-jekyll/_sass/_menu-icon.scss +68 -0
- data/fixtures/dummy-jekyll/_sass/_mixins.scss +12 -0
- data/fixtures/dummy-jekyll/_sass/_search.scss +51 -0
- data/{lib/generators/bookends/install/templates/footer.scss → fixtures/dummy-jekyll/_sass/bookends/_footer.scss} +0 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_background-image.scss +48 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_border-radius.scss +22 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_box-sizing.scss +4 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_hide-text.scss +5 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_hidpi.scss +10 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_linear-gradient.scss +41 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_prefixer.scss +49 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_responsiveness.scss +129 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_retina-image.scss +31 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_size.scss +44 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_transition.scss +34 -0
- data/fixtures/dummy-jekyll/_sass/mixins/_triangle.scss +45 -0
- data/fixtures/dummy-jekyll/app.json +15 -0
- data/fixtures/dummy-jekyll/bin/from-gdoc +3 -0
- data/fixtures/dummy-jekyll/bin/platform-setup +15 -0
- data/fixtures/dummy-jekyll/feed.xml +34 -0
- data/fixtures/dummy-jekyll/index.html +40 -0
- data/fixtures/dummy-jekyll/static.json +3 -0
- data/fixtures/dummy-rails/README.md +9 -0
- data/fixtures/dummy-rails/Rakefile +6 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-book.eot +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-book.svg +400 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-book.ttf +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-book.woff +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-medium.eot +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-medium.svg +416 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-medium.ttf +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-medium.woff +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-regular.eot +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-regular.svg +416 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-regular.ttf +0 -0
- data/fixtures/dummy-rails/app/assets/fonts/bentonsans-regular.woff +0 -0
- data/fixtures/dummy-rails/app/assets/images/.keep +0 -0
- data/{lib/generators/bookends/install/templates/footer_images → fixtures/dummy-rails/app/assets/images/bookends/footer}/footer_sprite.png +0 -0
- data/{lib/generators/bookends/install/templates/footer_images → fixtures/dummy-rails/app/assets/images/bookends/footer}/footer_sprite@2x.png +0 -0
- data/{lib/generators/bookends/install/templates/footer_images → fixtures/dummy-rails/app/assets/images/bookends/footer}/salesforce_heroku_gray.png +0 -0
- data/fixtures/dummy-rails/app/assets/javascripts/application.js +15 -0
- data/fixtures/dummy-rails/app/assets/stylesheets/application.css.scss +11 -0
- data/fixtures/dummy-rails/app/controllers/application_controller.rb +5 -0
- data/fixtures/dummy-rails/app/controllers/concerns/.keep +0 -0
- data/fixtures/dummy-rails/app/controllers/pages_controller.rb +5 -0
- data/fixtures/dummy-rails/app/helpers/application_helper.rb +2 -0
- data/fixtures/dummy-rails/app/mailers/.keep +0 -0
- data/fixtures/dummy-rails/app/models/.keep +0 -0
- data/fixtures/dummy-rails/app/models/concerns/.keep +0 -0
- data/fixtures/dummy-rails/app/views/layouts/application.html.erb +16 -0
- data/fixtures/dummy-rails/app/views/pages/home.html.erb +1 -0
- data/fixtures/dummy-rails/bin/bundle +3 -0
- data/fixtures/dummy-rails/bin/rails +4 -0
- data/fixtures/dummy-rails/bin/rake +4 -0
- data/fixtures/dummy-rails/bin/setup +29 -0
- data/fixtures/dummy-rails/config/application.rb +34 -0
- data/fixtures/dummy-rails/config/boot.rb +5 -0
- data/fixtures/dummy-rails/config/database.yml +25 -0
- data/fixtures/dummy-rails/config/environment.rb +5 -0
- data/fixtures/dummy-rails/config/environments/development.rb +41 -0
- data/fixtures/dummy-rails/config/environments/production.rb +79 -0
- data/fixtures/dummy-rails/config/environments/test.rb +42 -0
- data/fixtures/dummy-rails/config/initializers/assets.rb +11 -0
- data/fixtures/dummy-rails/config/initializers/backtrace_silencers.rb +7 -0
- data/fixtures/dummy-rails/config/initializers/cookies_serializer.rb +3 -0
- data/fixtures/dummy-rails/config/initializers/filter_parameter_logging.rb +4 -0
- data/fixtures/dummy-rails/config/initializers/inflections.rb +16 -0
- data/fixtures/dummy-rails/config/initializers/mime_types.rb +4 -0
- data/fixtures/dummy-rails/config/initializers/session_store.rb +3 -0
- data/fixtures/dummy-rails/config/initializers/wrap_parameters.rb +14 -0
- data/fixtures/dummy-rails/config/locales/en.yml +23 -0
- data/fixtures/dummy-rails/config/routes.rb +6 -0
- data/fixtures/dummy-rails/config/secrets.yml +22 -0
- data/fixtures/dummy-rails/config.ru +4 -0
- data/fixtures/dummy-rails/db/development.sqlite3 +0 -0
- data/fixtures/dummy-rails/lib/assets/.keep +0 -0
- data/fixtures/dummy-rails/log/.keep +0 -0
- data/fixtures/dummy-rails/log/development.log +1893 -0
- data/fixtures/dummy-rails/public/404.html +67 -0
- data/fixtures/dummy-rails/public/422.html +67 -0
- data/fixtures/dummy-rails/public/500.html +66 -0
- data/fixtures/dummy-rails/public/favicon.ico +0 -0
- data/lib/bookends/cli.rb +88 -0
- data/lib/bookends/config/framework.rb +24 -0
- data/lib/bookends/config/turbolinks.rb +18 -0
- data/lib/bookends/file_actions.rb +13 -0
- data/lib/bookends/jekyll_handler.rb +21 -0
- data/lib/bookends/rails_handler.rb +30 -0
- data/lib/{generators/bookends/install/templates/footer.html.erb → bookends/templates/footer.html} +18 -18
- data/lib/bookends/templates/footer.scss +403 -0
- data/lib/bookends/templates/footer_images/footer_sprite.png +0 -0
- data/lib/bookends/templates/footer_images/footer_sprite@2x.png +0 -0
- data/lib/bookends/templates/footer_images/salesforce.png +0 -0
- data/lib/bookends/templates/newsletter-init-turbolinks.js +6 -0
- data/lib/bookends/templates/newsletter-init.js +6 -0
- data/lib/{generators/bookends/install → bookends}/templates/newsletter.js +0 -4
- data/lib/bookends/version.rb +1 -1
- data/lib/bookends.rb +1 -1
- metadata +138 -11
- data/lib/generators/bookends/install/install_generator.rb +0 -21
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body>
|
|
58
|
+
<!-- This file lives in public/404.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
|
63
|
+
</div>
|
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
+
</div>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body>
|
|
58
|
+
<!-- This file lives in public/422.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
63
|
+
</div>
|
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
+
</div>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body>
|
|
58
|
+
<!-- This file lives in public/500.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
|
62
|
+
</div>
|
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
64
|
+
</div>
|
|
65
|
+
</body>
|
|
66
|
+
</html>
|
|
File without changes
|
data/lib/bookends/cli.rb
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
require 'bookends'
|
|
2
|
+
require 'thor'
|
|
3
|
+
require 'ostruct'
|
|
4
|
+
|
|
5
|
+
require_relative 'rails_handler'
|
|
6
|
+
require_relative 'jekyll_handler'
|
|
7
|
+
require_relative 'config/framework'
|
|
8
|
+
require_relative 'config/turbolinks'
|
|
9
|
+
|
|
10
|
+
module Bookends
|
|
11
|
+
class CLI < Thor
|
|
12
|
+
at_exit { puts "\nThank you for using Bookends v#{Bookends::VERSION}" }
|
|
13
|
+
@@post_install_messages = ["\n", "\n"]
|
|
14
|
+
|
|
15
|
+
desc "install", "installs bookends"
|
|
16
|
+
def install
|
|
17
|
+
ask_for_framework
|
|
18
|
+
ask_about_turbolinks if rails?
|
|
19
|
+
move_files
|
|
20
|
+
puts @@post_install_messages
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
def move_files
|
|
26
|
+
self.send "handle_#{config.framework.get}"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def handle_rails
|
|
30
|
+
add_rails_post_install_messages
|
|
31
|
+
Bookends::RailsHandler.new.install(config)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def handle_jekyll
|
|
35
|
+
add_jekyll_post_install_messages
|
|
36
|
+
Bookends::JekyllHandler.new.install
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def ask_about_turbolinks
|
|
40
|
+
if yes? 'Are you using Turbolinks? [y/n]'
|
|
41
|
+
config.turbolinks.set true
|
|
42
|
+
else
|
|
43
|
+
config.turbolinks.set false
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def ask_for_framework
|
|
48
|
+
if yes? 'Are you using Ruby on Rails? [y/n]'
|
|
49
|
+
config.framework.set :rails
|
|
50
|
+
elsif yes? 'Are you using Jekyll? [y/n]'
|
|
51
|
+
config.framework.set :jekyll
|
|
52
|
+
else
|
|
53
|
+
say 'Bookends only supports Ruby on Rails and Jekyll right now; sorry'
|
|
54
|
+
exit
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def config
|
|
59
|
+
@config ||= OpenStruct.new(
|
|
60
|
+
framework: Bookends::Config::Framework.new,
|
|
61
|
+
turbolinks: Bookends::Config::Turbolinks.new
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def rails?
|
|
66
|
+
config.framework.rails?
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def add_rails_post_install_messages
|
|
70
|
+
add_to_post_install_messages([
|
|
71
|
+
"add <%= render 'bookends/footer' %> to your layout file",
|
|
72
|
+
"add @import 'bookends/footer'; to your stylesheet",
|
|
73
|
+
"add //= require bookends/newsletter-init"
|
|
74
|
+
])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def add_jekyll_post_install_messages
|
|
78
|
+
add_to_post_install_messages([
|
|
79
|
+
'make sure <script src="/assets/js/bookends/newsletter.js"></script> is in body-close.html',
|
|
80
|
+
"add @import 'bookends/footer'; to _base.scss"
|
|
81
|
+
])
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def add_to_post_install_messages(collection)
|
|
85
|
+
collection.map { |msg| @@post_install_messages << msg }
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Bookends
|
|
2
|
+
module Config
|
|
3
|
+
class Framework
|
|
4
|
+
|
|
5
|
+
attr_accessor :framework
|
|
6
|
+
|
|
7
|
+
def set(framework)
|
|
8
|
+
self.framework = framework
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def get
|
|
12
|
+
framework
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def rails?
|
|
16
|
+
framework == :rails
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def jekyll?
|
|
20
|
+
framework == :jekyll
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Bookends
|
|
2
|
+
module Config
|
|
3
|
+
class Turbolinks
|
|
4
|
+
|
|
5
|
+
attr_accessor :turbolinks
|
|
6
|
+
|
|
7
|
+
#turbolinks<boolean> => does site in question use turbolinks?
|
|
8
|
+
def set(turbolinks)
|
|
9
|
+
self.turbolinks = turbolinks
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def using?
|
|
13
|
+
!!turbolinks
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module FileActions
|
|
2
|
+
private
|
|
3
|
+
def copy(type, name:, dest:, **options)
|
|
4
|
+
self.destination_root = dest
|
|
5
|
+
name_in_dest = options.fetch(:name_in_dest, name)
|
|
6
|
+
|
|
7
|
+
if type == :file
|
|
8
|
+
copy_file name, name_in_dest
|
|
9
|
+
else
|
|
10
|
+
directory name, name_in_dest
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'bookends'
|
|
2
|
+
require 'thor'
|
|
3
|
+
require_relative 'file_actions'
|
|
4
|
+
|
|
5
|
+
module Bookends
|
|
6
|
+
class JekyllHandler < Thor
|
|
7
|
+
include FileActions
|
|
8
|
+
include Thor::Actions
|
|
9
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
|
10
|
+
|
|
11
|
+
no_commands do
|
|
12
|
+
def install
|
|
13
|
+
copy :file, name: 'footer.scss', dest: '_sass/bookends', name_in_dest: '_footer.scss'
|
|
14
|
+
copy :file, name: 'footer.html', dest: '_includes/bookends'
|
|
15
|
+
copy :file, name: 'newsletter.js', dest: 'assets/js/bookends/'
|
|
16
|
+
copy :directory, name: 'footer_images', dest: 'assets/images/', name_in_dest: 'bookends/footer'
|
|
17
|
+
append_to_file '../js/bookends/newsletter.js', "$(function() { return window.Heroku.newsletterSignup = new Heroku.NewsletterSignup(); });"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'bookends'
|
|
2
|
+
require 'thor'
|
|
3
|
+
require_relative 'file_actions'
|
|
4
|
+
|
|
5
|
+
module Bookends
|
|
6
|
+
class RailsHandler < Thor
|
|
7
|
+
include FileActions
|
|
8
|
+
include Thor::Actions
|
|
9
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
|
10
|
+
|
|
11
|
+
no_commands do
|
|
12
|
+
def install(config)
|
|
13
|
+
copy :file, name: 'footer.scss', dest: 'app/assets/stylesheets/bookends', name_in_dest: '_footer.scss'
|
|
14
|
+
copy :file, name: 'footer.html', dest: 'app/views/bookends', name_in_dest: '_footer.html'
|
|
15
|
+
copy :file, name: 'newsletter.js', dest: 'vendor/assets/javascripts/bookends'
|
|
16
|
+
copy :directory, name: 'footer_images', dest: 'app/assets/images/', name_in_dest: 'bookends/footer'
|
|
17
|
+
handle_templates_for_config(config)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
def handle_templates_for_config(config)
|
|
23
|
+
if config.turbolinks.using?
|
|
24
|
+
copy :file, name: 'newsletter-init-turbolinks.js', dest: 'app/assets/javascripts/bookends', name_in_dest: 'newsletter-init.js'
|
|
25
|
+
else
|
|
26
|
+
copy :file, name: 'newsletter-init.js', dest: 'app/assets/javascripts/bookends'
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/{generators/bookends/install/templates/footer.html.erb → bookends/templates/footer.html}
RENAMED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<nav class="col">
|
|
5
5
|
<h4>Products</h4>
|
|
6
6
|
<ul>
|
|
7
|
-
<li
|
|
8
|
-
<li
|
|
9
|
-
<li
|
|
10
|
-
<li
|
|
11
|
-
<li
|
|
7
|
+
<li><a href="https://www.heroku.com/platform">Heroku Platform</a></li>
|
|
8
|
+
<li><a href="https://www.heroku.com/connect">Heroku Connect</a></li>
|
|
9
|
+
<li><a href="https://www.heroku.com/postgres">Heroku Postgres</a></li>
|
|
10
|
+
<li><a href="https://www.heroku.com/redis">Heroku Redis</a></li>
|
|
11
|
+
<li><a href="https://www.heroku.com/enterprise">Heroku Enterprise</a></li>
|
|
12
12
|
<li><a href="https://elements.heroku.com/">Elements Marketplace</a></li>
|
|
13
|
-
<li
|
|
13
|
+
<li><a href="https://www.heroku.com/pricing">Pricing</a></li>
|
|
14
14
|
</ul>
|
|
15
15
|
</nav>
|
|
16
16
|
<nav class="col">
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
<nav class="col">
|
|
25
25
|
<h4>About</h4>
|
|
26
26
|
<ul>
|
|
27
|
-
<li
|
|
28
|
-
<li
|
|
29
|
-
<li
|
|
30
|
-
<li
|
|
27
|
+
<li><a href="https://www.heroku.com/about">About Us</a></li>
|
|
28
|
+
<li><a href="https://www.heroku.com/what">What is Heroku</a></li>
|
|
29
|
+
<li><a href="https://www.heroku.com/customers">Our Customers</a></li>
|
|
30
|
+
<li><a href="https://www.heroku.com/careers">Careers</a></li>
|
|
31
31
|
<li><a href="https://partners.heroku.com/">Partners</a></li>
|
|
32
32
|
</ul>
|
|
33
33
|
</nav>
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
<ul>
|
|
37
37
|
<li><a href="https://help.heroku.com/">Help</a></li>
|
|
38
38
|
<li><a href="https://status.heroku.com/">Status</a></li>
|
|
39
|
-
<li
|
|
40
|
-
<li
|
|
39
|
+
<li><a href="https://www.heroku.com/critical">Critical Apps</a></li>
|
|
40
|
+
<li><a href="https://www.heroku.com/contact">Contact</a></li>
|
|
41
41
|
</ul>
|
|
42
42
|
</nav>
|
|
43
43
|
</div>
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
<div class="tertiary">
|
|
63
63
|
<div class="wrapper">
|
|
64
64
|
<div class="col">
|
|
65
|
-
<a href=
|
|
66
|
-
<p>© 2015 Salesforce.com</p>
|
|
65
|
+
<a href="https://www.heroku.com/home" title="heroku.com" class="sfdc-logo">Heroku is a <span></span> company</a>
|
|
67
66
|
</div>
|
|
68
67
|
<div class="col">
|
|
68
|
+
<p>© 2015 Salesforce.com</p>
|
|
69
69
|
<ul>
|
|
70
|
-
<li
|
|
71
|
-
<li
|
|
72
|
-
<li
|
|
73
|
-
<li
|
|
70
|
+
<li><a href="https://www.heroku.com/home">heroku.com</a></li>
|
|
71
|
+
<li><a href="https://www.heroku.com/policy/tos">Terms of Service</a></li>
|
|
72
|
+
<li><a href="https://www.heroku.com/policy/privacy">Privacy</a></li>
|
|
73
|
+
<li><a href="https://www.heroku.com/policy/privacy#web_site_navigational_information">Cookies</a></li>
|
|
74
74
|
</ul>
|
|
75
75
|
</div>
|
|
76
76
|
</div>
|