station 0.0.105 → 0.0.110
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nexmo-developer +7 -0
- data/lib/nexmo_developer/Gemfile +10 -25
- data/lib/nexmo_developer/Gemfile.lock +131 -147
- data/lib/nexmo_developer/app/assets/config/manifest.js +1 -4
- data/lib/nexmo_developer/app/assets/javascripts/application.js +2 -7
- data/lib/nexmo_developer/app/assets/stylesheets/application.css +1 -1
- data/lib/nexmo_developer/app/controllers/static_controller.rb +3 -11
- data/lib/nexmo_developer/app/helpers/application_helper.rb +2 -0
- data/lib/nexmo_developer/app/models/tutorial.rb +10 -12
- data/lib/nexmo_developer/app/models/tutorial/prerequisite.rb +3 -1
- data/lib/nexmo_developer/app/models/tutorial/task.rb +24 -11
- data/lib/nexmo_developer/app/services/translator/files_list_coordinator.rb +90 -0
- data/lib/nexmo_developer/app/services/translator/smartling/api/download_file.rb +6 -1
- data/lib/nexmo_developer/app/services/translator/smartling/api/file_status.rb +7 -1
- data/lib/nexmo_developer/app/services/translator/utils.rb +1 -1
- data/lib/nexmo_developer/app/views/admin/feedbacks/_steps.html.erb +1 -1
- data/lib/nexmo_developer/app/views/layouts/partials/_footer.html.erb +4 -4
- data/lib/nexmo_developer/app/views/layouts/partials/_head.html.erb +4 -5
- data/lib/nexmo_developer/app/views/layouts/partials/_header.html.erb +3 -3
- data/lib/nexmo_developer/app/views/layouts/partials/_improve_this_page.html.erb +1 -1
- data/lib/nexmo_developer/app/views/static/_products.html.erb +20 -17
- data/lib/nexmo_developer/app/views/static/default_landing/partials/_join_slack.html.erb +1 -1
- data/lib/nexmo_developer/app/views/static/landing.html.erb +8 -8
- data/lib/nexmo_developer/app/views/static/{robots.txt.erb → robots.text.erb} +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/Lato-Black.woff +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/Lato-Black.woff2 +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/Lato-Regular.woff +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/Lato-Regular.woff2 +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/Lato-Semibold.woff +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/Lato-Semibold.woff2 +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/icomoon.eot +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/icomoon.json +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/icomoon.svg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/icomoon.ttf +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/fonts/icomoon.woff +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/.keep +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/logo@3x.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/logo_vonage.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/nexmo-developer-logo.svg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/nexmo-logo-collapsed.svg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/nexmo-vonage-white.svg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/chatapp.jpg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/chatapp_small.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/nexmo.jpg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/numberinsight.jpg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/numberinsight_small.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/sms.jpg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/sms_small.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/verify.jpg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/verify_small.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/voice.jpg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/posters/voice_small.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/select-dropdown.png +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/slack.svg +0 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/images/themes/ea/topography.png +0 -0
- data/lib/nexmo_developer/app/webpacker/javascript/code_snippet_events/index.js +23 -85
- data/lib/nexmo_developer/app/webpacker/javascript/volta/volta.js +1 -1
- data/lib/nexmo_developer/app/webpacker/javascript/volta_tabbed_examples/index.js +23 -3
- data/lib/nexmo_developer/app/webpacker/packs/active_admin.js +5 -0
- data/lib/nexmo_developer/app/webpacker/packs/active_admin/print.scss +2 -0
- data/lib/nexmo_developer/app/webpacker/packs/application.js +12 -0
- data/lib/nexmo_developer/app/{assets → webpacker}/stylesheets/active_admin.scss +4 -4
- data/lib/nexmo_developer/app/webpacker/stylesheets/application.scss +0 -1
- data/lib/nexmo_developer/app/webpacker/stylesheets/custom/_core.scss +1 -1
- data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_icons.scss +1 -0
- data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_navigation.scss +1 -2
- data/lib/nexmo_developer/config/environments/development.rb +1 -1
- data/lib/nexmo_developer/config/environments/production.rb +8 -1
- data/lib/nexmo_developer/config/initializers/active_admin.rb +3 -0
- data/lib/nexmo_developer/config/initializers/assets.rb +0 -2
- data/lib/nexmo_developer/config/webpack/environment.js +10 -0
- data/lib/nexmo_developer/config/webpack/plugins/jquery.js +7 -0
- data/lib/nexmo_developer/lib/tasks/smartling.rake +7 -0
- data/lib/nexmo_developer/nexmo_developer.rb +1 -4
- data/lib/nexmo_developer/version.rb +1 -1
- data/package.json +25 -17
- data/station.gemspec +5 -12
- data/yarn.lock +1510 -1021
- metadata +159 -239
- data/lib/nexmo_developer/app/assets/fonts/nexmo-developer.json +0 -36483
- data/lib/nexmo_developer/app/assets/javascripts/active_admin.js.coffee +0 -1
- data/lib/nexmo_developer/app/assets/javascripts/stats.js +0 -14
- data/lib/nexmo_developer/app/assets/regex/matching_chars.rb +0 -1
- data/lib/nexmo_developer/app/assets/regex/sequence_diagram_regex.rb +0 -1
- data/lib/nexmo_developer/app/assets/regex/stats_regex.rb +0 -1
- data/lib/nexmo_developer/app/assets/regex/webfont_regex.rb +0 -1
- data/lib/nexmo_developer/app/views/slack/join.html.erb +0 -25
- data/lib/nexmo_developer/app/views/static/_community.html.erb +0 -24
- data/lib/nexmo_developer/app/views/static/_dotnet.html.erb +0 -26
- data/lib/nexmo_developer/app/views/static/_slack.html.erb +0 -2
- data/lib/nexmo_developer/app/views/static/_xwithy.html.erb +0 -33
- data/lib/nexmo_developer/app/views/static/podcast.html.erb +0 -40
- data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_building-block.scss +0 -32
- data/lib/nexmo_developer/vendor/assets/javascripts/jquery-scrolltofixed.js +0 -567
- data/lib/nexmo_developer/vendor/assets/javascripts/mermaid.js +0 -49
- data/lib/nexmo_developer/vendor/assets/javascripts/underscore.js +0 -5
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/addons/jquery.tablesorter.js +0 -1031
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/addons/prism.js +0 -22
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/side-navigation/volta.menu.js +0 -377
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.accordion.js +0 -249
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.dropdown.js +0 -145
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.flash.js +0 -175
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.modal.js +0 -312
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.tab.js +0 -203
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/components/volta.tooltip.js +0 -71
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/popper.min.js +0 -5
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/svgxuse.min.js +0 -12
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/tooltip.min.js +0 -5
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/volta.core.js +0 -238
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/volta.js +0 -2141
- data/lib/nexmo_developer/vendor/assets/javascripts/volta/volta.min.js +0 -1
@@ -1,3 +1,3 @@
|
|
1
1
|
<h2 class="Vlt-title--nomargin Vlt-center">
|
2
|
-
<%=
|
2
|
+
<%= image_pack_tag 'slack.svg', id: 'community-slack-image' %> Join the <%= link_to "Vonage Developer Community Slack", community_slack_path, { :class=>"Vlt-text-btn" } %>
|
3
3
|
</h2>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
<div class="row">
|
4
4
|
<div class="center">
|
5
|
-
<h1 class="Vlt-title--margin-top2">
|
6
|
-
<p class="p-large">
|
5
|
+
<h1 class="Vlt-title--margin-top2">Default Entry Page</h1>
|
6
|
+
<p class="p-large">This is the default landing page for a developer portal running on Station.</p>
|
7
7
|
</div>
|
8
8
|
<div class="columns small-12">
|
9
9
|
<a name="products"></a>
|
@@ -17,10 +17,10 @@
|
|
17
17
|
<h2>
|
18
18
|
<a href="/tools">
|
19
19
|
<div><svg class="Vlt-icon Vlt-icon--large Vlt-purple-dark"><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-design-tools"/></svg></div>
|
20
|
-
|
20
|
+
Featured Topic 1
|
21
21
|
</a>
|
22
22
|
</h2>
|
23
|
-
<p>
|
23
|
+
<p>You can choose to highlight an area of your portal on the landing page.</p>
|
24
24
|
</div>
|
25
25
|
</div>
|
26
26
|
<div class="Vlt-col Vlt-col--M-1of2">
|
@@ -28,10 +28,10 @@
|
|
28
28
|
<h2>
|
29
29
|
<a href="/community">
|
30
30
|
<div><svg class="Vlt-icon Vlt-icon--large Vlt-purple-dark"><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-group"/></svg></div>
|
31
|
-
|
31
|
+
Featured Topic 2
|
32
32
|
</a>
|
33
33
|
</h2>
|
34
|
-
<p>
|
34
|
+
<p>You can highlight more than one area.</p>
|
35
35
|
</div>
|
36
36
|
</div>
|
37
37
|
</div>
|
@@ -39,8 +39,8 @@
|
|
39
39
|
<hr class="hr--tall">
|
40
40
|
|
41
41
|
<div class="center">
|
42
|
-
<h3>
|
43
|
-
<p class="p-large">
|
42
|
+
<h3>Modifying This Content</h3>
|
43
|
+
<p class="p-large">To modify this content you can copy <a href="https://raw.githubusercontent.com/Nexmo/station/master/lib/nexmo_developer/app/views/static/landing.html.erb">this file</a> to the `custom/views/static` folder in your documentation folder and modify that copy. More detailed instructions to create your own landing page can be found on the <a href="https://nexmo.github.io/station/How-To-Use#customization-options">Station documentation</a>.</p>
|
44
44
|
</div>
|
45
45
|
</div>
|
46
46
|
</div>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,89 +1,27 @@
|
|
1
|
-
|
2
|
-
let hasTriggeredCopyStat = {};
|
3
|
-
let hasTriggeredLinkStat = {};
|
4
|
-
|
5
|
-
// Track copy to clipboard usage
|
6
|
-
var clipboard = new Clipboard('.copy-button',{
|
7
|
-
text: function(trigger) {
|
8
|
-
return $(trigger).next().find('.main-code').text();
|
9
|
-
}
|
10
|
-
});
|
11
|
-
|
12
|
-
clipboard.on('success', function(e) {
|
13
|
-
let trigger = $(e.trigger);
|
14
|
-
|
15
|
-
let params = {
|
16
|
-
"language": trigger.attr("data-lang"),
|
17
|
-
"snippet": trigger.attr("data-block"),
|
18
|
-
"section": trigger.attr("data-section"),
|
19
|
-
"event": "copy"
|
20
|
-
};
|
21
|
-
|
22
|
-
let key = params['language'] + params['section'] + params['snippet'];
|
23
|
-
|
24
|
-
// We only want to track each copy once per page load
|
25
|
-
if (hasTriggeredCopyStat[key]) { return true; }
|
26
|
-
|
27
|
-
trigger.find('span').text('Copied');
|
28
|
-
|
29
|
-
fetch(createRequest(params))
|
30
|
-
.then((response) => {
|
31
|
-
if (response.ok) { return response.json() }
|
32
|
-
return Promise.reject({ message: 'Bad response from server', response })
|
33
|
-
})
|
34
|
-
.then((payload) => {
|
35
|
-
hasTriggeredCopyStat[key] = true;
|
36
|
-
})
|
37
|
-
|
38
|
-
// Can we point them to the dependencies too?
|
39
|
-
if (trigger.parent().hasClass("main-code")) {
|
40
|
-
trigger.parent().parent().find(".configure-dependencies").prepend("<span class='label label--small'>Don't forget me!</span>");
|
41
|
-
}
|
1
|
+
import Clipboard from 'clipboard';
|
42
2
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
console.error('Action:', e.action);
|
48
|
-
console.error('Trigger:', e.trigger);
|
49
|
-
});
|
50
|
-
|
51
|
-
// Track source link usage
|
52
|
-
$(document).on('mousedown', '.source-link', function(e){
|
53
|
-
if (e.which === 3) { return; }
|
54
|
-
let trigger = $(this);
|
55
|
-
|
56
|
-
let section = trigger.attr("data-section");
|
57
|
-
|
58
|
-
let params = {
|
59
|
-
"language": trigger.attr("data-lang"),
|
60
|
-
"snippet": trigger.attr("data-block"),
|
61
|
-
"section": section,
|
62
|
-
"event": "source"
|
63
|
-
};
|
64
|
-
|
65
|
-
let key = params['language'] + params['section'];
|
66
|
-
|
67
|
-
if (hasTriggeredLinkStat[key]) { return true; }
|
68
|
-
|
69
|
-
fetch(createRequest(params))
|
70
|
-
.then((response) => {
|
71
|
-
if (response.ok) { return response.json() }
|
72
|
-
return Promise.reject({ message: 'Bad response from server', response })
|
73
|
-
})
|
74
|
-
.then((payload) => {
|
75
|
-
hasTriggeredLinkStat[key] = true;
|
76
|
-
})
|
77
|
-
});
|
3
|
+
export default () => {
|
4
|
+
document.querySelectorAll('.code-toolbar button').forEach(function(button) {
|
5
|
+
button.addEventListener('click', createRequest, { once: true })
|
6
|
+
});
|
78
7
|
};
|
79
8
|
|
80
|
-
function createRequest(
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
9
|
+
function createRequest(event) {
|
10
|
+
let dataset = event.target.closest('.code-toolbar').firstChild.dataset;
|
11
|
+
|
12
|
+
let params = {
|
13
|
+
"language": dataset.lang,
|
14
|
+
"snippet": dataset.block,
|
15
|
+
"section": dataset.section,
|
16
|
+
"event": "copy"
|
17
|
+
};
|
18
|
+
|
19
|
+
fetch(new Request('/usage/code_snippet', {
|
20
|
+
method: 'POST',
|
21
|
+
credentials: 'same-origin',
|
22
|
+
body: JSON.stringify(params),
|
23
|
+
headers: {
|
24
|
+
'Content-Type': 'application/json'
|
25
|
+
}
|
26
|
+
}));
|
89
27
|
}
|
@@ -1455,7 +1455,7 @@ Volta.tab = function () {
|
|
1455
1455
|
|
1456
1456
|
this._activeLink.setAttribute('tabindex', '0');
|
1457
1457
|
this._activeLink.setAttribute('aria-selected', 'true');
|
1458
|
-
|
1458
|
+
this._activeLink.focus({ preventScroll: true });
|
1459
1459
|
if (this._activePanel) {
|
1460
1460
|
this._activePanel.removeAttribute('hidden');
|
1461
1461
|
}
|
@@ -11,6 +11,7 @@ export default class VoltaTabbedExamples {
|
|
11
11
|
this.onTabClick = this.onTabClick.bind(this)
|
12
12
|
this.onPopState = this.onPopState.bind(this)
|
13
13
|
this.persistLanguage = this.persistLanguage.bind(this)
|
14
|
+
this.activateTabFromURLHash = this.activateTabFromURLHash.bind(this);
|
14
15
|
this.restoreTabs()
|
15
16
|
this.setupEvents()
|
16
17
|
}
|
@@ -55,6 +56,9 @@ export default class VoltaTabbedExamples {
|
|
55
56
|
setupEvents() {
|
56
57
|
$('.Vlt-tabs__link').click(this.onTabClick)
|
57
58
|
$(window).on('popstate', this.onPopState)
|
59
|
+
|
60
|
+
window.addEventListener("load", this.activateTabFromURLHash);
|
61
|
+
window.addEventListener("hashchange", this.activateTabFromURLHash);
|
58
62
|
}
|
59
63
|
|
60
64
|
onPopState(event) {
|
@@ -64,12 +68,14 @@ export default class VoltaTabbedExamples {
|
|
64
68
|
}
|
65
69
|
|
66
70
|
onTabClick(event) {
|
71
|
+
const target = $(event.currentTarget);
|
67
72
|
// Prevent nested tabs from changing the url
|
68
73
|
if ($(event.target).parents('.Vlt-tabs').length > 1) { return; }
|
69
74
|
|
70
|
-
const language =
|
71
|
-
const languageType =
|
72
|
-
const linkable =
|
75
|
+
const language = target.data('language')
|
76
|
+
const languageType = target.data('language-type')
|
77
|
+
const linkable = target.data('language-linkable')
|
78
|
+
const tabId = target.attr('id');
|
73
79
|
|
74
80
|
if (language) {
|
75
81
|
if (linkable) {
|
@@ -81,6 +87,8 @@ export default class VoltaTabbedExamples {
|
|
81
87
|
}
|
82
88
|
|
83
89
|
this.persistLanguage(language, languageType, linkable)
|
90
|
+
} else if (tabId) {
|
91
|
+
window.location.hash = tabId;
|
84
92
|
}
|
85
93
|
}
|
86
94
|
|
@@ -103,4 +111,16 @@ export default class VoltaTabbedExamples {
|
|
103
111
|
setPlatform(platform) {
|
104
112
|
setTimeout(() => { $(`[data-platform='${platform}']`).click(); }, 0);
|
105
113
|
}
|
114
|
+
|
115
|
+
activateTabFromURLHash() {
|
116
|
+
let tabId = window.location.hash;
|
117
|
+
|
118
|
+
if (tabId !== "") {
|
119
|
+
let tab = document.querySelector(`.Vlt-tabs__link${tabId}`);
|
120
|
+
if (tab) {
|
121
|
+
tab.focus();
|
122
|
+
tab.click();
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
106
126
|
}
|
@@ -14,14 +14,26 @@ import Rails from "@rails/ujs"
|
|
14
14
|
|
15
15
|
import '../stylesheets/application'
|
16
16
|
|
17
|
+
require.context('../images', true);
|
18
|
+
require.context('../fonts', true);
|
19
|
+
|
17
20
|
require.context('@vonagevolta/volta2/images/logos', true)
|
18
21
|
require.context('@vonagevolta/volta2/dist/symbol', true)
|
19
22
|
|
23
|
+
require('chartkick');
|
24
|
+
require('chart.js');
|
25
|
+
require('jquery');
|
26
|
+
require('clipboard');
|
27
|
+
require('underscore');
|
28
|
+
require('@googlemaps/google-maps-services-js');
|
29
|
+
|
20
30
|
// XXX: hack for Volta, unfortunately it doesn't provide modules :(
|
21
31
|
import Volta from "../javascript/volta/volta.js"
|
22
32
|
|
23
33
|
import Vue from 'vue'
|
24
34
|
|
35
|
+
import mermaid from 'mermaid'
|
36
|
+
|
25
37
|
import { TweenLite, CSSPlugin } from 'gsap'
|
26
38
|
import GithubCards from '../javascript/github_cards'
|
27
39
|
import VoltaTabbedExamples from '../javascript/volta_tabbed_examples'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
//
|
1
|
+
// Sass variable overrides must be declared before loading up Active Admin's styles.
|
2
2
|
//
|
3
3
|
// To view the variables that Active Admin provides, take a look at
|
4
4
|
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
|
@@ -8,10 +8,10 @@
|
|
8
8
|
// $sidebar-width: 242px;
|
9
9
|
|
10
10
|
// Active Admin's got SASS!
|
11
|
-
@import "
|
12
|
-
@import "
|
11
|
+
@import "~@activeadmin/activeadmin/src/scss/mixins";
|
12
|
+
@import "~@activeadmin/activeadmin/src/scss/base";
|
13
13
|
|
14
|
-
// Overriding any non-variable
|
14
|
+
// Overriding any non-variable Sass must be done after the fact.
|
15
15
|
// For example, to change the default status-tag color:
|
16
16
|
//
|
17
17
|
// .status_tag { background: #6090DB; }
|
@@ -47,7 +47,7 @@ Rails.application.configure do
|
|
47
47
|
# Debug mode disables concatenation and preprocessing of assets.
|
48
48
|
# This option may cause significant delays in view rendering with a large
|
49
49
|
# number of complex assets.
|
50
|
-
config.assets.debug = true
|
50
|
+
# config.assets.debug = true
|
51
51
|
|
52
52
|
config.assets.check_precompiled_asset = false
|
53
53
|
|
@@ -20,7 +20,14 @@ Rails.application.configure do
|
|
20
20
|
|
21
21
|
# Disable serving static files from the `/public` folder by default since
|
22
22
|
# Apache or NGINX already handles this.
|
23
|
-
|
23
|
+
if ENV['RAILS_SERVE_STATIC_FILES'].present?
|
24
|
+
config.public_file_server.enabled = true
|
25
|
+
|
26
|
+
config.public_file_server.headers = {
|
27
|
+
'Cache-Control' => 'public, max-age=31536000',
|
28
|
+
'Expires' => 1.year.from_now.to_formatted_s(:rfc822),
|
29
|
+
}
|
30
|
+
end
|
24
31
|
|
25
32
|
# Compress JavaScripts and CSS.
|
26
33
|
# config.assets.js_compressor = Uglifier.new(harmony: true)
|
@@ -12,5 +12,3 @@ Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
|
12
12
|
# application.js, application.css, and all non-JS/CSS in the app/assets
|
13
13
|
# folder are already added.
|
14
14
|
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
15
|
-
|
16
|
-
Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
|