octopress-ink 1.0.0.alpha.12

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.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +38 -0
  6. data/Rakefile +1 -0
  7. data/lib/octopress-ink.rb +37 -0
  8. data/lib/octopress-ink/assets.rb +10 -0
  9. data/lib/octopress-ink/assets/asset.rb +71 -0
  10. data/lib/octopress-ink/assets/javascript.rb +9 -0
  11. data/lib/octopress-ink/assets/layout.rb +25 -0
  12. data/lib/octopress-ink/assets/sass.rb +64 -0
  13. data/lib/octopress-ink/assets/static_file.rb +26 -0
  14. data/lib/octopress-ink/assets/static_file_content.rb +13 -0
  15. data/lib/octopress-ink/assets/stylesheet.rb +24 -0
  16. data/lib/octopress-ink/assets/template.rb +20 -0
  17. data/lib/octopress-ink/generators/plugin_assets.rb +9 -0
  18. data/lib/octopress-ink/helpers/content_for.rb +29 -0
  19. data/lib/octopress-ink/jekyll/hooks.rb +12 -0
  20. data/lib/octopress-ink/plugin.rb +142 -0
  21. data/lib/octopress-ink/plugins.rb +232 -0
  22. data/lib/octopress-ink/plugins/sass.rb +18 -0
  23. data/lib/octopress-ink/tags.rb +14 -0
  24. data/lib/octopress-ink/tags/content_for.rb +17 -0
  25. data/lib/octopress-ink/tags/embed.rb +28 -0
  26. data/lib/octopress-ink/tags/footer.rb +10 -0
  27. data/lib/octopress-ink/tags/head.rb +10 -0
  28. data/lib/octopress-ink/tags/javascript.rb +18 -0
  29. data/lib/octopress-ink/tags/scripts.rb +10 -0
  30. data/lib/octopress-ink/tags/stylesheet.rb +18 -0
  31. data/lib/octopress-ink/tags/wrap_yield.rb +25 -0
  32. data/lib/octopress-ink/tags/yield.rb +16 -0
  33. data/lib/octopress-ink/version.rb +5 -0
  34. data/octopress-ink.gemspec +27 -0
  35. data/test/.gitignore +1 -0
  36. data/test/Gemfile +8 -0
  37. data/test/_config.yml +14 -0
  38. data/test/_custom/theme/layouts/default.html +17 -0
  39. data/test/_custom/theme/stylesheets/_bazz.scss +1 -0
  40. data/test/_custom/theme/stylesheets/bar.scss +4 -0
  41. data/test/_custom/theme/stylesheets/site.css +1 -0
  42. data/test/_plugins/bundler.rb +23 -0
  43. data/test/_plugins/theme/embeds/foo.html +1 -0
  44. data/test/_plugins/theme/files/test.html +1 -0
  45. data/test/_plugins/theme/javascripts/bar.js +1 -0
  46. data/test/_plugins/theme/javascripts/foo.js +1 -0
  47. data/test/_plugins/theme/layouts/default.html +18 -0
  48. data/test/_plugins/theme/layouts/test.html +4 -0
  49. data/test/_plugins/theme/stylesheets/_baz.scss +1 -0
  50. data/test/_plugins/theme/stylesheets/bar.scss +4 -0
  51. data/test/_plugins/theme/stylesheets/foo.css +1 -0
  52. data/test/_plugins/theme/stylesheets/print.css +1 -0
  53. data/test/_plugins/theme/stylesheets/site.css +3 -0
  54. data/test/index.md +13 -0
  55. data/test/stylesheets/_foo.scss +1 -0
  56. data/test/stylesheets/site.sass +7 -0
  57. metadata +177 -0
@@ -0,0 +1,10 @@
1
+ module Octopress
2
+ module Tags
3
+ class FooterBlock < ContentForBlock
4
+ def initialize(tag_name, markup, tokens)
5
+ @block_name = 'footer'
6
+ super
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Octopress
2
+ module Tags
3
+ class HeadBlock < ContentForBlock
4
+ def initialize(tag_name, markup, tokens)
5
+ @block_name = 'head'
6
+ super
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ module Octopress
2
+ module Tags
3
+ class JavascriptTag < Liquid::Tag
4
+ def initialize(tag_name, markup, tokens)
5
+ super
6
+ end
7
+ def render(context)
8
+ site = context.registers[:site]
9
+ if site.config['octopress'] && site.config['octopress']['combine_javascripts'] != false
10
+ Plugins.javascript_tags
11
+ else
12
+ Plugins.combined_javascript_tag
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+
@@ -0,0 +1,10 @@
1
+ module Octopress
2
+ module Tags
3
+ class ScriptsBlock < ContentForBlock
4
+ def initialize(tag_name, markup, tokens)
5
+ @block_name = 'scripts'
6
+ super
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ module Octopress
2
+ module Tags
3
+ class StylesheetTag < Liquid::Tag
4
+ def initialize(tag_name, markup, tokens)
5
+ super
6
+ end
7
+ def render(context)
8
+ site = context.registers[:site]
9
+ if site.config['octopress'] && site.config['octopress']['combine_stylesheets'] != false
10
+ Plugins.stylesheet_tags
11
+ else
12
+ Plugins.combined_stylesheet_tag(site)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+
@@ -0,0 +1,25 @@
1
+ # Inspired by jekyll-contentblocks https://github.com/rustygeldmacher/jekyll-contentblocks
2
+ #
3
+ module Octopress
4
+ module Tags
5
+ class WrapYieldBlock < Liquid::Block
6
+ HAS_YIELD = /(.*?)({=\s*yield\s*})(.*)/im
7
+ def initialize(tag_name, markup, tokens)
8
+ super
9
+ @block_name = Helpers::ContentFor.get_block_name(tag_name, markup)
10
+ end
11
+
12
+ def render(context)
13
+ wrap = super.strip
14
+ content = Helpers::ContentFor.render(context, @block_name).strip
15
+
16
+ if wrap =~ HAS_YIELD && content != ''
17
+ $1 + content + $3
18
+ else
19
+ ''
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+
@@ -0,0 +1,16 @@
1
+ # Inspired by jekyll-contentblocks https://github.com/rustygeldmacher/jekyll-contentblocks
2
+ #
3
+ module Octopress
4
+ module Tags
5
+ class YieldTag < Liquid::Tag
6
+ def initialize(tag_name, markup, tokens)
7
+ super
8
+ @block_name = Helpers::ContentFor.get_block_name(tag_name, markup)
9
+ end
10
+
11
+ def render(context)
12
+ Helpers::ContentFor.render(context, @block_name)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Octopress
2
+ module Ink
3
+ VERSION = "1.0.0.alpha.12"
4
+ end
5
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'octopress-ink/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "octopress-ink"
8
+ spec.version = Octopress::Ink::VERSION
9
+ spec.authors = ["Brandon Mathis"]
10
+ spec.email = ["brandon@imathis.com"]
11
+ spec.description = %q{A starting point for creating gem-based Jekyll themes and plugins}
12
+ spec.summary = %q{A starting point for creating gem-based Jekyll themes and plugins}
13
+ spec.homepage = "https://github.com/octopress/ink"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "jekyll", "~> 1.3.0"
22
+ spec.add_runtime_dependency "sass", "~> 3.2.0"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "rake"
26
+ end
27
+
data/test/.gitignore ADDED
@@ -0,0 +1 @@
1
+ _site
data/test/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jekyll-markdown-block.gemspec
4
+ group :jekyll_plugins do
5
+ gem "octopress-ink", path: "../"
6
+ end
7
+
8
+ gem "pry-debugger"
data/test/_config.yml ADDED
@@ -0,0 +1,14 @@
1
+ name: Your New Jekyll Site
2
+ markdown: redcarpet
3
+ pygments: true
4
+
5
+ # Sass configurations
6
+ sass:
7
+ #output_style: compact
8
+ #line_numbers: true
9
+ files:
10
+ - [site.sass, all]
11
+
12
+ #gem:
13
+ #- octopress-plugins
14
+
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>{{ page.title }}</title>
7
+ <meta name="viewport" content="width=device-width">
8
+ {% theme_css %}
9
+ {% yield head %}
10
+ </head>
11
+ <body class="dang">
12
+ {{ content }}
13
+ {% wrap_yield footer %}<footer>{= yield }</footer>{% endwrap_yield %}
14
+ {% theme_js %}
15
+ {% yield scripts %}
16
+ </body>
17
+ </html>
@@ -0,0 +1 @@
1
+ $bg: white;
@@ -0,0 +1,4 @@
1
+ @import 'baz';
2
+ body {
3
+ background: $bg;
4
+ }
@@ -0,0 +1 @@
1
+ body { color: black; }
@@ -0,0 +1,23 @@
1
+ begin
2
+ require "bundler/setup"
3
+ Bundler.require(:jekyll_plugins)
4
+ rescue LoadError
5
+ end
6
+
7
+ class ClassicTheme < Octopress::Plugin
8
+ def initialize(name, type)
9
+ @assets_path = File.expand_path(File.join(File.dirname(__FILE__), 'theme'))
10
+ super
11
+ end
12
+
13
+ def add_assets
14
+ add_stylesheets ['site.css','foo.css'], 'all'
15
+ add_stylesheet 'print.css', 'print'
16
+ add_javascripts ['foo.js', 'bar.js']
17
+ add_sass 'bar.scss'
18
+ add_file 'test.html'
19
+ end
20
+ end
21
+
22
+ Octopress.register_plugin(ClassicTheme, 'classic', 'theme')
23
+
@@ -0,0 +1 @@
1
+ {{ embed.greeting }}, I heard you like embeds.
@@ -0,0 +1 @@
1
+ <strong>test</strong>
@@ -0,0 +1 @@
1
+ console.log('bar')
@@ -0,0 +1 @@
1
+ console.log('omg')
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>{{ page.title }}</title>
7
+ <meta name="viewport" content="width=device-width">
8
+ {% theme_css %}
9
+ {% yield head %}
10
+ </head>
11
+ <body>
12
+ {{ content }}
13
+ <footer>{% yield footer %}</footer>
14
+ {% yield scripts %}
15
+ {% theme_js %}
16
+ {% yield scripts %}
17
+ </body>
18
+ </html>
@@ -0,0 +1,4 @@
1
+ ---
2
+ plugin_layout: theme/default
3
+ ---
4
+ <div class='test'>{{ content }}</div>
@@ -0,0 +1 @@
1
+ $bg: green;
@@ -0,0 +1,4 @@
1
+ @import 'baz';
2
+ body {
3
+ background: $bg;
4
+ }
@@ -0,0 +1 @@
1
+ div { display: block; }
@@ -0,0 +1 @@
1
+ .omg { display: none; }
@@ -0,0 +1,3 @@
1
+ body {
2
+ margin: 0;
3
+ }
data/test/index.md ADDED
@@ -0,0 +1,13 @@
1
+ ---
2
+ layout: theme:default
3
+ title: Your New Jekyll Site
4
+ ---
5
+ **Hello World!**
6
+
7
+ {% head %}
8
+ {% embed theme/foo.html greeting='Yo Dawg' %}
9
+ {% endhead %}
10
+
11
+ {% content_for footer %}
12
+ **OMG**
13
+ {% endcontent_for %}
@@ -0,0 +1 @@
1
+ body { display: table; }
@@ -0,0 +1,7 @@
1
+ @import 'foo'
2
+
3
+ $bg: #aaa111
4
+ body
5
+ background: $bg
6
+ div
7
+ display: table
metadata ADDED
@@ -0,0 +1,177 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: octopress-ink
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.alpha.12
5
+ platform: ruby
6
+ authors:
7
+ - Brandon Mathis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.3.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: sass
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: A starting point for creating gem-based Jekyll themes and plugins
70
+ email:
71
+ - brandon@imathis.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - lib/octopress-ink.rb
82
+ - lib/octopress-ink/assets.rb
83
+ - lib/octopress-ink/assets/asset.rb
84
+ - lib/octopress-ink/assets/javascript.rb
85
+ - lib/octopress-ink/assets/layout.rb
86
+ - lib/octopress-ink/assets/sass.rb
87
+ - lib/octopress-ink/assets/static_file.rb
88
+ - lib/octopress-ink/assets/static_file_content.rb
89
+ - lib/octopress-ink/assets/stylesheet.rb
90
+ - lib/octopress-ink/assets/template.rb
91
+ - lib/octopress-ink/generators/plugin_assets.rb
92
+ - lib/octopress-ink/helpers/content_for.rb
93
+ - lib/octopress-ink/jekyll/hooks.rb
94
+ - lib/octopress-ink/plugin.rb
95
+ - lib/octopress-ink/plugins.rb
96
+ - lib/octopress-ink/plugins/sass.rb
97
+ - lib/octopress-ink/tags.rb
98
+ - lib/octopress-ink/tags/content_for.rb
99
+ - lib/octopress-ink/tags/embed.rb
100
+ - lib/octopress-ink/tags/footer.rb
101
+ - lib/octopress-ink/tags/head.rb
102
+ - lib/octopress-ink/tags/javascript.rb
103
+ - lib/octopress-ink/tags/scripts.rb
104
+ - lib/octopress-ink/tags/stylesheet.rb
105
+ - lib/octopress-ink/tags/wrap_yield.rb
106
+ - lib/octopress-ink/tags/yield.rb
107
+ - lib/octopress-ink/version.rb
108
+ - octopress-ink.gemspec
109
+ - test/.gitignore
110
+ - test/Gemfile
111
+ - test/_config.yml
112
+ - test/_custom/theme/layouts/default.html
113
+ - test/_custom/theme/stylesheets/_bazz.scss
114
+ - test/_custom/theme/stylesheets/bar.scss
115
+ - test/_custom/theme/stylesheets/site.css
116
+ - test/_plugins/bundler.rb
117
+ - test/_plugins/theme/embeds/foo.html
118
+ - test/_plugins/theme/files/test.html
119
+ - test/_plugins/theme/javascripts/bar.js
120
+ - test/_plugins/theme/javascripts/foo.js
121
+ - test/_plugins/theme/layouts/default.html
122
+ - test/_plugins/theme/layouts/test.html
123
+ - test/_plugins/theme/stylesheets/_baz.scss
124
+ - test/_plugins/theme/stylesheets/bar.scss
125
+ - test/_plugins/theme/stylesheets/foo.css
126
+ - test/_plugins/theme/stylesheets/print.css
127
+ - test/_plugins/theme/stylesheets/site.css
128
+ - test/index.md
129
+ - test/stylesheets/_foo.scss
130
+ - test/stylesheets/site.sass
131
+ homepage: https://github.com/octopress/ink
132
+ licenses:
133
+ - MIT
134
+ metadata: {}
135
+ post_install_message:
136
+ rdoc_options: []
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - '>'
147
+ - !ruby/object:Gem::Version
148
+ version: 1.3.1
149
+ requirements: []
150
+ rubyforge_project:
151
+ rubygems_version: 2.1.11
152
+ signing_key:
153
+ specification_version: 4
154
+ summary: A starting point for creating gem-based Jekyll themes and plugins
155
+ test_files:
156
+ - test/.gitignore
157
+ - test/Gemfile
158
+ - test/_config.yml
159
+ - test/_custom/theme/layouts/default.html
160
+ - test/_custom/theme/stylesheets/_bazz.scss
161
+ - test/_custom/theme/stylesheets/bar.scss
162
+ - test/_custom/theme/stylesheets/site.css
163
+ - test/_plugins/bundler.rb
164
+ - test/_plugins/theme/embeds/foo.html
165
+ - test/_plugins/theme/files/test.html
166
+ - test/_plugins/theme/javascripts/bar.js
167
+ - test/_plugins/theme/javascripts/foo.js
168
+ - test/_plugins/theme/layouts/default.html
169
+ - test/_plugins/theme/layouts/test.html
170
+ - test/_plugins/theme/stylesheets/_baz.scss
171
+ - test/_plugins/theme/stylesheets/bar.scss
172
+ - test/_plugins/theme/stylesheets/foo.css
173
+ - test/_plugins/theme/stylesheets/print.css
174
+ - test/_plugins/theme/stylesheets/site.css
175
+ - test/index.md
176
+ - test/stylesheets/_foo.scss
177
+ - test/stylesheets/site.sass