octopress-ink 1.0.0.alpha.29 → 1.0.0.alpha.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/octopress-ink.rb +14 -4
- data/lib/octopress-ink/assets.rb +1 -0
- data/lib/octopress-ink/assets/page.rb +40 -0
- data/lib/octopress-ink/assets/root.rb +1 -2
- data/lib/octopress-ink/filters.rb +24 -9
- data/lib/octopress-ink/generators/plugin_assets.rb +1 -1
- data/lib/octopress-ink/helpers/path.rb +24 -1
- data/lib/octopress-ink/helpers/var.rb +1 -1
- data/lib/octopress-ink/jekyll/hooks.rb +3 -4
- data/lib/octopress-ink/jekyll/page.rb +31 -0
- data/lib/octopress-ink/{assets → jekyll}/static_file.rb +0 -0
- data/lib/octopress-ink/{assets → jekyll}/static_file_content.rb +0 -0
- data/lib/octopress-ink/plugin.rb +35 -8
- data/lib/octopress-ink/plugins.rb +8 -10
- data/lib/octopress-ink/tags.rb +2 -0
- data/lib/octopress-ink/tags/abort.rb +19 -0
- data/lib/octopress-ink/tags/assign.rb +1 -2
- data/lib/octopress-ink/tags/capture.rb +9 -2
- data/lib/octopress-ink/tags/content_for.rb +1 -2
- data/lib/octopress-ink/tags/filter.rb +21 -0
- data/lib/octopress-ink/tags/include.rb +1 -2
- data/lib/octopress-ink/tags/render.rb +1 -2
- data/lib/octopress-ink/tags/return.rb +1 -2
- data/lib/octopress-ink/tags/wrap.rb +10 -3
- data/lib/octopress-ink/tags/yield.rb +1 -6
- data/lib/octopress-ink/version.rb +1 -1
- data/test/expected/2014/02/01/test-post.html +14 -0
- data/test/expected/test_tags/abort_false.html +1 -0
- data/test/expected/test_tags/capture.html +2 -0
- data/test/expected/test_tags/filter.html +4 -0
- data/test/expected/test_tags/wrap.html +1 -0
- data/test/plugins/awesome-sauce/config.yml +2 -0
- data/test/{source/_plugins → plugins}/awesome-sauce/files/robots.txt +0 -0
- data/test/{source/_plugins → plugins}/awesome-sauce/includes/some-include.html +0 -0
- data/test/{source/_plugins → plugins}/awesome-sauce/layouts/test-layout.html +0 -0
- data/test/plugins/awesome-sauce/plugin.rb +16 -0
- data/test/{source/_plugins → plugins}/awesome-sauce/stylesheets/plugin-media-test.css +0 -0
- data/test/{source/_plugins → plugins}/awesome-sauce/stylesheets/plugin-test.css +0 -0
- data/test/{source/_plugins → plugins}/test-theme/config.yml +3 -0
- data/test/{source/_plugins → plugins}/test-theme/files/favicon.ico +0 -0
- data/test/{source/_plugins → plugins}/test-theme/files/favicon.png +0 -0
- data/test/{source/_plugins → plugins}/test-theme/files/test.html +0 -0
- data/test/{source/_plugins → plugins}/test-theme/includes/bar.html +0 -0
- data/test/{source/_plugins → plugins}/test-theme/includes/greet.html +0 -0
- data/test/{source/_plugins → plugins}/test-theme/javascripts/bar.js +0 -0
- data/test/{source/_plugins → plugins}/test-theme/javascripts/foo.js +0 -0
- data/test/{source/_plugins → plugins}/test-theme/layouts/default.html +0 -0
- data/test/{source/_plugins → plugins}/test-theme/layouts/test.html +0 -0
- data/test/plugins/test-theme/pages/pages-test.md +6 -0
- data/test/plugins/test-theme/pages/sub/test.md +5 -0
- data/test/{source/_plugins/bundler.rb → plugins/test-theme/plugin.rb} +1 -17
- data/test/{source/_plugins → plugins}/test-theme/stylesheets/_colors.scss +0 -0
- data/test/{source/_plugins → plugins}/test-theme/stylesheets/main.scss +0 -0
- data/test/{source/_plugins → plugins}/test-theme/stylesheets/theme-media-test@print.css +0 -0
- data/test/{source/_plugins → plugins}/test-theme/stylesheets/theme-test.css +0 -0
- data/test/{source/_plugins → plugins}/test-theme/stylesheets/theme-test2.css +0 -0
- data/test/site/2014/02/01/test-post.html +14 -0
- data/test/site/index.html +2 -0
- data/test/site/pages-tet.html +13 -0
- data/test/site/test_layouts/test_markdown.html +13 -0
- data/test/site/test_tags/abort_false.html +1 -0
- data/test/site/test_tags/abort_true.html +1 -0
- data/test/site/test_tags/capture.html +2 -0
- data/test/site/test_tags/filter.html +4 -0
- data/test/site/test_tags/wrap.html +1 -0
- data/test/source/_plugins/awesome-sauce/config.yml +1 -2
- data/test/source/_plugins/loader.rb +2 -0
- data/test/source/{_custom → _plugins}/theme/config.yml +3 -0
- data/test/source/{_custom → _plugins}/theme/includes/bar.html +0 -0
- data/test/source/{_custom → _plugins}/theme/layouts/test.html +0 -0
- data/test/source/{_custom → _plugins}/theme/stylesheets/_colors.sass +0 -0
- data/test/source/{_custom → _plugins}/theme/stylesheets/theme-test.css +0 -0
- data/test/source/_posts/2014-02-01-test-post.md +6 -0
- data/test/source/index.md +10 -0
- data/test/source/pages-tet.md +5 -0
- data/test/source/test_layouts/test_markdown.md +5 -0
- data/test/source/test_tags/abort_false.html +5 -0
- data/test/source/test_tags/abort_true.html +5 -0
- data/test/source/test_tags/capture.html +7 -0
- data/test/source/test_tags/content_for.html +1 -1
- data/test/source/test_tags/filter.html +6 -0
- data/test/source/test_tags/wrap.html +2 -1
- data/test/test.rb +13 -2
- metadata +100 -58
- data/test/source/_custom/awesome-sauce/config.yml +0 -1
@@ -0,0 +1,19 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Tags
|
3
|
+
class AbortTag < Liquid::Tag
|
4
|
+
def initialize(tag_name, markup, tokens)
|
5
|
+
super
|
6
|
+
@markup = " #{markup}"
|
7
|
+
end
|
8
|
+
|
9
|
+
def render(context)
|
10
|
+
if Helpers::Conditional.parse(@markup, context)
|
11
|
+
env = context.environments.first
|
12
|
+
dest = File.join(Helpers::Path.site_dir, env['page']['url'])
|
13
|
+
context.environments.first['site']['pages'] = Helpers::Path.remove_page(dest)
|
14
|
+
end
|
15
|
+
''
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -9,14 +9,21 @@ module Octopress
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def render(context)
|
12
|
-
markup = Helpers::Conditional.parse(@markup, context)
|
13
|
-
|
12
|
+
return unless markup = Helpers::Conditional.parse(@markup, context)
|
13
|
+
if markup =~ Helpers::Var::HAS_FILTERS
|
14
|
+
markup = $1
|
15
|
+
filters = $2
|
16
|
+
end
|
14
17
|
|
15
18
|
if markup =~ SYNTAX
|
16
19
|
var = $1
|
17
20
|
operator = $2
|
18
21
|
value = super.lstrip
|
19
22
|
|
23
|
+
unless value.nil? || filters.nil?
|
24
|
+
value = Helpers::Var.render_filters(value, filters, context)
|
25
|
+
end
|
26
|
+
|
20
27
|
context = Helpers::Var.set_var(var, operator, value, context)
|
21
28
|
else
|
22
29
|
raise SyntaxError.new("Syntax Error in 'capture' - Valid syntax: capture [var]")
|
@@ -10,8 +10,7 @@ module Octopress
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def render(context)
|
13
|
-
markup = Helpers::Conditional.parse(@markup, context)
|
14
|
-
return unless markup
|
13
|
+
return unless markup = Helpers::Conditional.parse(@markup, context)
|
15
14
|
|
16
15
|
@block_name ||= Helpers::ContentFor.get_block_name(@tag_name, markup)
|
17
16
|
Helpers::ContentFor.append_to_block(context, @block_name, super)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Tags
|
3
|
+
class FilterTag < Liquid::Block
|
4
|
+
def initialize(tag_name, markup, tokens)
|
5
|
+
super
|
6
|
+
@markup = " #{markup}"
|
7
|
+
end
|
8
|
+
|
9
|
+
def render(context)
|
10
|
+
content = super.strip
|
11
|
+
|
12
|
+
return content unless markup = Helpers::Conditional.parse(@markup, context)
|
13
|
+
if markup =~ Helpers::Var::HAS_FILTERS and !content.nil?
|
14
|
+
content = Helpers::Var.render_filters(content, $2, context)
|
15
|
+
end
|
16
|
+
|
17
|
+
content
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -9,12 +9,11 @@ module Octopress
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def render(context)
|
12
|
-
markup = Helpers::Conditional.parse(@markup, context)
|
12
|
+
return unless markup = Helpers::Conditional.parse(@markup, context)
|
13
13
|
if markup =~ Helpers::Var::HAS_FILTERS
|
14
14
|
markup = $1
|
15
15
|
filters = $2
|
16
16
|
end
|
17
|
-
return unless markup
|
18
17
|
markup = Helpers::Var.evaluate_ternary(markup, context)
|
19
18
|
markup = Helpers::Path.parse(markup, context)
|
20
19
|
|
@@ -13,12 +13,11 @@ module Octopress
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def render(context)
|
16
|
-
markup = Helpers::Conditional.parse(@markup, context)
|
16
|
+
return unless markup = Helpers::Conditional.parse(@markup, context)
|
17
17
|
if markup =~ Helpers::Var::HAS_FILTERS
|
18
18
|
markup = $1
|
19
19
|
filters = $2
|
20
20
|
end
|
21
|
-
return unless markup
|
22
21
|
markup = Helpers::Var.evaluate_ternary(markup, context)
|
23
22
|
markup = Helpers::Path.parse(markup, context)
|
24
23
|
|
@@ -11,9 +11,12 @@ module Octopress
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def render(context)
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
return unless markup = Helpers::Conditional.parse(@markup, context)
|
15
|
+
|
16
|
+
if markup =~ Helpers::Var::HAS_FILTERS
|
17
|
+
markup = $1
|
18
|
+
filters = $2
|
19
|
+
end
|
17
20
|
|
18
21
|
type = if markup =~ /^\s*yield\s(.+)/
|
19
22
|
markup = $1
|
@@ -52,6 +55,10 @@ module Octopress
|
|
52
55
|
content = super.strip
|
53
56
|
context.scopes.first['yield'] = old_yield
|
54
57
|
|
58
|
+
unless content.nil? || filters.nil?
|
59
|
+
content = Helpers::Var.render_filters(content, filters, context)
|
60
|
+
end
|
61
|
+
|
55
62
|
content
|
56
63
|
end
|
57
64
|
|
@@ -19,18 +19,13 @@ module Octopress
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def render(context)
|
22
|
-
markup = Helpers::Conditional.parse(@markup, context)
|
23
|
-
return unless markup
|
22
|
+
return unless markup = Helpers::Conditional.parse(@markup, context)
|
24
23
|
content = Helpers::ContentFor.render(context, @block_name)
|
25
24
|
|
26
25
|
unless content.nil? || @filters.nil?
|
27
26
|
content = Helpers::Var.render_filters(content, @filters, context)
|
28
27
|
end
|
29
28
|
|
30
|
-
if @block_name == 'head' && ENV['OCTOPRESS_ENV'] != 'TEST'
|
31
|
-
content.insert 0, "<meta name='generator' content='Octopress #{Octopress::Ink::VERSION}'>"
|
32
|
-
end
|
33
|
-
|
34
29
|
content
|
35
30
|
end
|
36
31
|
end
|
@@ -0,0 +1,14 @@
|
|
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>Test Post</title>
|
7
|
+
<meta name="viewport" content="width=device-width">
|
8
|
+
</head>
|
9
|
+
<body class=" ">
|
10
|
+
<div class='local-override'><p>Test post <strong>strong</strong> <em>emphasized</em> <a href="http://example.com">some link</a></p>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
Woohoo
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class TestPlugin < Octopress::Plugin
|
2
|
+
def initialize(name, type)
|
3
|
+
@assets_path = File.expand_path(File.join(File.dirname(__FILE__)))
|
4
|
+
super
|
5
|
+
end
|
6
|
+
|
7
|
+
def add_assets
|
8
|
+
add_stylesheet 'plugin-test.css'
|
9
|
+
add_stylesheet 'plugin-media-test.css', 'print'
|
10
|
+
add_root_file 'robots.txt'
|
11
|
+
super
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Octopress.register_plugin(TestPlugin, 'awesome-sauce')
|
16
|
+
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,7 +2,7 @@ require 'octopress-ink'
|
|
2
2
|
|
3
3
|
class TestTheme < Octopress::Plugin
|
4
4
|
def initialize(name, type)
|
5
|
-
@assets_path = File.expand_path(File.join(File.dirname(__FILE__)
|
5
|
+
@assets_path = File.expand_path(File.join(File.dirname(__FILE__)))
|
6
6
|
super
|
7
7
|
end
|
8
8
|
def add_assets
|
@@ -13,20 +13,4 @@ class TestTheme < Octopress::Plugin
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
class TestPlugin < Octopress::Plugin
|
17
|
-
def initialize(name, type)
|
18
|
-
@assets_path = File.expand_path(File.join(File.dirname(__FILE__), 'awesome-sauce'))
|
19
|
-
super
|
20
|
-
end
|
21
|
-
|
22
|
-
def add_assets
|
23
|
-
add_stylesheet 'plugin-test.css'
|
24
|
-
add_stylesheet 'plugin-media-test.css', 'print'
|
25
|
-
add_root_file 'robots.txt'
|
26
|
-
super
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
16
|
Octopress.register_plugin(TestTheme, 'classic', 'theme')
|
31
|
-
Octopress.register_plugin(TestPlugin, 'awesome-sauce')
|
32
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
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>Test Post</title>
|
7
|
+
<meta name="viewport" content="width=device-width">
|
8
|
+
</head>
|
9
|
+
<body class=" ">
|
10
|
+
<div class='local-override'><p>Test post <strong>strong</strong> <em>emphasized</em> <a href="http://example.com">some link</a></p>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/test/site/index.html
CHANGED
@@ -0,0 +1,13 @@
|
|
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></title>
|
7
|
+
<meta name="viewport" content="width=device-width">
|
8
|
+
</head>
|
9
|
+
<body class=" ">
|
10
|
+
<p>Testing pages override. <strong>strong</strong> <em>emphasized</em> <a href="http://example.com">a link</a></p>
|
11
|
+
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
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></title>
|
7
|
+
<meta name="viewport" content="width=device-width">
|
8
|
+
</head>
|
9
|
+
<body class=" ">
|
10
|
+
<p><strong>strong</strong> <em>emphasized</em> <a href="http://example.com">a link</a></p>
|
11
|
+
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
Woohoo
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
test_override: also config from plugin
|
1
|
+
test_override: config from plugin override
|