amp-html 0.7.18 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +82 -77
- data/README.md +61 -75
- data/app/helpers/amp_html/asset_helper.rb +11 -0
- data/app/helpers/amp_html/base_helper.rb +14 -0
- data/app/helpers/amp_html/dynamic_content_helper.rb +14 -0
- data/app/helpers/amp_html/layouts_helper.rb +11 -0
- data/app/helpers/amp_html/media_helper.rb +15 -0
- data/app/views/mozaic/amp/_amp-link.html.erb +1 -0
- data/app/views/mozaic/amp/_audio.html.erb +11 -0
- data/app/views/mozaic/amp/_canonical-link.html.erb +1 -0
- data/app/views/mozaic/amp/_components.html.erb +6 -0
- data/app/views/mozaic/amp/_doctype.html.erb +4 -0
- data/app/views/mozaic/amp/_font.html.erb +2 -0
- data/app/views/mozaic/amp/_form-response.html.erb +5 -0
- data/app/views/mozaic/amp/_form.html.erb +3 -0
- data/app/views/mozaic/amp/_head.html.erb +13 -0
- data/app/views/mozaic/amp/_img.html.erb +1 -0
- data/app/views/mozaic/amp/_input.html.erb +1 -0
- data/app/views/mozaic/amp/_mustache.html.erb +3 -0
- data/app/views/mozaic/amp/_selector.html.erb +3 -0
- data/app/views/mozaic/amp/_video.html.erb +11 -0
- data/lib/amp-html.rb +4 -20
- data/lib/amp-html/configuration.rb +13 -158
- data/lib/amp-html/engine.rb +6 -0
- data/lib/amp-html/railtie.rb +109 -0
- data/lib/amp-html/version.rb +1 -9
- data/lib/generators/amp_html_generator.rb +27 -0
- data/lib/generators/templates/{assets/stylesheets/application.scss → application.css} +1 -1
- data/lib/generators/templates/initializer.rb +14 -0
- data/lib/generators/templates/layout.html.erb +15 -0
- metadata +53 -204
- data/.github/issue_template.md +0 -16
- data/.github/pull_request_template.md +0 -21
- data/.gitignore +0 -13
- data/.travis.yml +0 -4
- data/CODE_OF_CONDUCT.md +0 -46
- data/CONTRIBUTING.md +0 -1
- data/DEPRECATIONS.md +0 -9
- data/Gemfile +0 -12
- data/Gemfile.lock +0 -164
- data/INSTALL.md +0 -2
- data/OWNERS.yaml +0 -1
- data/Rakefile +0 -6
- data/amp-html.gemspec +0 -30
- data/bin/amp-html +0 -4
- data/lib/amp-html/cli.rb +0 -113
- data/lib/amp-html/components/docs/README.md +0 -101
- data/lib/amp-html/components/docs/ad.md +0 -83
- data/lib/amp-html/components/docs/analytics.md +0 -131
- data/lib/amp-html/components/docs/anim.md +0 -66
- data/lib/amp-html/components/docs/fonts.md +0 -63
- data/lib/amp-html/components/docs/forms.md +0 -79
- data/lib/amp-html/components/docs/iframe.md +0 -62
- data/lib/amp-html/components/docs/javascript.md +0 -71
- data/lib/amp-html/components/docs/lists.md +0 -168
- data/lib/amp-html/components/docs/media.md +0 -52
- data/lib/amp-html/components/docs/mustache.md +0 -46
- data/lib/amp-html/components/docs/notifications.md +0 -0
- data/lib/amp-html/components/docs/schema.md +0 -80
- data/lib/amp-html/components/docs/service_worker.md +0 -60
- data/lib/amp-html/components/docs/social.md +0 -130
- data/lib/amp-html/components/docs/stylesheets.md +0 -50
- data/lib/amp-html/components/help.rb +0 -19
- data/lib/amp-html/components/install.rb +0 -34
- data/lib/amp-html/components/templates/ERROR.md +0 -5
- data/lib/amp-html/components/templates/README.md +0 -12
- data/lib/amp-html/configuration/docs/README.md +0 -0
- data/lib/amp-html/configuration/help.rb +0 -11
- data/lib/amp-html/helpers/docs/README.md +0 -98
- data/lib/amp-html/helpers/docs/amp.md +0 -0
- data/lib/amp-html/helpers/docs/amp_ad.md +0 -86
- data/lib/amp-html/helpers/docs/amp_analytics.md +0 -76
- data/lib/amp-html/helpers/docs/amp_anim.md +0 -68
- data/lib/amp-html/helpers/docs/amp_audio.md +0 -54
- data/lib/amp-html/helpers/docs/amp_auto_ads.md +0 -43
- data/lib/amp-html/helpers/docs/amp_close_user_notification_button.md +0 -0
- data/lib/amp-html/helpers/docs/amp_css.md +0 -37
- data/lib/amp-html/helpers/docs/amp_css_link.md +0 -0
- data/lib/amp-html/helpers/docs/amp_custom_ad.md +0 -0
- data/lib/amp-html/helpers/docs/amp_document_link.md +0 -0
- data/lib/amp-html/helpers/docs/amp_embed.md +0 -86
- data/lib/amp-html/helpers/docs/amp_facebook.md +0 -70
- data/lib/amp-html/helpers/docs/amp_fallback.md +0 -47
- data/lib/amp-html/helpers/docs/amp_font.md +0 -0
- data/lib/amp-html/helpers/docs/amp_font_link.md +0 -0
- data/lib/amp-html/helpers/docs/amp_form.md +0 -0
- data/lib/amp-html/helpers/docs/amp_form_response.md +0 -0
- data/lib/amp-html/helpers/docs/amp_gfycat.md +0 -0
- data/lib/amp-html/helpers/docs/amp_global_css.md +0 -0
- data/lib/amp-html/helpers/docs/amp_google_analytics.md +0 -0
- data/lib/amp-html/helpers/docs/amp_google_font.md +0 -0
- data/lib/amp-html/helpers/docs/amp_head.md +0 -0
- data/lib/amp-html/helpers/docs/amp_html_doctype.md +0 -0
- data/lib/amp-html/helpers/docs/amp_iframe.md +0 -0
- data/lib/amp-html/helpers/docs/amp_image.md +0 -0
- data/lib/amp-html/helpers/docs/amp_input.md +0 -0
- data/lib/amp-html/helpers/docs/amp_instagram.md +0 -0
- data/lib/amp-html/helpers/docs/amp_js.md +0 -0
- data/lib/amp-html/helpers/docs/amp_link.md +0 -0
- data/lib/amp-html/helpers/docs/amp_list.md +0 -0
- data/lib/amp-html/helpers/docs/amp_live_list.md +0 -0
- data/lib/amp-html/helpers/docs/amp_live_list_items.md +0 -0
- data/lib/amp-html/helpers/docs/amp_live_list_pagination.md +0 -0
- data/lib/amp-html/helpers/docs/amp_live_list_update.md +0 -0
- data/lib/amp-html/helpers/docs/amp_mustache.md +0 -0
- data/lib/amp-html/helpers/docs/amp_pin_it.md +0 -0
- data/lib/amp-html/helpers/docs/amp_pin_widget.md +0 -0
- data/lib/amp-html/helpers/docs/amp_pinterest_follow.md +0 -0
- data/lib/amp-html/helpers/docs/amp_pixel.md +0 -0
- data/lib/amp-html/helpers/docs/amp_placeholder.md +0 -0
- data/lib/amp-html/helpers/docs/amp_reddit.md +0 -0
- data/lib/amp-html/helpers/docs/amp_resources.md +0 -0
- data/lib/amp-html/helpers/docs/amp_selector.md +0 -0
- data/lib/amp-html/helpers/docs/amp_serviceworker.md +0 -0
- data/lib/amp-html/helpers/docs/amp_social_share.md +0 -0
- data/lib/amp-html/helpers/docs/amp_soundcloud.md +0 -0
- data/lib/amp-html/helpers/docs/amp_twitter.md +0 -0
- data/lib/amp-html/helpers/docs/amp_user_notification.md +0 -0
- data/lib/amp-html/helpers/docs/amp_video.md +0 -0
- data/lib/amp-html/helpers/docs/amp_video_ad.md +0 -0
- data/lib/amp-html/helpers/docs/amp_vine.md +0 -0
- data/lib/amp-html/helpers/docs/amp_youtube.md +0 -0
- data/lib/amp-html/helpers/docs/audio_tag.md +0 -0
- data/lib/amp-html/helpers/docs/canonical_document_link.md +0 -0
- data/lib/amp-html/helpers/docs/form_tag.md +0 -0
- data/lib/amp-html/helpers/docs/image_tag.md +0 -0
- data/lib/amp-html/helpers/docs/input_tag.md +0 -0
- data/lib/amp-html/helpers/docs/javascript_include_tag.md +0 -0
- data/lib/amp-html/helpers/docs/noscript_tag.md +0 -0
- data/lib/amp-html/helpers/docs/schema_tag.md +0 -0
- data/lib/amp-html/helpers/docs/stylesheet_link_tag.md +0 -0
- data/lib/amp-html/helpers/docs/video_tag.md +0 -0
- data/lib/amp-html/helpers/help.rb +0 -23
- data/lib/amp-html/root.rb +0 -7
- data/lib/amp-html/test.rb +0 -169
- data/lib/amp-html/test/help.rb +0 -11
- data/lib/amp-html/test/templates/README.md +0 -43
- data/lib/amp-html/test/templates/css/!important.md +0 -1
- data/lib/amp-html/test/templates/css/-amp-.md +0 -1
- data/lib/amp-html/test/templates/css/-moz-binding.md +0 -1
- data/lib/amp-html/test/templates/css/@import.md +0 -1
- data/lib/amp-html/test/templates/css/behavior.md +0 -1
- data/lib/amp-html/test/templates/css/filter.md +0 -1
- data/lib/amp-html/test/templates/css/i-amp-.md +0 -1
- data/lib/amp-html/test/templates/css/overflow.md +0 -1
- data/lib/amp-html/test/templates/html/applet.md +0 -1
- data/lib/amp-html/test/templates/html/audio.md +0 -1
- data/lib/amp-html/test/templates/html/base.md +0 -1
- data/lib/amp-html/test/templates/html/embed.md +0 -1
- data/lib/amp-html/test/templates/html/frame.md +0 -1
- data/lib/amp-html/test/templates/html/frameset.md +0 -1
- data/lib/amp-html/test/templates/html/http-equiv.md +0 -1
- data/lib/amp-html/test/templates/html/iframe.md +0 -1
- data/lib/amp-html/test/templates/html/img.md +0 -1
- data/lib/amp-html/test/templates/html/javascript_include_tag.md +0 -1
- data/lib/amp-html/test/templates/html/object.md +0 -1
- data/lib/amp-html/test/templates/html/onclick.md +0 -1
- data/lib/amp-html/test/templates/html/onmousehover.md +0 -1
- data/lib/amp-html/test/templates/html/param.md +0 -1
- data/lib/amp-html/test/templates/html/stylesheet_link_tag.md +0 -1
- data/lib/amp-html/test/templates/html/video.md +0 -1
- data/lib/amp-html/test/templates/markup/!doctype.md +0 -1
- data/lib/amp-html/test/templates/markup/amp_document_link.md +0 -1
- data/lib/amp-html/test/templates/markup/amp_head.md +0 -1
- data/lib/amp-html/test/templates/markup/amp_html_doctype.md +0 -1
- data/lib/amp-html/test/templates/markup/canonical_document_link.md +0 -1
- data/lib/amp-html/test/templates/markup/head_body.md +0 -1
- data/lib/amp-html/test/templates/markup/html.md +0 -1
- data/lib/amp-html/test/templates/markup/meta_viewport.md +0 -1
- data/lib/amp-html/validate.rb +0 -46
- data/lib/amp-html/validate/help.rb +0 -11
- data/lib/amp-html/validate/templates/README.md +0 -32
- data/lib/generators/amp_html/assets_generator.rb +0 -31
- data/lib/generators/amp_html/bundle_generator.rb +0 -50
- data/lib/generators/amp_html/components_generator.rb +0 -84
- data/lib/generators/amp_html/helpers_generator.rb +0 -32
- data/lib/generators/amp_html/install_generator.rb +0 -53
- data/lib/generators/amp_html/views_generator.rb +0 -62
- data/lib/generators/templates/assets/README.md +0 -0
- data/lib/generators/templates/components/README.md +0 -0
- data/lib/generators/templates/components/views/_components.html.erb +0 -141
- data/lib/generators/templates/components/views/_google_analytics.html.erb +0 -23
- data/lib/generators/templates/helpers/README.md +0 -0
- data/lib/generators/templates/helpers/amp/fallback_tag_helper.rb +0 -16
- data/lib/generators/templates/helpers/amp/font_tag_helper.rb +0 -37
- data/lib/generators/templates/helpers/amp/link_tag_helper.rb +0 -11
- data/lib/generators/templates/helpers/amp/mustache_tag_helper.rb +0 -13
- data/lib/generators/templates/helpers/amp/noscript_tag_helper.rb +0 -13
- data/lib/generators/templates/helpers/amp/placeholder_tag_helper.rb +0 -16
- data/lib/generators/templates/helpers/amp/schema_tag_helper.rb +0 -16
- data/lib/generators/templates/helpers/amp/stylesheets_tag_helper.rb +0 -21
- data/lib/generators/templates/helpers/amp_tag_helper.rb.erb +0 -65
- data/lib/generators/templates/helpers/asset_tag_helper.rb.erb +0 -119
- data/lib/generators/templates/helpers/form_tag_helper.rb.erb +0 -79
- data/lib/generators/templates/install/README.md +0 -0
- data/lib/generators/templates/install/amp-html.rb.erb +0 -19
- data/lib/generators/templates/install/amp-html.yml.erb +0 -189
- data/lib/generators/templates/views/README.md +0 -0
- data/lib/generators/templates/views/application.html.erb +0 -71
- data/lib/generators/templates/views/application/_head.html.erb +0 -47
- data/lib/generators/templates/views/application/_resources.html.erb +0 -16
- data/lib/generators/templates/views/application/_schema.html.erb +0 -6
- data/lib/generators/templates/views/config/mime_types.rb +0 -8
@@ -1,79 +0,0 @@
|
|
1
|
-
module FormTagHelper
|
2
|
-
|
3
|
-
def amp_form(url = "", method = "post", target = "_top", submit = nil, submit_success = nil, submit_error = nil, options = {}, &block)
|
4
|
-
options = options.symbolize_keys
|
5
|
-
|
6
|
-
options[:method] = method
|
7
|
-
options[:target] = target
|
8
|
-
|
9
|
-
if method = "get"
|
10
|
-
if options[:ajax]
|
11
|
-
options[:"action-xhr"] = url
|
12
|
-
else
|
13
|
-
options[:action] = url
|
14
|
-
end
|
15
|
-
else
|
16
|
-
options[:"action-xhr"] = url
|
17
|
-
end
|
18
|
-
|
19
|
-
options.delete(:ajax)
|
20
|
-
|
21
|
-
options[:on] = "#{options[:on] + ";" if options[:on]}#{submit + ";" if submit}#{submit_success + ";" if submit_success}#{submit_error + ";" if submit_error}" if submit || submit_success || submit_error
|
22
|
-
|
23
|
-
if block_given?
|
24
|
-
content_tag("form", capture(&block), options)
|
25
|
-
else
|
26
|
-
content_tag("form", options)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
<% unless options[:split] %>
|
30
|
-
def form_tag(url = "", method = "post", target = "_top", submit = nil, submit_success = nil, submit_error = nil, options = {}, &block)
|
31
|
-
if block_given?
|
32
|
-
amp_form(url, method, target, submit, submit_success, submit_error, options, capture(&block))
|
33
|
-
else
|
34
|
-
amp_form(url, method, target, submit, submit_success, submit_error, options)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
<% end %>
|
38
|
-
|
39
|
-
def amp_input(type = "text", name = nil, value = nil, onchange = nil, options = {})
|
40
|
-
options = options.symbolize_keys
|
41
|
-
|
42
|
-
options[:type] = type
|
43
|
-
options[:name] = name
|
44
|
-
options[:value] = value
|
45
|
-
|
46
|
-
options[:on] = "#{options[:on] + ";" if options[:on]}#{onchange + ";" if onchange}"
|
47
|
-
|
48
|
-
tag("input", options)
|
49
|
-
end
|
50
|
-
<% unless options[:split] %>
|
51
|
-
def input_tag(type = "text", name = nil, value = nil, onchange = nil, options = {})
|
52
|
-
amp_input(type, name, value, onchange, options)
|
53
|
-
end
|
54
|
-
<% end %>
|
55
|
-
|
56
|
-
def amp_selector(name = nil, onchange = nil, options = {}, &block)
|
57
|
-
options = options.symbolize_keys
|
58
|
-
|
59
|
-
options[:layout] = "container"
|
60
|
-
options[:name] = name
|
61
|
-
|
62
|
-
options[:on] = "#{options[:on] + ";" if options[:on]}#{onchange + ";" if onchange}"
|
63
|
-
|
64
|
-
content_tag("amp-selector", capture(&block), options)
|
65
|
-
end
|
66
|
-
|
67
|
-
|
68
|
-
def amp_form_response(type = "success", &block)
|
69
|
-
raise "`amp_form_response` takes only the types `success` and `error`" unless type = "success" || type = "error"
|
70
|
-
|
71
|
-
type = "submit-" + type
|
72
|
-
|
73
|
-
options = {}
|
74
|
-
options[type] = ""
|
75
|
-
|
76
|
-
content_tag("div", amp_mustache(capture(&block)), options)
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
File without changes
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'amp-html'
|
2
|
-
|
3
|
-
<% if options[:javascript] %>
|
4
|
-
Rails.application.configure do
|
5
|
-
if AmpHtml.assets_only_amp
|
6
|
-
config.assets.precompile += ['amp/**/*.js', 'amp/**/*.scss']
|
7
|
-
else
|
8
|
-
config.assets.precompile += ['amp/**/*.js', 'amp/**/*.scss']
|
9
|
-
end
|
10
|
-
end
|
11
|
-
<% else %>
|
12
|
-
Rails.application.configure do
|
13
|
-
if AmpHtml.assets_only_amp
|
14
|
-
config.assets.precompile += ['amp/**/*.scss']
|
15
|
-
else
|
16
|
-
config.assets.precompile += ['amp/**/*.scss']
|
17
|
-
end
|
18
|
-
end
|
19
|
-
<% end %>
|
@@ -1,189 +0,0 @@
|
|
1
|
-
default: &default
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
# ----------
|
6
|
-
# COMPONENTS
|
7
|
-
# ----------
|
8
|
-
|
9
|
-
# Learn more about amp-html components: https://github.com/slooob/amp-html/wiki/Docs
|
10
|
-
# Run `amp-html bundle` after adding or removing components!
|
11
|
-
# Run `amp-html install COMPONENT` to install a specific component from the command line
|
12
|
-
components:
|
13
|
-
<% if options[:all] || options[:analytics] || options[:notifications] %>analytics<% else %># analytics<% end %>
|
14
|
-
<% if options[:all] || options[:iframe] || options[:javascript] || options[:service_worker] %>iframe<% else %># iframe<% end %>
|
15
|
-
<% if options[:all] || options[:notifications] %>notifications<% else %># notifications<% end %>
|
16
|
-
<% if options[:all] || options[:anim] %>anim<% else %># anim<% end %>
|
17
|
-
<% if options[:all] || options[:ad] %>ad<% else %># ad<% end %>
|
18
|
-
<% if options[:all] || options[:social] %>social<% else %># social<% end %>
|
19
|
-
<% if options[:all] || options[:javascript] %>javascript<% else %># javascript<% end %>
|
20
|
-
<% if options[:all] || options[:service_worker] %>service_worker<% else %># service_worker<% end %>
|
21
|
-
<% if options[:all] || options[:lists] %>lists<% else %># lists<% end %>
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
# ------------
|
26
|
-
# SPLIT VIEW
|
27
|
-
# ------------
|
28
|
-
|
29
|
-
<% if options[:split] %>
|
30
|
-
## To remove SplitView run `rails g amp_html:bundle`
|
31
|
-
## Defaults to `false`
|
32
|
-
split_view: true
|
33
|
-
<% else %>
|
34
|
-
# ## To enable SplitView run `rails g amp_html:bundle -s`
|
35
|
-
# ## Defaults to `false`
|
36
|
-
# split_view: true
|
37
|
-
<% end %>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# -----------------
|
42
|
-
# APP CUSTOMIZATION
|
43
|
-
# -----------------
|
44
|
-
|
45
|
-
## Customize your application's information
|
46
|
-
application:
|
47
|
-
### Set the name of your app. This value is being used to set the default title of your views as well as populating meta information
|
48
|
-
name: "<%= options[:name] %>"
|
49
|
-
|
50
|
-
# ### Specify the type of your site. Some example values are "Organization", "NewsArticle", "BlogPosting". You can name it whatever feels appropriate
|
51
|
-
# ### This is being used for the schema_tag and can be overridden by passing a different type
|
52
|
-
# type: "Organization"
|
53
|
-
|
54
|
-
# ### Specify the date you published your site. This is being used for the schema_tag and can be overridden by passing a different datetime
|
55
|
-
# ### Defaults to `DateTime.now`
|
56
|
-
# date_published: "<%= DateTime.now %>"
|
57
|
-
|
58
|
-
# ### Specify the image used as logo for the schema_tag
|
59
|
-
# image: ["my/image/path"]
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# ------------
|
64
|
-
# VIEWS FORMAT
|
65
|
-
# ------------
|
66
|
-
|
67
|
-
<% if options[:split] %>
|
68
|
-
# ## Change the default format used for views.
|
69
|
-
# ## Defaults to `amp`
|
70
|
-
<% unless options[:format] == nil || options[:format] != "amp" %>default_format: <%= options[:format] %><% else %># default_format: html<% end %>
|
71
|
-
<% else %>
|
72
|
-
## Change the default format used for views.
|
73
|
-
## Defaults to `html`
|
74
|
-
<% unless options[:format] == nil || options[:format] != "html" %>default_format: <%= options[:format] %><% else %># default_format: amp<% end %>
|
75
|
-
<% end %>
|
76
|
-
|
77
|
-
<% if options[:split] %>
|
78
|
-
# ## Formats used to find a view if the default format does not exist.
|
79
|
-
# ## Default is ``
|
80
|
-
fallback_format: html xhtml
|
81
|
-
<% else %>
|
82
|
-
## Formats used to find a view if the default format does not exist.
|
83
|
-
## Default is ``
|
84
|
-
fallback_format: amp xhtml
|
85
|
-
<% end %>
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
# --------------------
|
90
|
-
# ASSETS CONFIGURATION
|
91
|
-
# --------------------
|
92
|
-
|
93
|
-
## Configure your Assets
|
94
|
-
assets:
|
95
|
-
# ### Declares whether assets outside of the "assets/#{type}/amp" are precompiled or not. If `true` only assets inside the amp directory are precompiled
|
96
|
-
# ### Defaults to `true`. If SplitView is enabled it defaults to `false`
|
97
|
-
# only_amp: <% if options[:split] %>false<% else %>true<% end %>
|
98
|
-
|
99
|
-
# ### To use javascript in your AMP app, install the AMP-HTML Javascript Component by running `amp-html install javascript`
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
# ---------------
|
107
|
-
# FORMS COMPONENT
|
108
|
-
# ---------------
|
109
|
-
|
110
|
-
## Set up the AMP Forms Component
|
111
|
-
forms:
|
112
|
-
# ### Uncomment to use `amp_selector` helper in forms. Learn more by running `amp-html helper amp_selector`
|
113
|
-
# ### Defaults to `false`
|
114
|
-
# amp_selector: true
|
115
|
-
<% if options[:all] || options[:analytics] %>
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
# -------------------
|
123
|
-
# ANALYTICS COMPONENT
|
124
|
-
# -------------------
|
125
|
-
|
126
|
-
## Set up the AMP Analytics Component
|
127
|
-
analytics:
|
128
|
-
# ### Specifies the default vendor for all amp_analytics tags. You can always override this default by passing a different vendor
|
129
|
-
# ### List of all supported vendors: https://www.ampproject.org/docs/reference/components/ads/amp-analytics#analytics-vendors
|
130
|
-
# default_vendor: parsely
|
131
|
-
|
132
|
-
google_analytics:
|
133
|
-
# ### Set your Google Analytics account to enable the amp_google_analytics tag helper
|
134
|
-
# account: UA-*****-*
|
135
|
-
<% end %>
|
136
|
-
<% if options[:all] || options[:ad] %>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
# ------------------------
|
141
|
-
# ADVERTISEMENTS COMPONENT
|
142
|
-
# ------------------------
|
143
|
-
|
144
|
-
## Set up the AMP Advertisements Component
|
145
|
-
ad:
|
146
|
-
# ### Specifies the default network for all amp_ad tags. You can always override this default by passing a different network
|
147
|
-
# ### List of all supported networks: https://www.ampproject.org/docs/reference/components/ads/amp-ad#supported-ad-networks
|
148
|
-
# default_network: mywidget
|
149
|
-
|
150
|
-
auto_ads:
|
151
|
-
# ### Specifies the default network for all amp_auto_ads tags. You can always override this default by passing a different network
|
152
|
-
# ### List of all supported networks: https://www.ampproject.org/docs/reference/components/ads/amp-auto-ads#supported-ad-networks
|
153
|
-
# default_network: adsense
|
154
|
-
<% end %>
|
155
|
-
<% if options[:all] || options[:social] %>
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
# -------------------
|
160
|
-
# SOCIAL COMPONENT
|
161
|
-
# -------------------
|
162
|
-
|
163
|
-
## Set up the AMP Social Component
|
164
|
-
social:
|
165
|
-
share:
|
166
|
-
# ### Specifies the default provider for all amp_social_share tags. You can always override this default by passing a different provider
|
167
|
-
# ### List of all supported providers: https://www.ampproject.org/docs/reference/components/social/amp-social-share
|
168
|
-
# default_provider: twitter
|
169
|
-
|
170
|
-
# ### You can define an unsupported provider as your default but then you need to set the data-share-endpoint
|
171
|
-
# default_data_share_endpoint: whatsapp://send
|
172
|
-
<% end %>
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
# -----------------------------------
|
178
|
-
# ENVIRONMENT SENSITIVE CONFIGURATION
|
179
|
-
# -----------------------------------
|
180
|
-
|
181
|
-
|
182
|
-
production:
|
183
|
-
<<: *default
|
184
|
-
|
185
|
-
development:
|
186
|
-
<<: *default
|
187
|
-
|
188
|
-
test:
|
189
|
-
<<: *default
|
File without changes
|
@@ -1,71 +0,0 @@
|
|
1
|
-
<%%= amp_html_doctype do %>
|
2
|
-
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
<!-- AMP-HTML head tags -->
|
7
|
-
<!-- IMPORTANT: Keep this at the top of the head section! -->
|
8
|
-
<!-- Learn more about allowed parameters by running `amp-html helper amp_head` -->
|
9
|
-
<!-- Example: <%%#= amp_head(description: "Description", favicon: "favicon.ico", language: I18n.locale, keywords: ["keyword1", "keyword2"]) %> -->
|
10
|
-
<%%= amp_head %>
|
11
|
-
|
12
|
-
|
13
|
-
<!-- Use <%%#= content_for :title do %>App Name<%%# end %> to add a title to your view -->
|
14
|
-
<title><%% if content_for? :title %><%%= yield :title %><%% else %><%%= AmpHtml.application_name %><%% end %></title>
|
15
|
-
|
16
|
-
<% if options[:split] %>
|
17
|
-
<!-- Overwrite the passed parameter to specify a specific canonical url -->
|
18
|
-
<%%= canonical_document_link(url_for(format: :html, only_path: false)) %>
|
19
|
-
<% else %>
|
20
|
-
<%%= canonical_document_link %>
|
21
|
-
<% end %>
|
22
|
-
<!-- IMPORTANT: The `meta[name="viewport"]` tag is required by AMP! -->
|
23
|
-
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
|
24
|
-
|
25
|
-
<%%= csrf_meta_tags %>
|
26
|
-
|
27
|
-
|
28
|
-
<!-- schema.org definition (not required) -->
|
29
|
-
<%%= schema_tag("#{headline if content_for? :title}": "#{yield :title if content_for? :title}") %>
|
30
|
-
|
31
|
-
|
32
|
-
<!-- AMP custom styles -->
|
33
|
-
<!-- Use <%%#= amp_css do %> div { color: black } ... <%%# end %> to add specific styles to your view -->
|
34
|
-
|
35
|
-
<!-- If you want to embed external styles, use stylesheets under "app/assets/stylesheets/amp" directory -->
|
36
|
-
<!-- DO NOT include any external CSS via a link tag -->
|
37
|
-
<!-- Learn more about format restrictions in CSS: https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages -->
|
38
|
-
|
39
|
-
<!-- Add your global CSS in the block below -->
|
40
|
-
<%%= amp_css do %>
|
41
|
-
<%% end %>
|
42
|
-
|
43
|
-
|
44
|
-
<!-- AMP Javascript Component -->
|
45
|
-
<!-- DO NOT include any external JS via a link tag -->
|
46
|
-
<!-- To include javascript in your application, install the AMP-HTML Javascript Component. Run `amp-html install javascript` -->
|
47
|
-
<!-- Learn more about the Javascript Component: https://github.com/slooob/amp-html/blob/master/lib/amp-html/components/docs/javascript.md -->
|
48
|
-
|
49
|
-
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
|
54
|
-
|
55
|
-
<!-- AMP Analytics Component -->
|
56
|
-
<!-- You need to install the analytics component in order to use the following tag helpers! -->
|
57
|
-
|
58
|
-
<!-- <%%#= amp_analytics(vendor) %> -->
|
59
|
-
|
60
|
-
<!-- IMPORTANT: To be able to use the amp_google_analytics tag helper, configure your Google Analytics account in "config/amp-html.yml"! -->
|
61
|
-
<!-- <%%#= amp_google_analytics %> -->
|
62
|
-
|
63
|
-
<!-- Guide: https://github.com/slooob/amp-html/wiki/Guides:-Analytics -->
|
64
|
-
|
65
|
-
|
66
|
-
<%%= yield %>
|
67
|
-
|
68
|
-
|
69
|
-
</body>
|
70
|
-
|
71
|
-
<%% end %>
|
@@ -1,47 +0,0 @@
|
|
1
|
-
<meta charset="utf-8">
|
2
|
-
<script async src="https://cdn.ampproject.org/v0.js"></script>
|
3
|
-
|
4
|
-
|
5
|
-
<% if options[:company] %><meta name="company" content="<%= options[:company] %>"><% end %>
|
6
|
-
|
7
|
-
<% if options[:email] %><meta name="reply-to" content="<%= options[:email] %>"><% end %>
|
8
|
-
|
9
|
-
<% if options[:type] %>
|
10
|
-
<meta name="page-type" content="<%= options[:type] %>">
|
11
|
-
<meta name="page-topic" content="<%= options[:type] %>">
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<% if options[:audience] %><meta name="audience" content="<%= options[:audience] %>"><% end %>
|
15
|
-
|
16
|
-
<% if options[:author] %>
|
17
|
-
<meta name="DC.Creator" content="<%= options[:author] %>">
|
18
|
-
<meta name="author" content="<%= options[:author] %>">
|
19
|
-
<% end %>
|
20
|
-
|
21
|
-
<% if options[:publisher] %>
|
22
|
-
<meta name="DC.Publisher" content="<%= options[:publisher] %>">
|
23
|
-
<meta name="publisher" content="<%= options[:publisher] %>">
|
24
|
-
<% end %>
|
25
|
-
|
26
|
-
<% if options[:copyright] %>
|
27
|
-
<meta name="DC.Rights" content="<%= options[:copyright] %>">
|
28
|
-
<meta name="copyright" content="<%= options[:copyright] %>">
|
29
|
-
<% end %>
|
30
|
-
|
31
|
-
<% if options[:description] %>
|
32
|
-
<meta name="DC.Description" content="<%= options[:description] %>">
|
33
|
-
<meta name="description" content="<%= options[:description] %>">
|
34
|
-
<% end %>
|
35
|
-
|
36
|
-
<% if options[:keywords] %><meta name="keywords" content="<%= options[:keywords].join(',') %>"><% end %>
|
37
|
-
|
38
|
-
<% if options[:language] %><meta name="DC.Language" content="<%= options[:language] %>"><% end %>
|
39
|
-
|
40
|
-
<% if options[:robots] %><meta name="robots" content="<%= options[:robots] %>"><% end %>
|
41
|
-
|
42
|
-
|
43
|
-
<% if options[:apple_touch_icon_120] %><link rel="apple-touch-icon" sizes="120x120" href="<%= options[:apple_touch_icon_120] %>"><% end %>
|
44
|
-
<% if options[:apple_touch_icon_152] %><link rel="apple-touch-icon" sizes="152x152" href="<%= options[:apple_touch_icon_152] %>"><% end %>
|
45
|
-
|
46
|
-
|
47
|
-
<% if options[:favicon] %><%%= favicon_link_tag "<%= options[:favicon] %>" %><% end %>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<!-- ************************** -->
|
2
|
-
<!-- DO NOT ALTER THIS FILE! -->
|
3
|
-
<!-- ************************** -->
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<!-- AMP ASSETS -->
|
8
|
-
|
9
|
-
<!-- AMP CSS -->
|
10
|
-
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><%%= noscript_tag do %><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style><%% end %>
|
11
|
-
<%% if Rails.application.assets && Rails.application.assets['amp/application.css'] %><style amp-custom><%%= Rails.application.assets['amp/application.css'].to_s.html_safe %><%%= yield :css %><%%= yield :global_css %></style><%% else %><style amp-custom><%%= File.read "#{Rails.root}/public#{stylesheet_path('amp/application', host: nil)}" %><%%= yield :css %><%%= yield :global_css %></style><%% end %>
|
12
|
-
|
13
|
-
<% if options[:javascript] %>
|
14
|
-
<!-- AMP Javascript Component -->
|
15
|
-
<%%= amp_js %>
|
16
|
-
<% end %>
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new mime types for use in respond_to blocks:
|
4
|
-
# Mime::Type.register "text/richtext", :rtf
|
5
|
-
|
6
|
-
|
7
|
-
# AMP-HTML - Setting the format for AMP-HTML Views
|
8
|
-
Mime::Type.register_alias 'text/html', AmpHtml.default_format
|