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,83 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Components](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs) / Advertisements BETA
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
The AMP-HTML Advertisement Component allows to easily embed ads with AMP, not hurting performance.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest component release: 0.6.2 (Pre-release) - 2017-03-20
|
14
|
-
|
15
|
-
[**Changelog for version 0.6.2**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#062-pre-release---2017-03-20)
|
16
|
-
|
17
|
-
#### Requirements
|
18
|
-
|
19
|
-
The Advertisement Component does not depend on any other components.
|
20
|
-
|
21
|
-
#### Dependents
|
22
|
-
|
23
|
-
No other components depend on the Advertisement Component.
|
24
|
-
|
25
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#deepintegration-components): Enabled
|
26
|
-
|
27
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#availability-of-components): Installable
|
28
|
-
|
29
|
-
---
|
30
|
-
|
31
|
-
## Installation
|
32
|
-
|
33
|
-
Run in the command line:
|
34
|
-
|
35
|
-
amp-html install ad
|
36
|
-
|
37
|
-
Now you are ready to use the Advertisement Component.
|
38
|
-
|
39
|
-
To learn more about this component, without opening the documentation, run:
|
40
|
-
|
41
|
-
amp-html component ad
|
42
|
-
|
43
|
-
|
44
|
-
## Configuration
|
45
|
-
|
46
|
-
The Advertisement Component allows you to specify a default advertisement network for your app.
|
47
|
-
|
48
|
-
In your AMP-HTML configuration (`config/amp-html.yml`) search for the section of the Advertisement Component.
|
49
|
-
|
50
|
-
There you can set your default network like so:
|
51
|
-
|
52
|
-
default_network: mywidget
|
53
|
-
|
54
|
-
You can always override this network default by passing a different network to your advertisement integration in your view.
|
55
|
-
|
56
|
-
A list of all by AMP supported advertisement networks: https://www.ampproject.org/docs/reference/components/ads/amp-ad#supported-ad-networks
|
57
|
-
|
58
|
-
|
59
|
-
## Usage
|
60
|
-
|
61
|
-
In your views you can add an advertisement as follows:
|
62
|
-
|
63
|
-
<%= amp_ad(network) %>
|
64
|
-
<%= amp_ad("mywidget", width: 300, height: 250, data: { aax_size: "300x250", aax_pubname: "test123", aax_src: "302" }) %>
|
65
|
-
|
66
|
-
Learn more about the `amp_ad` helper in the dedicated reference linked below.
|
67
|
-
|
68
|
-
### Auto Ads
|
69
|
-
|
70
|
-
To dynamically inject ads via a remotely-served configuration file use:
|
71
|
-
|
72
|
-
<%= amp_auto_ads(type) %>
|
73
|
-
<%= amp_auto_ads("adsense", data: { ad: { client: "ca-pub-5439573510495356" } }) %>
|
74
|
-
|
75
|
-
|
76
|
-
### Helpers
|
77
|
-
|
78
|
-
The following helpers are usable with the Advertisement Component of AMP-HTML
|
79
|
-
|
80
|
-
* [`amp_ad`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_ad.md)
|
81
|
-
* [`amp_embed`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_embed.md)
|
82
|
-
* [`amp_auto_ads`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_auto_ads.md)
|
83
|
-
* [`amp_custom_ad`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_custom_ad.md)
|
@@ -1,131 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Components](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs) / Analytics BETA
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
The AMP-HTML Analytics Component allows to integrate with venders to measure activity on AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest component release: 0.6.2 (Pre-release) - 2017-03-20
|
14
|
-
|
15
|
-
[**Changelog for version 0.6.2**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#062-pre-release---2017-03-20)
|
16
|
-
|
17
|
-
#### Requirements
|
18
|
-
|
19
|
-
The Analytics Component does not depend on any other components.
|
20
|
-
|
21
|
-
#### Dependents
|
22
|
-
|
23
|
-
The [AMP-HTML Notifications Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/notifications.md) depends on the Analytics Component.
|
24
|
-
|
25
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#deepintegration-components): Enabled
|
26
|
-
|
27
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#availability-of-components): Installable
|
28
|
-
|
29
|
-
---
|
30
|
-
|
31
|
-
## Installation
|
32
|
-
|
33
|
-
Run in the command line:
|
34
|
-
|
35
|
-
amp-html install analytics
|
36
|
-
|
37
|
-
Now you are ready to use the Analytics Component.
|
38
|
-
|
39
|
-
To learn more about this component, without opening the documentation, run:
|
40
|
-
|
41
|
-
amp-html component analytics
|
42
|
-
|
43
|
-
|
44
|
-
## Configuration
|
45
|
-
|
46
|
-
The Analytics Component allows you to specify a default analytics vendor for your app.
|
47
|
-
|
48
|
-
In your AMP-HTML configuration (`config/amp-html.yml`) search for the section of the Analytics Component.
|
49
|
-
|
50
|
-
There you can set your default network like so:
|
51
|
-
|
52
|
-
default_vendor: parsely
|
53
|
-
|
54
|
-
You can always override this vendor default by passing a different vendor to your analytics integration in your view.
|
55
|
-
|
56
|
-
A list of all by AMP supported analytics vendors: https://www.ampproject.org/docs/reference/components/ads/amp-analytics#analytics-vendors
|
57
|
-
|
58
|
-
### Google Analytics
|
59
|
-
|
60
|
-
With DeepIntegration you can also easily setup your **Google Analytics** account.
|
61
|
-
|
62
|
-
Therefore configure your Google Analytics id in your AMP-HTML configuration:
|
63
|
-
|
64
|
-
google_analytics:
|
65
|
-
account: UA-*****-*
|
66
|
-
|
67
|
-
|
68
|
-
## Usage
|
69
|
-
|
70
|
-
In your views you can setup analytics as follows:
|
71
|
-
|
72
|
-
<%= amp_analytics(vendor) %>
|
73
|
-
<%= amp_analytics do %>
|
74
|
-
<script type="application/json">
|
75
|
-
{
|
76
|
-
"requests": {
|
77
|
-
"pageview": "https://example.com/analytics?url=${canonicalUrl}&title=${title}&acct=${account}",
|
78
|
-
"event": "https://example.com/analytics?eid=${eventId}&elab=${eventLabel}&acct=${account}"
|
79
|
-
},
|
80
|
-
"vars": {
|
81
|
-
"account": "ABC123"
|
82
|
-
},
|
83
|
-
"triggers": {
|
84
|
-
"trackPageview": {
|
85
|
-
"on": "visible",
|
86
|
-
"request": "pageview"
|
87
|
-
},
|
88
|
-
"trackAnchorClicks": {
|
89
|
-
"on": "click",
|
90
|
-
"selector": "a",
|
91
|
-
"request": "event",
|
92
|
-
"vars": {
|
93
|
-
"eventId": "42",
|
94
|
-
"eventLabel": "clicked on a link"
|
95
|
-
}
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
</script>
|
100
|
-
<% end %>
|
101
|
-
|
102
|
-
To learn how to setup analytics for a specific vendor, reference the AMP documentation: https://www.ampproject.org/docs/reference/components/ads/amp-analytics#analytics-vendors
|
103
|
-
|
104
|
-
Learn more about the `amp_analytics` helper in the dedicated reference linked below.
|
105
|
-
|
106
|
-
### Google Analytics
|
107
|
-
|
108
|
-
To setup Google Analytics, you need to first set your account in the AMP-HTML configuration. Then add to your view:
|
109
|
-
|
110
|
-
<%= amp_google_analytics %>
|
111
|
-
|
112
|
-
By default the component just listens for pageviews. You can also set complex triggers:
|
113
|
-
|
114
|
-
<%= amp_google_analytics(triggers: { "trackPageviewWithCustomUrl": { on: "visible", request: "pageview", vars: { title: "My page", document_location: "https://www.examplepetstore.com/pets.html" } } }) %>
|
115
|
-
|
116
|
-
Learn more about creating triggers for Google Analytics: https://developers.google.com/analytics/devguides/collection/amp-analytics/
|
117
|
-
|
118
|
-
### AMP Pixel
|
119
|
-
|
120
|
-
You can use the `amp_pixel` helper to track user behavior on your site:
|
121
|
-
|
122
|
-
<%= amp_pixel("https://foo.com/pixel?RANDOM") %>
|
123
|
-
|
124
|
-
|
125
|
-
### Helpers
|
126
|
-
|
127
|
-
The following helpers are usable with the Analytics Component of AMP-HTML
|
128
|
-
|
129
|
-
* [`amp_analytics`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_analytics.md)
|
130
|
-
* [`amp_google_analytics`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_google_analytics.md)
|
131
|
-
* [`amp_pixel`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_pixel.md)
|
@@ -1,66 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Components](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs) / Animated Images BETA
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
The AMP-HTML Animated Images Component allows to use runtime-managed animated images, typically GIF's, in AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest component release: 0.6.1 (Pre-release) - 2017-03-19
|
14
|
-
|
15
|
-
[**Changelog for version 0.6.1**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#061-pre-release---2017-03-19)
|
16
|
-
|
17
|
-
#### Requirements
|
18
|
-
|
19
|
-
The Animated Images Component does not depend on any other components.
|
20
|
-
|
21
|
-
#### Dependents
|
22
|
-
|
23
|
-
No other components depend on the Animated Images Component.
|
24
|
-
|
25
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#deepintegration-components): Disabled
|
26
|
-
|
27
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#availability-of-components): Installable
|
28
|
-
|
29
|
-
---
|
30
|
-
|
31
|
-
## Installation
|
32
|
-
|
33
|
-
Run in the command line:
|
34
|
-
|
35
|
-
amp-html install anim
|
36
|
-
|
37
|
-
Now you are ready to use the Animated Images Component.
|
38
|
-
|
39
|
-
To learn more about this component, without opening the documentation, run:
|
40
|
-
|
41
|
-
amp-html component anim
|
42
|
-
|
43
|
-
|
44
|
-
## Usage
|
45
|
-
|
46
|
-
In your views you can implement an animated image as follows:
|
47
|
-
|
48
|
-
<%= amp_anim(source) %>
|
49
|
-
<%= amp_anim("my-gif.gif", width: 400, height: 300, placeholder: "my-gif-screencap.jpg") %>
|
50
|
-
|
51
|
-
It also takes a block. For example, you could use the built-in `amp_placeholder` helper to achieve the same:
|
52
|
-
|
53
|
-
<%= amp_anim("my-gif.gif", width: 400, height: 300) do %>
|
54
|
-
<%= amp_placeholder("amp-anim", width: 400, height: 300, src: "my-gif-screencap.jpg") %>
|
55
|
-
<% end %>
|
56
|
-
|
57
|
-
Learn more about the `amp_anim` helper in the dedicated reference linked below.
|
58
|
-
|
59
|
-
**References:** [`amp_placeholder`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_placeholder.md)
|
60
|
-
|
61
|
-
|
62
|
-
### Helpers
|
63
|
-
|
64
|
-
The following helpers are usable with the Animated Images Component of AMP-HTML
|
65
|
-
|
66
|
-
* [`amp_anim`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_anim.md)
|
@@ -1,63 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Components](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs) / Fonts BETA
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
The AMP-HTML Fonts Component allows to include stylesheets for custom fonts without using `@font-face`.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest component release: 0.6.1 (Pre-release) - 2017-03-19
|
14
|
-
|
15
|
-
[**Changelog for version 0.6.1**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#061-pre-release---2017-03-19)
|
16
|
-
|
17
|
-
#### Requirements
|
18
|
-
|
19
|
-
The Fonts Component does not depend on any other components.
|
20
|
-
|
21
|
-
#### Dependents
|
22
|
-
|
23
|
-
No other components depend on the Fonts Component.
|
24
|
-
|
25
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#deepintegration-components): Disabled
|
26
|
-
|
27
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#availability-of-components): Build-in
|
28
|
-
|
29
|
-
---
|
30
|
-
|
31
|
-
## Usage
|
32
|
-
|
33
|
-
In your views you include a custom font as follows:
|
34
|
-
|
35
|
-
<%= amp_font_link(href) %>
|
36
|
-
<%= amp_font_link("https://fonts.googleapis.com/css?family=Roboto") %>
|
37
|
-
|
38
|
-
**Note:** Font providers need to be whitelisted. All whitelisted font providers: https://github.com/ampproject/amp-html/blob/master/spec/amp-html-format.md#custom-fonts
|
39
|
-
|
40
|
-
Learn more about the `amp_font_link` helper in the dedicated reference linked below.
|
41
|
-
|
42
|
-
### Google Fonts
|
43
|
-
|
44
|
-
AMP-HTML offers an easy-to-use integration of Google Fonts.
|
45
|
-
|
46
|
-
You can include any font of https://fonts.google.com as follows:
|
47
|
-
|
48
|
-
<%= amp_google_font(family) %>
|
49
|
-
<%= amp_google_font("Roboto") %>
|
50
|
-
|
51
|
-
This will only serve the default width and style. You can be more specific:
|
52
|
-
|
53
|
-
<%= amp_google_font("Roboto", [100i,400,900]) %>
|
54
|
-
|
55
|
-
Learn more about the `amp_google_font` helper in the dedicated reference linked below.
|
56
|
-
|
57
|
-
|
58
|
-
### Helpers
|
59
|
-
|
60
|
-
The following helpers are usable with the Fonts Component of AMP-HTML
|
61
|
-
|
62
|
-
* [`amp_font_link`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_font_link.md)
|
63
|
-
* [`amp_google_font`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_google_font.md)
|
@@ -1,79 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Components](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs) / Forms BETA
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
The AMP-HTML Forms Component allows the use of forms and input tags in AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest component release: 0.7.1 (Pre-release) - 2017-03-21
|
14
|
-
|
15
|
-
[**Changelog for version 0.7.1**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#071-pre-release---2017-03-21)
|
16
|
-
|
17
|
-
#### Requirements
|
18
|
-
|
19
|
-
The Forms Component depends on the [AMP-HTML Mustache.js Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/mustache.md).
|
20
|
-
|
21
|
-
#### Dependents
|
22
|
-
|
23
|
-
No other components depend on the Forms Component.
|
24
|
-
|
25
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#deepintegration-components): Enabled
|
26
|
-
|
27
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#availability-of-components): Build-in
|
28
|
-
|
29
|
-
---
|
30
|
-
|
31
|
-
## Configuration
|
32
|
-
|
33
|
-
The Forms Component allows you to specify a whether you want to use [`amp_selector`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_selector.md) or not.
|
34
|
-
|
35
|
-
In your AMP-HTML configuration (`config/amp-html.yml`) search for the section of the Forms Component.
|
36
|
-
|
37
|
-
There you can enable the helper like so:
|
38
|
-
|
39
|
-
amp_selector: true
|
40
|
-
|
41
|
-
|
42
|
-
## Usage
|
43
|
-
|
44
|
-
|
45
|
-
**Important note:** In AMP documents you can neither use the default `font_tag` helper, nor a helper provided by `simple_form` or similar.
|
46
|
-
|
47
|
-
You can create forms in your views as follows:
|
48
|
-
|
49
|
-
<%= amp_form("https://example.com/subscribe", "post", id: "myform") do %>
|
50
|
-
<fieldset>
|
51
|
-
<label>
|
52
|
-
<span>Your name</span>
|
53
|
-
<%= amp_input("text", "type your name", "name", "myform.submit") %>
|
54
|
-
</label>
|
55
|
-
<label>
|
56
|
-
<span>Your email</span>
|
57
|
-
<%= amp_input("email", "type your email", "email", "myform.submit") %>
|
58
|
-
</label>
|
59
|
-
<%= amp_input("submit", value: "Subscribe") %>
|
60
|
-
</fieldset>
|
61
|
-
<%= amp_form_response("error") %>Subscription failed!<% end %>
|
62
|
-
<%= amp_form_response %>Subscription successful!<% end %>
|
63
|
-
<% end %>
|
64
|
-
|
65
|
-
**Note:** `POST` forms are submitted via AJAX by default. To submit `GET` forms via AJAX pass `ajax: true` to `amp_form` as parameter.
|
66
|
-
|
67
|
-
For a detailed reference on the `amp_form`, `amp_input` and `amp_form_response` helpers, follow the links below.
|
68
|
-
|
69
|
-
|
70
|
-
### Helpers
|
71
|
-
|
72
|
-
The following helpers are usable with the Forms Component of AMP-HTML
|
73
|
-
|
74
|
-
* [`amp_form`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_form.md)
|
75
|
-
* [`amp_input`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_input.md)
|
76
|
-
* [`amp_selector`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_selector.md)
|
77
|
-
* [`amp_form_response`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_form_response.md)
|
78
|
-
* [`form_tag`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/form_tag.md)
|
79
|
-
* [`input_tag`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/input_tag.md)
|
@@ -1,62 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Components](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs) / Iframe BETA
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
The AMP-HTML Iframe Component allows to use iframes similar to the HTML `<iframe>` tag in AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest component release: 0.4.1 (Pre-release) - 2017-03-16
|
14
|
-
|
15
|
-
[**Changelog for version 0.4.1**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#041-pre-release---2017-03-16)
|
16
|
-
|
17
|
-
#### Requirements
|
18
|
-
|
19
|
-
The Iframe Component does not depend on any other components.
|
20
|
-
|
21
|
-
#### Dependents
|
22
|
-
|
23
|
-
The [AMP-HTML Javascript Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/javascript.md) depends on the Iframe Component.
|
24
|
-
|
25
|
-
The [AMP-HTML Service Worker Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/service_worker.md) depends on the Iframe Component.
|
26
|
-
|
27
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#deepintegration-components): Disabled
|
28
|
-
|
29
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs#availability-of-components): Installable
|
30
|
-
|
31
|
-
---
|
32
|
-
|
33
|
-
## Installation
|
34
|
-
|
35
|
-
Run in the command line:
|
36
|
-
|
37
|
-
amp-html install iframe
|
38
|
-
|
39
|
-
Now you are ready to use the Iframe Component.
|
40
|
-
|
41
|
-
To learn more about this component, without opening the documentation, run:
|
42
|
-
|
43
|
-
amp-html component iframe
|
44
|
-
|
45
|
-
|
46
|
-
## Usage
|
47
|
-
|
48
|
-
In your views you can create an iframe as follows:
|
49
|
-
|
50
|
-
<%= amp_iframe(source) %>
|
51
|
-
<%= amp_iframe("https://railsamp.com", width: 300, height: 300, sandbox: "allow-scripts allow-same-origin") %>
|
52
|
-
|
53
|
-
**Note:** `amp_iframe` must only request resources via HTTPS or from a data-URI or via the `srcdoc` attribute.
|
54
|
-
|
55
|
-
Learn more about the `amp_iframe` helper in the dedicated reference linked below.
|
56
|
-
|
57
|
-
|
58
|
-
### Helpers
|
59
|
-
|
60
|
-
The following helpers are usable with the Iframe Component of AMP-HTML
|
61
|
-
|
62
|
-
* [`amp_iframe`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_iframe.md)
|