Skip to content

Commit edcc0bb

Browse files
committed
Enable to open '/docs/*' without Scrivito
1 parent b377877 commit edcc0bb

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

app/helpers/application_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ def meta_description(description)
2929
def kata_description
3030
"全国の CoderDojo で活用されている資料や教材、子ども向けのプログラミングキャンプ・プログラミングコンテスト情報、CoderDojo の立ち上げ方・関わり方など、CoderDojo を中心にして色々なトピックまとめています。"
3131
end
32+
33+
def using_scrivito?
34+
# TODO: There may be smarter detection
35+
USING_SCRIVITO
36+
end
3237
end

app/helpers/scrivito_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module ScrivitoHelper
2+
USING_SCRIVITO = true
3+
end

app/views/layouts/application.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
1717
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
1818
<%= csrf_meta_tags %>
19-
<%= scrivito_head_tags %>
19+
<%= scrivito_head_tags if using_scrivito? %>
2020

2121
<meta property="fb:admins" content="715330868" />
2222
<meta property="fb:app_id" content="805184859580207" />
@@ -80,7 +80,7 @@
8080
<div class="alert alert-<%= message_type %>"><%= message %></div>
8181
<% end %>
8282
<%= yield %>
83-
<%= scrivito_body_tags %>
83+
<%= scrivito_body_tags if using_scrivito? %>
8484
</body>
8585

8686
<div id="fb-root"></div>

config/initializers/scrivito.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
USING_SCRIVITO = false
12
Scrivito.configure do |config|
23
#
34
# Uncomment following lines in order to explicitly set the tenant and the API key.

0 commit comments

Comments
 (0)