sculptor 0.0.5 → 0.0.6
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/features/create.feature +1 -1
- data/lib/sculptor/extensions/model.rb +4 -10
- data/lib/sculptor/extensions/resource_helpers.rb +48 -10
- data/lib/sculptor/templates/glyptotheque/bower.json +2 -1
- data/lib/sculptor/templates/glyptotheque/config.tt +7 -3
- data/lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque/directives.js +100 -3
- data/lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque/services.js +10 -0
- data/lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque.js +1 -1
- data/lib/sculptor/templates/glyptotheque/source/assets/js/head-js.js +1 -0
- data/lib/sculptor/templates/glyptotheque/source/assets/styles/glyptotheque/_base.scss +3 -0
- data/lib/sculptor/templates/glyptotheque/source/assets/styles/glyptotheque/_model.scss +23 -11
- data/lib/sculptor/templates/glyptotheque/source/assets/styles/glyptotheque/_nav.scss +58 -25
- data/lib/sculptor/templates/glyptotheque/source/index.html.slim +2 -0
- data/lib/sculptor/templates/glyptotheque/source/layouts/glyptotheque.slim +7 -1
- data/lib/sculptor/templates/glyptotheque/source/layouts/layout.slim +9 -0
- data/lib/sculptor/templates/glyptotheque/source/layouts/standalone.slim +0 -5
- data/lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_model-index.slim +1 -1
- data/lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_model.slim +6 -4
- data/lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/menu-node.html.slim +4 -0
- data/lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/menu-tree.html.slim +2 -0
- data/lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/menu.html.slim +6 -0
- data/lib/sculptor/templates/glyptotheque/source/sitemap.json.erb +1 -0
- data/lib/sculptor/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0998c3135981e68e250208f6d01ffe29a29c2cad
|
4
|
+
data.tar.gz: be766184b00d881880a4e255a4eda8bbafc8e0fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56b2661f084d79c600c2a675142c11546b061597c95b5967baaef5ad87f8f21b60315fa07dedad20cef1c0d651e683edfa6f13f4dd26bf7e05fe397ca420f55b
|
7
|
+
data.tar.gz: abdbe843c9b9193c494657ef4d9cefdeaed1722a08120227d386350ee31b9029304b73fee8d9983014f340c10a2fb2e5a8bbdb9ec52ab6157b1cab023115386c
|
data/features/create.feature
CHANGED
@@ -35,6 +35,6 @@ Feature: Run `create` command
|
|
35
35
|
And a directory named "source/test" should exist
|
36
36
|
Then the file "source/test/test.html.slim" should contain "Hello World"
|
37
37
|
And the file "source/test/test.html.slim" should contain "My model description"
|
38
|
-
And the file "source/test/index.html.slim" should contain "'partials/glyptotheque/model-index'
|
38
|
+
And the file "source/test/index.html.slim" should contain "'partials/glyptotheque/model-index'"
|
39
39
|
And the file "source/test/test.yaml" should contain "hello: World"
|
40
40
|
And the file "source/test/styles.scss" should contain "@import 'bourbon'"
|
@@ -31,21 +31,15 @@ class Middleman::Extensions::Model < ::Middleman::Extension
|
|
31
31
|
html = result.to_html
|
32
32
|
# Assume local path
|
33
33
|
else
|
34
|
-
|
35
|
-
raise "Included model at `#{location}` was not found" unless resource
|
36
|
-
metadata = resource.metadata.page
|
37
|
-
|
38
|
-
# Hack: inject local data that can be provided as parameter
|
39
|
-
# Provided under `data.page` in partials (.component)
|
40
|
-
resource.add_metadata({ page: options[:data] || {} })
|
41
|
-
|
42
|
-
html = resource.render(layout: false)
|
34
|
+
html = partial(relative_dir(current_page.path, location).to_s)
|
43
35
|
end
|
44
36
|
else
|
45
37
|
raise "Model `#{options[:title]}`: `url` or HTML block is missing"
|
46
38
|
end
|
47
39
|
|
48
|
-
|
40
|
+
if metadata
|
41
|
+
options.reverse_merge!(metadata.symbolize_keys!)
|
42
|
+
end
|
49
43
|
|
50
44
|
options[:title] = options[:title] || data.page.title
|
51
45
|
options[:description] = options[:description] || data.page.description
|
@@ -21,19 +21,30 @@ class Middleman::Extensions::ResourceHelpers < ::Middleman::Extension
|
|
21
21
|
resource.url.split('/').last
|
22
22
|
end
|
23
23
|
|
24
|
-
def resources_for(dir, ext: 'html', exclude_indexes: false, sort_by: nil)
|
25
|
-
|
26
|
-
.
|
24
|
+
def resources_for(dir, ext: 'html', exclude_indexes: false, sort_by: nil, ignore: nil)
|
25
|
+
filtered = sitemap.resources
|
26
|
+
.reject {|r| r.url == dir} # Exclude main directory index
|
27
27
|
.reject {|r| r.data.hidden} # reject hidden (Front matter)
|
28
28
|
.select {|r| r.url.start_with?(dir)} # Select files in the given dir
|
29
|
-
.sort_by {|r| r.url } # Sort by url (default)
|
30
|
-
.sort_by {|r| r.data[sort_by] || -1} # Sort by `sort_by` param
|
31
|
-
.reject {|r| r.url == dir} # Exclude main directory index
|
32
|
-
.reject {|r| # Exclude all directory indexes
|
33
|
-
exclude_indexes ? r.directory_index? : false
|
34
|
-
}
|
35
29
|
|
36
|
-
|
30
|
+
collect_resources(filtered,
|
31
|
+
{ ext: ext, exclude_indexes: exclude_indexes, sort_by: sort_by, ignore: ignore}
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def resource_tree(dir, ext: 'html', data_fields: [:title], exclude_indexes: false, sort_by: nil, ignore: nil)
|
36
|
+
res = resources_for(dir, ext: ext, exclude_indexes: exclude_indexes, sort_by: sort_by, ignore: ignore)
|
37
|
+
res
|
38
|
+
.select { |r| r.children.any? }
|
39
|
+
.map { |r| parse_resource(r, {
|
40
|
+
ext: ext,
|
41
|
+
data_fields: data_fields,
|
42
|
+
exclude_indexes: exclude_indexes,
|
43
|
+
sort_by: sort_by,
|
44
|
+
ignore: ignore
|
45
|
+
})
|
46
|
+
}
|
47
|
+
.reject { |r| r.parent != '/' } # Remove non-root directories from the root
|
37
48
|
end
|
38
49
|
|
39
50
|
def local_data(path)
|
@@ -81,6 +92,33 @@ class Middleman::Extensions::ResourceHelpers < ::Middleman::Extension
|
|
81
92
|
|
82
93
|
private
|
83
94
|
|
95
|
+
def collect_resources(resources, options)
|
96
|
+
resources
|
97
|
+
.select {|r| r.ext == ".#{options[:ext]}"} # Select files only HTML files
|
98
|
+
.sort_by {|r| r.url } # Sort by url (default)
|
99
|
+
.sort_by {|r| r.data[options[:sort_by]] || -1} # Sort by `sort_by` param
|
100
|
+
.reject {|r| # Exclude all directory indexes
|
101
|
+
options[:exclude_indexes] ? r.directory_index? : false
|
102
|
+
}
|
103
|
+
.reject {|r| ignore ? r.url.match(options[:ignore]) : false } # Ignore URLs matching pattern (if provided)
|
104
|
+
.reject {|r| r.path.end_with? ("-standalone#{r.ext}")} # Ignore proxied '-standalone' mode pages
|
105
|
+
.reject {|r| r.path.start_with? ("partials/")} # Ignore partials
|
106
|
+
end
|
107
|
+
|
108
|
+
def parse_resource(r, options)
|
109
|
+
data = {}
|
110
|
+
data[:url] = r.url
|
111
|
+
data[:children] = collect_resources(r.children, options).map { |c| parse_resource(c, options) } if r.children.any?
|
112
|
+
data[:parent] = r.parent.url
|
113
|
+
options[:data_fields].each do |field|
|
114
|
+
if field == :title
|
115
|
+
data[:title] = r.data.title || resource_dir(r)
|
116
|
+
end
|
117
|
+
data[field] = r.data[field]
|
118
|
+
end
|
119
|
+
data
|
120
|
+
end
|
121
|
+
|
84
122
|
def include_assets(asset_tag, assets)
|
85
123
|
return unless assets
|
86
124
|
assets = assets.split(/,\s*/) if assets.is_a? String
|
@@ -4,12 +4,12 @@
|
|
4
4
|
|
5
5
|
# With alternative layout
|
6
6
|
page '/**', :layout => 'glyptotheque'
|
7
|
-
page '/*-standalone.html', :layout => 'standalone'
|
8
7
|
# With no layout
|
9
8
|
page "*.component", :layout => false
|
10
|
-
page "/partials/*", :layout => false
|
9
|
+
page "/partials/*", :layout => false, directory_index: false
|
11
10
|
page '*.css', :layout => false
|
12
11
|
page '*.js', :layout => false
|
12
|
+
page '*.json', :layout => false
|
13
13
|
|
14
14
|
# Meta redirects
|
15
15
|
# redirect 'index.html', to: 'prototypes/sample'
|
@@ -20,8 +20,12 @@ page '*.js', :layout => false
|
|
20
20
|
# end
|
21
21
|
|
22
22
|
ready do
|
23
|
+
# Create mappings for standalone (implementation) pages (iframe embeddable)
|
23
24
|
resources_for('/', exclude_indexes: true).each do |r|
|
24
|
-
proxy "#{r.path.sub(r.ext, '')}-standalone.html", r.path
|
25
|
+
proxy "#{r.path.sub(r.ext, '')}-standalone.html", r.path, layout: 'standalone'
|
26
|
+
end
|
27
|
+
resources_for('/').each do |r|
|
28
|
+
proxy "#{r.path.sub(r.ext, '')}/standalone", r.path, layout: 'standalone'
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
@@ -1,24 +1,121 @@
|
|
1
1
|
angular.module('directives', [])
|
2
|
+
|
2
3
|
.directive('glyptoModel', function($compile, $http, $templateCache) {
|
3
4
|
return {
|
4
5
|
restrict: 'C',
|
5
6
|
scope: true
|
6
7
|
};
|
7
8
|
})
|
8
|
-
|
9
|
+
|
10
|
+
.directive('glyptoNavToggle', function() {
|
9
11
|
return {
|
10
12
|
restrict: 'C',
|
11
13
|
link: function($scope, $element, $attrs) {
|
12
|
-
$scope.hidden =
|
14
|
+
$scope.hidden = store.get('glypto-menu-hidden');
|
13
15
|
|
14
|
-
Mousetrap.bind('
|
16
|
+
Mousetrap.bind('command+shift+e', function() {
|
15
17
|
$scope.toggle();
|
16
18
|
$scope.$apply();
|
17
19
|
});
|
18
20
|
|
19
21
|
$scope.toggle = function() {
|
20
22
|
$scope.hidden = !$scope.hidden;
|
23
|
+
store.set('glypto-menu-hidden', $scope.hidden);
|
21
24
|
};
|
22
25
|
}
|
23
26
|
};
|
27
|
+
})
|
28
|
+
|
29
|
+
.directive('glyptoMenu', function(relativePathToRoot) {
|
30
|
+
return {
|
31
|
+
restrict: 'E',
|
32
|
+
replace: true,
|
33
|
+
scope: true,
|
34
|
+
templateUrl: function() {
|
35
|
+
return relativePathToRoot() + 'partials/glyptotheque/menu.html';
|
36
|
+
},
|
37
|
+
controller: function($scope) {
|
38
|
+
$scope.items = window.APP_CONTEXT.sitemap;
|
39
|
+
},
|
40
|
+
link: function() {
|
41
|
+
// Remove nav placeholder when menu is created
|
42
|
+
angular.element(document.getElementById('glypto-nav-placeholder')).remove();
|
43
|
+
}
|
44
|
+
};
|
45
|
+
})
|
46
|
+
|
47
|
+
.directive('glyptoMenuTree', function(relativePathToRoot) {
|
48
|
+
return {
|
49
|
+
restrict: 'E',
|
50
|
+
replace: true,
|
51
|
+
transclude: true,
|
52
|
+
scope: {
|
53
|
+
items: '=',
|
54
|
+
filter: '='
|
55
|
+
},
|
56
|
+
templateUrl: function() {
|
57
|
+
return relativePathToRoot() + 'partials/glyptotheque/menu-tree.html';
|
58
|
+
},
|
59
|
+
link: function($scope, $element, $attrs) {
|
60
|
+
$scope.relativeUrl = function(url) {
|
61
|
+
return relativePathToRoot() + url.slice(1);
|
62
|
+
};
|
63
|
+
}
|
64
|
+
};
|
65
|
+
})
|
66
|
+
|
67
|
+
.directive('glyptoMenuNode', function($compile, relativePathToRoot) {
|
68
|
+
return {
|
69
|
+
restrict: 'E',
|
70
|
+
replace: true,
|
71
|
+
templateUrl: function() {
|
72
|
+
return relativePathToRoot() + 'partials/glyptotheque/menu-node.html';
|
73
|
+
},
|
74
|
+
link: function($scope, $element, $attrs) {
|
75
|
+
$scope.relativeUrl = function(url) {
|
76
|
+
return relativePathToRoot() + url.slice(1);
|
77
|
+
};
|
78
|
+
|
79
|
+
$scope.isSelected = $scope.node.url === window.APP_CONTEXT.current_url;
|
80
|
+
|
81
|
+
if ($scope.node.children && $scope.node.children.length > 0) {
|
82
|
+
var childNode = $compile('<glypto-menu-tree items="node.children" filter="filter"></glypto-menu-tree>')($scope);
|
83
|
+
$element.append(childNode);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
};
|
87
|
+
})
|
88
|
+
|
89
|
+
.directive('glyptoSearch', function() {
|
90
|
+
return {
|
91
|
+
restrict: 'A',
|
92
|
+
link: function($scope, $element, $attrs) {
|
93
|
+
var activated;
|
94
|
+
var placeholderText = $element.attr('placeholder');
|
95
|
+
|
96
|
+
Mousetrap.bind('/', function(evt) {
|
97
|
+
if(!activated) {
|
98
|
+
evt.preventDefault();
|
99
|
+
}
|
100
|
+
$element[0].focus();
|
101
|
+
$element.attr('placeholder', placeholderText.replace(/\(.*\)/, ''));
|
102
|
+
});
|
103
|
+
|
104
|
+
Mousetrap.bind('esc', function(evt) {
|
105
|
+
if(!activated) {
|
106
|
+
evt.preventDefault();
|
107
|
+
}
|
108
|
+
$element[0].blur();
|
109
|
+
$element.attr('placeholder', placeholderText);
|
110
|
+
});
|
111
|
+
|
112
|
+
$element.on('focus', function() {
|
113
|
+
activated = true;
|
114
|
+
});
|
115
|
+
|
116
|
+
$element.on('blur', function() {
|
117
|
+
activated = false;
|
118
|
+
});
|
119
|
+
}
|
120
|
+
};
|
24
121
|
});
|
@@ -0,0 +1,10 @@
|
|
1
|
+
angular.module('services', [])
|
2
|
+
|
3
|
+
.factory('relativePathToRoot', function($window) {
|
4
|
+
return function() {
|
5
|
+
var pathToRoot = $window.location.pathname.replace(/\/$/, '').split('/').slice(1).map(function() {
|
6
|
+
return '../';
|
7
|
+
}).join('');
|
8
|
+
return pathToRoot;
|
9
|
+
};
|
10
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require store
|
@@ -9,9 +9,9 @@
|
|
9
9
|
> header {
|
10
10
|
@include clearfix;
|
11
11
|
font-family: 'Helvetica Neue', Helvetica, sans-serif;
|
12
|
-
background:
|
12
|
+
background: white;
|
13
13
|
position: relative;
|
14
|
-
padding: 10px
|
14
|
+
padding: 10px 15px;
|
15
15
|
margin-bottom: 2px;
|
16
16
|
min-height: 40px;
|
17
17
|
|
@@ -49,22 +49,34 @@
|
|
49
49
|
}
|
50
50
|
|
51
51
|
> .glypto-model-stage {
|
52
|
-
|
53
|
-
|
52
|
+
$_padding: 15px;
|
53
|
+
|
54
|
+
position: relative;
|
55
|
+
background: white;
|
56
|
+
padding: $_padding;
|
57
|
+
|
58
|
+
&:before {
|
59
|
+
@include transition(300ms);
|
60
|
+
@include position(absolute, $_padding $_padding $_padding $_padding);
|
61
|
+
margin: -1px;
|
62
|
+
box-shadow: 0 0 0 1px transparent;
|
63
|
+
content: '';
|
64
|
+
}
|
65
|
+
|
66
|
+
&:hover:before {
|
67
|
+
box-shadow: 0 0 0 1px rgba(black, .1);
|
68
|
+
}
|
54
69
|
|
55
70
|
> figure,
|
56
71
|
> iframe {
|
57
72
|
@include box-sizing(content-box);
|
58
|
-
margin: 0;
|
59
|
-
border-radius: 3px;
|
60
|
-
border: 1px dotted rgba(0,0,0,.13);
|
61
|
-
background: white;
|
62
73
|
display: block;
|
74
|
+
margin: 0;
|
75
|
+
position: relative;
|
63
76
|
}
|
64
77
|
|
65
78
|
> figure {
|
66
79
|
@include clearfix;
|
67
|
-
padding: 5px;
|
68
80
|
}
|
69
81
|
|
70
82
|
._component {
|
@@ -95,7 +107,7 @@
|
|
95
107
|
box-shadow: inset 0 1px darken($light-grey, 5);
|
96
108
|
|
97
109
|
> header {
|
98
|
-
padding: 8px
|
110
|
+
padding: 8px 15px;
|
99
111
|
}
|
100
112
|
|
101
113
|
._toggle {
|
@@ -138,7 +150,7 @@
|
|
138
150
|
|
139
151
|
pre {
|
140
152
|
font: 12px/1.4 Menlo, monospace;
|
141
|
-
padding: 10px
|
153
|
+
padding: 10px 15px;
|
142
154
|
margin: 0;
|
143
155
|
white-space: pre-wrap;
|
144
156
|
}
|
@@ -1,24 +1,41 @@
|
|
1
|
-
.glypto-nav
|
2
|
-
|
1
|
+
.glypto-nav,
|
2
|
+
#glypto-nav-placeholder {
|
3
3
|
float: left;
|
4
4
|
width: $glypto-nav-width;
|
5
|
-
|
5
|
+
min-height: 1px;
|
6
|
+
}
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
border-left: 1px solid rgba(black, .15);
|
11
|
-
}
|
8
|
+
.glypto-nav {
|
9
|
+
@include transition(120ms ease-out);
|
10
|
+
color: #444;
|
12
11
|
|
13
12
|
&.s-hidden {
|
14
13
|
margin-left: -$glypto-nav-width;
|
14
|
+
}
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
.search {
|
17
|
+
padding: 5px;
|
18
|
+
background: rgba(black, .06);
|
19
|
+
box-shadow: 0 1px 0 rgba(white, .2);
|
20
|
+
|
21
|
+
input {
|
22
|
+
@include box-sizing(border-box);
|
23
|
+
border: 1px solid rgba(black, .2);
|
24
|
+
background: rgba(white, .6);
|
25
|
+
padding: 4px;
|
26
|
+
font-size: 14px;
|
27
|
+
display: block;
|
28
|
+
width: 100%;
|
29
|
+
outline: none;
|
30
|
+
|
31
|
+
&:focus {
|
32
|
+
border-color: rgba(black, .4);
|
33
|
+
background: rgba(white, .8);
|
34
|
+
}
|
18
35
|
}
|
19
36
|
}
|
20
37
|
|
21
|
-
> .nav-toggle {
|
38
|
+
> .glypto-nav-toggle {
|
22
39
|
@include size(30px);
|
23
40
|
padding: 0;
|
24
41
|
background: none;
|
@@ -26,6 +43,7 @@
|
|
26
43
|
float: right;
|
27
44
|
margin-right: -31px;
|
28
45
|
position: relative;
|
46
|
+
z-index: 1;
|
29
47
|
cursor: pointer;
|
30
48
|
opacity: .5;
|
31
49
|
outline: none;
|
@@ -57,7 +75,7 @@
|
|
57
75
|
}
|
58
76
|
|
59
77
|
._logo + ul:before,
|
60
|
-
li:after {
|
78
|
+
> ul > li:after {
|
61
79
|
@include background(linear-gradient(to right, transparent, rgba(black, .06)));
|
62
80
|
height: 1px;
|
63
81
|
display: block;
|
@@ -66,11 +84,13 @@
|
|
66
84
|
|
67
85
|
a {
|
68
86
|
display: block;
|
69
|
-
padding: 8px 10px
|
70
|
-
color:
|
87
|
+
padding: 8px 10px;
|
88
|
+
color: inherit;
|
71
89
|
text-decoration: none;
|
90
|
+
outline: none;
|
72
91
|
|
73
|
-
&:hover
|
92
|
+
&:hover,
|
93
|
+
&:focus {
|
74
94
|
color: inherit;
|
75
95
|
background: rgba(black, .03);
|
76
96
|
}
|
@@ -82,14 +102,9 @@
|
|
82
102
|
}
|
83
103
|
|
84
104
|
li._index {
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
text-transform: uppercase;
|
89
|
-
|
90
|
-
a {
|
91
|
-
color: inherit;
|
92
|
-
padding: 8px 10px;
|
105
|
+
> a {
|
106
|
+
letter-spacing: 1px;
|
107
|
+
font-weight: 600;
|
93
108
|
}
|
94
109
|
|
95
110
|
._count {
|
@@ -102,14 +117,32 @@
|
|
102
117
|
line-height: 16px;
|
103
118
|
border-radius: 7px;
|
104
119
|
}
|
120
|
+
|
121
|
+
ul {
|
122
|
+
a:before {
|
123
|
+
content: '';
|
124
|
+
margin: 0 5px;
|
125
|
+
}
|
126
|
+
|
127
|
+
ul a:before {
|
128
|
+
margin-left: 15px;
|
129
|
+
}
|
130
|
+
|
131
|
+
li:not(._index) a:before {
|
132
|
+
content: '•';
|
133
|
+
}
|
134
|
+
}
|
105
135
|
}
|
106
136
|
|
107
|
-
li.s-selected a {
|
137
|
+
li.s-selected > a {
|
108
138
|
color: inherit;
|
109
139
|
background: rgba(#b5cdd9, .5);
|
110
140
|
}
|
111
141
|
|
112
142
|
a._logo {
|
113
|
-
background:
|
143
|
+
background: rgba(black, .2);
|
144
|
+
color: white;
|
145
|
+
border-bottom: 1px solid rgba(black, .1);
|
146
|
+
margin-bottom: -1px;
|
114
147
|
}
|
115
148
|
}
|
@@ -3,6 +3,12 @@
|
|
3
3
|
- content_for :stylesheets, stylesheet_link_tag('glyptotheque')
|
4
4
|
|
5
5
|
= wrap_layout :layout do
|
6
|
-
|
6
|
+
glypto-menu
|
7
7
|
main.glyptotheque
|
8
8
|
= yield
|
9
|
+
|
10
|
+
javascript:
|
11
|
+
APP_CONTEXT = {
|
12
|
+
sitemap: #{partial 'sitemap.json'},
|
13
|
+
current_url: "#{current_page.url}"
|
14
|
+
}
|
@@ -7,6 +7,7 @@ html ng-app=(yield_content(:ng_app))
|
|
7
7
|
= stylesheet_link_tag 'main'
|
8
8
|
= stylesheet_link_tag '//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'
|
9
9
|
= yield_content :stylesheets
|
10
|
+
= javascript_include_tag 'head-js'
|
10
11
|
javascript:
|
11
12
|
function resizeIframe(obj) {
|
12
13
|
var doc = obj.contentDocument;
|
@@ -19,6 +20,14 @@ html ng-app=(yield_content(:ng_app))
|
|
19
20
|
}
|
20
21
|
|
21
22
|
body class="#{yield_content(:body_class)}"
|
23
|
+
javascript:
|
24
|
+
// If necessary insert a placeholder before the real menu is created
|
25
|
+
if(!store.get('glypto-menu-hidden')) {
|
26
|
+
var e = document.createElement('div');
|
27
|
+
e.id = 'glypto-nav-placeholder';
|
28
|
+
document.body.insertBefore(e, document.body.childNodes[0]);
|
29
|
+
}
|
30
|
+
|
22
31
|
= yield
|
23
32
|
|
24
33
|
= yield_content :javascripts
|
@@ -6,11 +6,6 @@ html
|
|
6
6
|
meta name='viewport' content='width=device-width'
|
7
7
|
= yield_content :stylesheets
|
8
8
|
= include_stylesheets(current_page.data.stylesheets || current_page.data.stylesheet)
|
9
|
-
css:
|
10
|
-
body {
|
11
|
-
padding: 5px;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
9
|
|
15
10
|
body class="#{yield_content(:body_class)}"
|
16
11
|
= yield
|
@@ -1,8 +1,11 @@
|
|
1
1
|
- local_url = current_page.metadata.page[:local_url]
|
2
|
+
- url = local_url || current_page.url
|
2
3
|
- title = current_page.metadata.page[:title] || locals[:title] # locals should be first but there's a bug
|
3
4
|
- description = locals[:description] || current_page.metadata.page[:description]
|
4
5
|
|
5
|
-
-
|
6
|
+
- standalone_url = !!extensions[:directory_indexes] ? url.sub(/\/$/, '/standalone') : url.sub(/\.html$/, '-standalone.html')
|
7
|
+
|
8
|
+
- if resource_file(current_page).match(/-?standalone\/?$/)
|
6
9
|
= html
|
7
10
|
- else
|
8
11
|
article.glypto-model
|
@@ -16,13 +19,12 @@
|
|
16
19
|
- if description
|
17
20
|
p._description = description
|
18
21
|
|
19
|
-
|
20
|
-
._standalone = link_to url.sub('.html', '-standalone.html'), target: '_blank' do
|
22
|
+
._standalone = link_to standalone_url, target: '_blank' do
|
21
23
|
i.fa.fa-external-link title="Standalone version"
|
22
24
|
|
23
25
|
section.glypto-model-stage
|
24
26
|
- if current_page.metadata.page.iframe
|
25
|
-
iframe src="#{
|
27
|
+
iframe src="#{standalone_url}" height="0" width="100%" frameborder="0" scrolling="no" onload='javascript:resizeIframe(this);'
|
26
28
|
- else
|
27
29
|
figure = html
|
28
30
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
nav.glypto-nav ng-class="{'s-hidden' : hidden}"
|
2
|
+
button.glypto-nav-toggle ng-click="toggle()" title="Toggle menu: Command + Shift + E"
|
3
|
+
= link_to 'Glyptotheque', '/', class: '_logo'
|
4
|
+
.search: input.mousetrap(ng-model="search" type="search" placeholder="Search (/ to focus)" glypto-search)
|
5
|
+
|
6
|
+
glypto-menu-tree items="items" filter="search"
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= resource_tree('/', data_fields: [:title, :tags], sort_by: :nav_order).to_json -%>
|
data/lib/sculptor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sculptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyom Semonov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -282,6 +282,8 @@ files:
|
|
282
282
|
- lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque.js
|
283
283
|
- lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque/controllers.js
|
284
284
|
- lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque/directives.js
|
285
|
+
- lib/sculptor/templates/glyptotheque/source/assets/js/glyptotheque/services.js
|
286
|
+
- lib/sculptor/templates/glyptotheque/source/assets/js/head-js.js
|
285
287
|
- lib/sculptor/templates/glyptotheque/source/assets/styles/glyptotheque.scss
|
286
288
|
- lib/sculptor/templates/glyptotheque/source/assets/styles/glyptotheque/_$variables.scss
|
287
289
|
- lib/sculptor/templates/glyptotheque/source/assets/styles/glyptotheque/_base.scss
|
@@ -300,6 +302,10 @@ files:
|
|
300
302
|
- lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_model-source.slim
|
301
303
|
- lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_model.slim
|
302
304
|
- lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/_nav.slim
|
305
|
+
- lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/menu-node.html.slim
|
306
|
+
- lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/menu-tree.html.slim
|
307
|
+
- lib/sculptor/templates/glyptotheque/source/partials/glyptotheque/menu.html.slim
|
308
|
+
- lib/sculptor/templates/glyptotheque/source/sitemap.json.erb
|
303
309
|
- lib/sculptor/templates/model/data.tt
|
304
310
|
- lib/sculptor/templates/model/index-template.tt
|
305
311
|
- lib/sculptor/templates/model/styles.tt
|