fronton 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f943e72e3ce00f91c632cf65e3b6ef1b6ae39754
4
- data.tar.gz: 338bd8968ffab8493b15ea496847b0607a9ac089
3
+ metadata.gz: a899c6d84ac29adb1f1df25728ddbc5e9b23ce32
4
+ data.tar.gz: 28e39dea1624fd43b541b514994645e5bc373acc
5
5
  SHA512:
6
- metadata.gz: 8347cf7bf986d565b0793f17abf21f1336e9b3e3d0d7c4c18a1c24d30b8cb31252af2fd585d37dabc3f1fd6503bf9546eb6bcd0bead38216f123a66045b55381
7
- data.tar.gz: ed099e5790eef3a98e8443f1a715d4523c0d8d5e0b948ce94a286c1435fa296945cf13a83c01fe78da004aeaeaf456371b93285f6031439caecee48b5c809612
6
+ metadata.gz: c536294cfe053beb81cbf6cbd99c03bac600a49fcd151612d5c2621a7f71ac9b6bdd11d9957412907e8222e9134a1e210103ab4182627f63f85a8e7a5bfe8722
7
+ data.tar.gz: f2cc92f27a3e6d6a47fc2a5671108a79845196377961c2f2d394e73fa5d2600edaa5be23f09e062ba8c76bb2efc3fc75b00102522f2d36fe7faf7cc1f8893e1f
data/README.md CHANGED
@@ -62,6 +62,7 @@ compressors:
62
62
  dependencies:
63
63
  - rails-assets-jquery: 3.1.0
64
64
  - slim: 3.0.7
65
+ fallback_page: index.slim
65
66
  output: public
66
67
  pages:
67
68
  - index.slim: /
@@ -69,16 +70,17 @@ pages_paths:
69
70
  - pages
70
71
  ```
71
72
 
72
- | Attribute | Type | Description |
73
- | ------------ | ------ | ---------------------------------------------------------- |
74
- | assets | Array | List of assets to compile (only js and css files) |
75
- | assets_paths | Array | List of directories where Sprockets find files for require |
76
- | assets_url | String | URL for assets in production |
77
- | compressors | Hash | Hash with selected compressors by type |
78
- | dependencies | Array | List of gems to install and require |
79
- | output | String | Path to a directory where compiled assets will be written |
80
- | pages | Array | List of pages to compile |
81
- | pages_paths | Array | List of directories where Fronton find html files |
73
+ | Attribute | Type | Description |
74
+ | ------------- | ------ | ---------------------------------------------------------- |
75
+ | assets | Array | List of assets to compile (only js and css files) |
76
+ | assets_paths | Array | List of directories where Sprockets find files for require |
77
+ | assets_url | String | URL for assets in production |
78
+ | compressors | Hash | Hash with selected compressors by type |
79
+ | dependencies | Array | List of gems to install and require |
80
+ | fallback_page | String | Fallback page (i.e HTML5 mode in frontend routers) |
81
+ | output | String | Path to a directory where compiled assets will be written |
82
+ | pages | Array | List of pages to compile |
83
+ | pages_paths | Array | List of directories where Fronton find html files |
82
84
 
83
85
  ### Gem sources
84
86
 
@@ -18,7 +18,7 @@ module Fronton
18
18
 
19
19
  def asset_path(name)
20
20
  asset_name = @use_digest && @manifest.assets[name] ? @manifest.assets[name] : name
21
- "#{@prefix}/#{asset_name}"
21
+ "/#{@prefix}/#{asset_name}"
22
22
  end
23
23
  end
24
24
  end
@@ -60,6 +60,12 @@ module Fronton
60
60
  end
61
61
  end
62
62
 
63
+ def fallback_page
64
+ if @config['fallback_page']
65
+ Page.new(@config['fallback_page'], '/', config: self)
66
+ end
67
+ end
68
+
63
69
  def pages
64
70
  @pages ||= begin
65
71
  pages = @config['pages'].is_a?(Array) ? @config['pages'] : []
@@ -16,7 +16,13 @@ module Fronton
16
16
  error_404
17
17
  end
18
18
  else
19
- error_404
19
+ fallback = @config.fallback_page
20
+
21
+ if fallback
22
+ render_page(fallback)
23
+ else
24
+ error_404
25
+ end
20
26
  end
21
27
  end
22
28
 
@@ -1,7 +1,7 @@
1
1
  module Fronton
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 1
4
+ MINOR = 2
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
data/template/fronton.yml CHANGED
@@ -18,6 +18,7 @@ compressors:
18
18
  dependencies:
19
19
  - rails-assets-jquery: 3.1.0
20
20
  - slim: 3.0.7
21
+ fallback_page: index.slim
21
22
  output: public
22
23
  pages:
23
24
  - index.slim: /
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fronton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Aranda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-13 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor