edge_framework 1.3.3 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -61
- data/assets/sass/edge/_base.scss +0 -12
- data/assets/sass/edge/components/_button.scss +2 -9
- data/assets/sass/edge/components/_form.scss +1 -1
- data/assets/sass/edge/components/_grid.scss +4 -4
- data/assets/sass/edge/components/_tile.scss +4 -0
- data/assets/sass/edge.scss +1 -1
- data/assets/sass/edgemail/_base.scss +5 -5
- data/assets/sass/kitchen-sink.scss +1 -3
- data/lib/edge/version.rb +1 -1
- data/template/sinatra/Gemfile +10 -0
- data/template/sinatra/config.ru +17 -0
- data/template/sinatra/start.rb +19 -0
- data/template/sinatra/views/errors/404.erb +1 -0
- data/template/sinatra/views/index.erb +1 -0
- data/template/sinatra/views/layout.erb +44 -0
- metadata +8 -2
data/README.md
CHANGED
@@ -285,11 +285,15 @@ Generate basic template for your project. Run this command inside your project d
|
|
285
285
|
|
286
286
|
`edge create wordpress`
|
287
287
|
|
288
|
-
3.
|
288
|
+
3. Ghost Blog
|
289
|
+
|
290
|
+
`edge create blog`
|
291
|
+
|
292
|
+
4. Rails (run inside Rails project)
|
289
293
|
|
290
294
|
`rails g edge:install`
|
291
295
|
|
292
|
-
|
296
|
+
5. Coming soon: Sinatra and Flask
|
293
297
|
|
294
298
|
|
295
299
|
WORDPRESS
|
@@ -297,37 +301,9 @@ WORDPRESS
|
|
297
301
|
|
298
302
|
![Edge Wordpress](http://cdn.setyono.net/edge/wp-edge.jpg)
|
299
303
|
|
300
|
-
|
301
|
-
|
302
|
-
- Auto add header and footer.
|
303
|
-
- Independent from any plugin.
|
304
|
-
- Cleaner WP Query call.
|
305
|
-
- Easily create custom post type and taxonomy.
|
306
|
-
|
307
|
-
Custom WP Query
|
308
|
-
---------------------
|
309
|
-
|
310
|
-
Post::find()
|
311
|
-
get all posts.
|
312
|
-
|
313
|
-
Post::find($args_array)
|
314
|
-
get post(s) based on the arguments array.
|
315
|
-
|
316
|
-
Post::find_by($key, $value)
|
317
|
-
faster way of writing Post::find(array( $key => $value ))
|
318
|
-
|
319
|
-
All of the functions above returns `WP_Query()` object. [Refer here](https://gist.github.com/luetkemj/2023628) for available argument.
|
320
|
-
|
321
|
-
Example:
|
322
|
-
|
323
|
-
$posts = Post::find_by("category_name", "featured");
|
324
|
-
|
325
|
-
if( $posts->have_posts() ):
|
326
|
-
while( $posts->have_posts() ): $posts->the_post();
|
327
|
-
...
|
328
|
-
endwhile;
|
329
|
-
endif;
|
304
|
+
Our WordPress template requires [Timber](http://upstatement.com/timber/). It is a template engine that separates PHP and HTML into their own file.
|
330
305
|
|
306
|
+
So, download and include [its plugin](https://wordpress.org/plugins/timber-library/) into your WordPress installation.
|
331
307
|
|
332
308
|
Custom Post Type
|
333
309
|
--------------------
|
@@ -343,37 +319,11 @@ Inside `functions.php`, add these codes:
|
|
343
319
|
|
344
320
|
The icon name is taken from [melchoyce.github.io/dashicons/](http://melchoyce.github.io/dashicons/).
|
345
321
|
|
346
|
-
|
347
|
-
|
348
|
-
// still inside functions.php
|
349
|
-
|
350
|
-
class Product extends Post {}
|
351
|
-
class Event extends Post {}
|
352
|
-
|
353
|
-
Now, you can use the custom WP Query:
|
354
|
-
|
355
|
-
$products = Product::find_by("brand", "Microsoft")
|
356
|
-
$events = Event::find()
|
357
|
-
|
358
|
-
**Alert**: If you want pagination to work, the Name cannot be the same as any page's slug.
|
359
|
-
|
360
|
-
Template File
|
361
|
-
---------------
|
362
|
-
|
363
|
-
The template file for custom post is `single-{slug}.php` while custom taxonomy is `taxonomy-{slug}.php`.
|
364
|
-
|
365
|
-
Based on the example above, create `single-product.php` for single **Product** template. If we need to list all products within a brand, create `taxonomy-brand.php` which works the same way as `category.php`.
|
366
|
-
|
367
|
-
Naming Convention
|
368
|
-
-----------------
|
369
|
-
|
370
|
-
All names must be **singular**.
|
371
|
-
|
372
|
-
No special character except space. If contain space, the class' name should be its combined word and no camel casing.
|
322
|
+
Tips:
|
373
323
|
|
374
|
-
|
324
|
+
- If you want pagination to work, the `$name` cannot be the same as any page's slug.
|
375
325
|
|
376
|
-
|
326
|
+
- All type's name and taxonomy's name must be **singular** and no special character except space.
|
377
327
|
|
378
328
|
COMPASS
|
379
329
|
=================
|
data/assets/sass/edge/_base.scss
CHANGED
@@ -205,18 +205,6 @@ $retina-screen : 192dpi !default;
|
|
205
205
|
$is-in-media: false;
|
206
206
|
}
|
207
207
|
|
208
|
-
// ------------
|
209
|
-
// CONTRAST
|
210
|
-
// ------------
|
211
|
-
|
212
|
-
@function is_dark($color) {
|
213
|
-
@return contrast-color($color, false, true, 70%);
|
214
|
-
}
|
215
|
-
|
216
|
-
@function is_light($color) {
|
217
|
-
@return not is_dark($color);
|
218
|
-
}
|
219
|
-
|
220
208
|
// ----------------------------------------------
|
221
209
|
// CLEARING FLOAT
|
222
210
|
// Make a container wraps floated element
|
@@ -9,14 +9,7 @@ $button-color: $main-color !default;
|
|
9
9
|
// ---------------
|
10
10
|
@mixin button-hover($color) {
|
11
11
|
&:hover {
|
12
|
-
|
13
|
-
@if is_light($color) {
|
14
|
-
background-color: darken($color, 5%);
|
15
|
-
}
|
16
|
-
// Lighten background if background is dark
|
17
|
-
@else {
|
18
|
-
background-color: lighten($color, 5%);
|
19
|
-
}
|
12
|
+
background-color: lighten($color, 5%);
|
20
13
|
}
|
21
14
|
}
|
22
15
|
|
@@ -65,7 +58,7 @@ $button-color: $main-color !default;
|
|
65
58
|
}
|
66
59
|
|
67
60
|
background-color: $color;
|
68
|
-
color:
|
61
|
+
color: white;
|
69
62
|
|
70
63
|
@if $for-base {
|
71
64
|
@include border-radius($g-radius);
|
@@ -70,7 +70,7 @@ $prefix-bg-color : $passive-color !default;
|
|
70
70
|
border: $input-border-style $bg-color;
|
71
71
|
border-top: $input-border-style darken( $input-border-color, 5% );
|
72
72
|
text-align: center;
|
73
|
-
color:
|
73
|
+
color: $body-font-color;
|
74
74
|
background: $bg-color;
|
75
75
|
overflow: hidden;
|
76
76
|
}
|
@@ -92,8 +92,8 @@ $column-gutter : 20px !default;
|
|
92
92
|
// -----------------------------------
|
93
93
|
|
94
94
|
@mixin row(
|
95
|
-
$gutter :
|
96
|
-
$width :
|
95
|
+
$gutter : 0,
|
96
|
+
$width : 0,
|
97
97
|
$collapse : false) {
|
98
98
|
|
99
99
|
// Nested row, only output if gutter is specified
|
@@ -110,8 +110,8 @@ $column-gutter : 20px !default;
|
|
110
110
|
}
|
111
111
|
|
112
112
|
// Set default value if 0
|
113
|
-
@if $width ==
|
114
|
-
@if $gutter ==
|
113
|
+
@if $width == 0px { $width: $row-max-width; }
|
114
|
+
@if $gutter == 0px { $gutter: $column-gutter; }
|
115
115
|
|
116
116
|
// Max width for outer row
|
117
117
|
max-width: $width + $gutter;
|
@@ -96,6 +96,10 @@ $tile-gutter : 15px !default;
|
|
96
96
|
@include below(small) {
|
97
97
|
@include base-tile($size: $small, $reset-clearing: true);
|
98
98
|
}
|
99
|
+
} @else if $responsive and not $is-in-media { // else, become 100% width on small screen (if responsive)
|
100
|
+
@include below(small) {
|
101
|
+
@include base-tile($size: 1);
|
102
|
+
}
|
99
103
|
}
|
100
104
|
|
101
105
|
@if $mini > 0 {
|
data/assets/sass/edge.scss
CHANGED
@@ -16,11 +16,11 @@ $row-max-width : 650px !default;
|
|
16
16
|
$mini-screen : 480px !default;
|
17
17
|
|
18
18
|
// BODY
|
19
|
-
$body-background : #ffffff;
|
20
|
-
$body-font-color : #222222;
|
21
|
-
$body-font-weight : 400;
|
22
|
-
$body-font-size : 16px;
|
23
|
-
$body-line-height : 1.5;
|
19
|
+
$body-background : #ffffff !default;
|
20
|
+
$body-font-color : #222222 !default;
|
21
|
+
$body-font-weight : 400 !default;
|
22
|
+
$body-font-size : 16px !default;
|
23
|
+
$body-line-height : 1.5 !default;
|
24
24
|
|
25
25
|
// TYPOGRAPHY
|
26
26
|
$h1-font-size : 44px !default;
|
@@ -262,7 +262,7 @@
|
|
262
262
|
|
263
263
|
/* Custom Tile */
|
264
264
|
.custom-tile-1 {
|
265
|
-
@include tile($size:
|
265
|
+
@include tile($size:5);
|
266
266
|
}
|
267
267
|
|
268
268
|
.custom-tile-2 {
|
@@ -305,8 +305,6 @@
|
|
305
305
|
}
|
306
306
|
|
307
307
|
.has-vr {
|
308
|
-
@include vertical-rhythm();
|
309
|
-
|
310
308
|
blockquote {
|
311
309
|
@include trailer(1);
|
312
310
|
}
|
data/lib/edge/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
3
|
+
require "sinatra"
|
4
|
+
require "erb"
|
5
|
+
require "./start"
|
6
|
+
|
7
|
+
require "sass"
|
8
|
+
require "compass"
|
9
|
+
|
10
|
+
set :run, false
|
11
|
+
set :raise_errors, true
|
12
|
+
|
13
|
+
use Rack::Static, urls: ["/css", "/js", "/img"], root: "assets"
|
14
|
+
|
15
|
+
configure { set :server, :puma }
|
16
|
+
|
17
|
+
run App
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "sinatra/base"
|
2
|
+
require "sinatra/reloader"
|
3
|
+
|
4
|
+
class App < Sinatra::Base
|
5
|
+
|
6
|
+
configure :development do
|
7
|
+
register Sinatra::Reloader
|
8
|
+
end
|
9
|
+
|
10
|
+
# Home Page
|
11
|
+
get "/" do
|
12
|
+
erb :index
|
13
|
+
end
|
14
|
+
|
15
|
+
# 404
|
16
|
+
not_found do
|
17
|
+
erb :"errors/404"
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>404 Page Not Found</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Home Page</h1>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width">
|
6
|
+
|
7
|
+
<!-- WEBSITE DETAIL -->
|
8
|
+
<title>My Website</title>
|
9
|
+
<meta name="description" content="This is a description of your website, only first 160 characters matters">
|
10
|
+
|
11
|
+
<!-- FAVICON -->
|
12
|
+
<link rel="icon" href="/img/favicon.png">
|
13
|
+
<link rel="apple-touch-icon-precomposed" href="/img/favicon-big.png">
|
14
|
+
|
15
|
+
<!-- JAVASCRIPT that must load first -->
|
16
|
+
<script src="/js/vendor/custom.modernizr.js"></script>
|
17
|
+
|
18
|
+
<!-- STYLESHEET -->
|
19
|
+
<link rel="stylesheet" href="/css/framework.css">
|
20
|
+
<link rel="stylesheet" href="/css/app.css">
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<div id="main-wrapper">
|
25
|
+
|
26
|
+
<%= yield %>
|
27
|
+
|
28
|
+
<div id="footer-push"></div>
|
29
|
+
</div>
|
30
|
+
<footer class="main-footer"></footer>
|
31
|
+
|
32
|
+
<!-- JAVASCRIPT LIBRARY -->
|
33
|
+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
34
|
+
<script>
|
35
|
+
// Fallback if Google's one doesn't load
|
36
|
+
if (!window.jQuery) {
|
37
|
+
document.write("<script src='/js/vendor/jquery.min.js'><\/script>");
|
38
|
+
}
|
39
|
+
</script>
|
40
|
+
<script src="/js/vendor/fastclick.min.js"></script>
|
41
|
+
<script src="/js/app.js"></script>
|
42
|
+
|
43
|
+
</body>
|
44
|
+
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edge_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|
@@ -197,6 +197,12 @@ files:
|
|
197
197
|
- template/ghost/tag.hbs
|
198
198
|
- template/html/index.html
|
199
199
|
- template/rails/application.html.erb
|
200
|
+
- template/sinatra/Gemfile
|
201
|
+
- template/sinatra/config.ru
|
202
|
+
- template/sinatra/start.rb
|
203
|
+
- template/sinatra/views/errors/404.erb
|
204
|
+
- template/sinatra/views/index.erb
|
205
|
+
- template/sinatra/views/layout.erb
|
200
206
|
- template/wordpress/404.php
|
201
207
|
- template/wordpress/archive.php
|
202
208
|
- template/wordpress/code/cpt.php
|