lookbook 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f8f1296766bc3e1633b2a13f65fb857d91e00b9241aebc0d5be38195b809a6d
4
- data.tar.gz: 827269bab9d8061037827c4fb4a8d9a9bd470731a7aeb84fcb38efad0d2ae510
3
+ metadata.gz: 11cae6b11c0235c9c609462d70782b48f95e8f33a654296cabbf4e081cab4c27
4
+ data.tar.gz: df711457ea8f7c7b2ea8956cf621130bf508b539c17563efc0d40592161430e5
5
5
  SHA512:
6
- metadata.gz: fe0f602089cfa3df7c851bca4ee6eb1abba4f88a445e1958a29b8ed76580848ffd85c458748c2b4d7196c3303a28033c770ceee6eac454526f351f1af5369c82
7
- data.tar.gz: adf895f49bc935af34f9f72847c25a73f01856d6548d3c637f6369f9c6e5885f080da36a301a6e787b960fc36d0a0ae51a499cc6e98b221872e877552c4f0502
6
+ metadata.gz: e0adbfc0d81f98a8876c3e5b5325808c4b3120c702fe2a4b85af3d4599cffaf869bb0b5ba453685c2f31b6b1a1080750bdc77da9c4a9d0d940187aa9f6846490
7
+ data.tar.gz: cc581f238ea0f3fc00108350a6ab7657cd41a1ee9ea0f946a91a2d0baf86f11dcd532ca0bbdc6fe1a3f67e275e9f9c976be4bcb0a6726555391e34576fc00fdc
@@ -17,6 +17,7 @@ module Lookbook
17
17
 
18
18
  def index
19
19
  landing = Lookbook.pages.find(&:landing?) || Lookbook.pages.first
20
+
20
21
  if landing.present?
21
22
  redirect_to lookbook_page_path(landing.path)
22
23
  else
@@ -10,6 +10,26 @@ module Lookbook
10
10
  "lookbook/previews"
11
11
  end
12
12
 
13
+ def index
14
+ respond_to do |format|
15
+ format.json do
16
+ render(
17
+ json: Lookbook.previews.map do |preview|
18
+ {
19
+ name: preview.name,
20
+ examples: preview.examples.map { |example|
21
+ {
22
+ inspect_path: example.url_path,
23
+ name: example.name
24
+ }
25
+ }
26
+ }
27
+ end
28
+ )
29
+ end
30
+ end
31
+ end
32
+
13
33
  def show
14
34
  if @target
15
35
  begin
data/config/routes.rb CHANGED
@@ -8,6 +8,7 @@ Lookbook::Engine.routes.draw do
8
8
  get "/#{Lookbook.config.page_route}", to: "pages#index", as: :lookbook_page_index
9
9
  get "/#{Lookbook.config.page_route}/*path", to: "pages#show", as: :lookbook_page
10
10
 
11
+ get "/previews", to: "previews#index", as: :lookbook_previews
11
12
  get "/preview/*path", to: "previews#show", as: :lookbook_preview
12
13
  get "/inspect/*path", to: "inspector#show", as: :lookbook_inspect
13
14
 
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end