Skip to content

Commit

Permalink
Add integrity and defer to assets (#14)
Browse files Browse the repository at this point in the history
* Add integrity and defer to assets

* Remove defer attributes

* Fix empty line

Co-authored-by: moustachu <[email protected]>
  • Loading branch information
armandfardeau and moustachu authored Nov 23, 2021
1 parent 037fe02 commit 855706e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
31 changes: 31 additions & 0 deletions app/views/layouts/decidim/_head.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%= csrf_meta_tags %>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<% available_locales.each do |locale| %>
<link rel="alternate" href="<%= url_for(request.parameters.merge(locale: locale)) %>" hreflang="<%= locale %>">
<% end %>

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@<%= decidim_meta_twitter_handler %>">
<meta name="twitter:title" content="<%= decidim_page_title %>">
<meta name="twitter:description" content="<%= decidim_meta_description %>">
<meta name="twitter:image" content="<%= decidim_meta_image_url %>">

<meta property="og:url" content="<%= decidim_meta_url %>">
<meta property="og:type" content="article">
<meta property="og:title" content="<%= decidim_page_title %>">
<meta property="og:description" content="<%= decidim_meta_description %>">
<meta property="og:image" content="<%= decidim_meta_image_url %>">

<%= favicon %>
<%= stylesheet_link_tag "application", media: "all", integrity: true %>
<%= invisible_captcha_styles %>
<%= organization_colors %>
<%= javascript_include_tag "decidim/confirm", integrity: true %>
<%= javascript_include_tag "application", integrity: true %>
<%= foundation_datepicker_locale_tag %>

<%= render partial: "layouts/decidim/head_extra" %>
<%== current_organization.header_snippets if Decidim.enable_html_header_snippets %>
<%= snippets.display(:head) %>
<%= content_for :header_snippets %>
19 changes: 10 additions & 9 deletions config/initializers/carrierwave.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# frozen_string_literal: true

# Default CarrierWave setup.
#
CarrierWave.configure do |config|
config.permissions = 0o666
config.directory_permissions = 0o777
config.storage = :file
config.enable_processing = !Rails.env.test?
# This needs to be set for correct attachment file URLs in emails
# DON'T FORGET to ALSO set this in `config/application.rb`
# config.asset_host = "https://your.server.url"
unless Rails.env.test?
CarrierWave.configure do |config|
config.permissions = 0o666
config.directory_permissions = 0o777
config.storage = :file
config.enable_processing = true
# This needs to be set for correct attachment file URLs in emails
# DON'T FORGET to ALSO set this in `config/application.rb`
config.asset_host = "https://entre-vos-mains.alsace.eu"
end
end

# Setup CarrierWave to use Amazon S3. Add `gem "fog-aws" to your Gemfile.
Expand Down

0 comments on commit 855706e

Please sign in to comment.