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,76 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_analytics`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_analytics` allows to integrate with venders to measure activity on AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 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
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Enabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Installable with the [Analytics Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/analytics.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): Yes
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
[**AMP Reference**](https://www.ampproject.org/docs/reference/components/ads/amp-analytics)
|
30
|
-
|
31
|
-
#### Required Parameters
|
32
|
-
|
33
|
-
* `vendor` (if not set in the AMP-HTML configuration)
|
34
|
-
|
35
|
-
#### Structure
|
36
|
-
|
37
|
-
<%= amp_analytics(vendor, options) %>
|
38
|
-
# <amp-analytics type=vendor></amp-analytics>
|
39
|
-
|
40
|
-
|
41
|
-
## Examples
|
42
|
-
|
43
|
-
Loading a remote config:
|
44
|
-
|
45
|
-
<%= amp_ad("adobeanalytics", config: "https://example.com/analytics.config.json") %>
|
46
|
-
|
47
|
-
`amp_analytics` also takes a block:
|
48
|
-
|
49
|
-
<%= amp_analytics do %>
|
50
|
-
<script type="application/json">
|
51
|
-
{
|
52
|
-
"requests": {
|
53
|
-
"pageview": "https://example.com/analytics?url=${canonicalUrl}&title=${title}&acct=${account}",
|
54
|
-
"event": "https://example.com/analytics?eid=${eventId}&elab=${eventLabel}&acct=${account}"
|
55
|
-
},
|
56
|
-
"vars": {
|
57
|
-
"account": "ABC123"
|
58
|
-
},
|
59
|
-
"triggers": {
|
60
|
-
"trackPageview": {
|
61
|
-
"on": "visible",
|
62
|
-
"request": "pageview"
|
63
|
-
},
|
64
|
-
"trackAnchorClicks": {
|
65
|
-
"on": "click",
|
66
|
-
"selector": "a",
|
67
|
-
"request": "event",
|
68
|
-
"vars": {
|
69
|
-
"eventId": "42",
|
70
|
-
"eventLabel": "clicked on a link"
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
</script>
|
76
|
-
<% end %>
|
@@ -1,68 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_anim`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_anim` allows to use runtime-managed animated images, typically GIF's, in AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 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
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Disabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Installable with the [Animated Images Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/anim.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): Yes
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
[**AMP Reference**](https://www.ampproject.org/docs/reference/components/media/amp-anim)
|
30
|
-
|
31
|
-
#### Required Parameters
|
32
|
-
|
33
|
-
* `source`
|
34
|
-
* `size` (or `width` & `height`)
|
35
|
-
|
36
|
-
#### Structure
|
37
|
-
|
38
|
-
<%= amp_anim(source, options) %>
|
39
|
-
# <amp-anim src=source layout="responsive"></amp-ad>
|
40
|
-
|
41
|
-
**Note:** `layout` defaults to `responsive` if not explicitly permitted.
|
42
|
-
|
43
|
-
|
44
|
-
## Examples
|
45
|
-
|
46
|
-
Setting width & height:
|
47
|
-
|
48
|
-
<%= amp_anim("my-gif.gif", width: 400, height: 300) %>
|
49
|
-
<%= amp_anim("my-gif.gif", size: "400x300") %>
|
50
|
-
# <amp-anim type="my-gif.gif" layout="responsive" width=400 height=300></amp-ad>
|
51
|
-
|
52
|
-
Setting a placeholder:
|
53
|
-
|
54
|
-
<%= amp_anim("my-gif.gif", placeholder: "my-gif-screencap.jpg") %>
|
55
|
-
# <amp-anim src="my-gif.gif" layout="responsive">
|
56
|
-
# <amp-img placeholder src="my-gif-screencap.jpg"></amp-img>
|
57
|
-
# </amp-anim>
|
58
|
-
|
59
|
-
`amp_anim` also takes a block:
|
60
|
-
|
61
|
-
<%= amp_anim("my-gif.gif", width: 400, height: 300) do %>
|
62
|
-
<%= amp_placeholder("amp-anim", width: 400, height: 300, src: "my-gif-screencap.jpg") %>
|
63
|
-
<% end %>
|
64
|
-
# <amp-anim src="my-gif.gif" layout="responsive">
|
65
|
-
# <amp-img placeholder src="my-gif-screencap.jpg"></amp-img>
|
66
|
-
# </amp-anim>
|
67
|
-
|
68
|
-
**References:** [`amp_placeholder`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_placeholder.md)
|
@@ -1,54 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_audio`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_audio` allows to directly embed audio files with HTML5.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 0.7.5 (Pre-release) - 2017-03-23
|
14
|
-
|
15
|
-
[**Changelog for version 0.7.5**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#075-pre-release---2017-03-23)
|
16
|
-
|
17
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Disabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Build-in with the [Media Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/media.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): No
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
[**AMP Reference**](https://www.ampproject.org/docs/reference/components/media/amp-audio)
|
30
|
-
|
31
|
-
#### Required Parameters
|
32
|
-
|
33
|
-
* `*sources`
|
34
|
-
|
35
|
-
#### Structure
|
36
|
-
|
37
|
-
<%= amp_audio(*sources) %>
|
38
|
-
# <amp-audio>
|
39
|
-
# <div fallback><p>Your browser doesn’t support HTML5 audio</p></div>
|
40
|
-
# <source type=type_of_source src=source></source>
|
41
|
-
# </amp-audio>
|
42
|
-
|
43
|
-
**Note:** `layout` defaults to `responsive` if not explicitly permitted.
|
44
|
-
|
45
|
-
|
46
|
-
## Examples
|
47
|
-
|
48
|
-
Setting a custom fallback:
|
49
|
-
|
50
|
-
<%= amp_audio("audio_file.mp3", fallback: "No audio here.") %>
|
51
|
-
# <amp-audio>
|
52
|
-
# <div fallback><p>No audio here.</p></div>
|
53
|
-
# <source type="audio/mp3" src="audio_file.mp3"></source>
|
54
|
-
# </amp-audio>
|
@@ -1,43 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_auto_ads`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_auto_ads` allows to autmatically embed ads by a provider.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 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
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Disabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Installable with the [Advertisements Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/ad.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): No
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
[**AMP Reference**](https://www.ampproject.org/docs/reference/components/ads/amp-auto-ads)
|
30
|
-
|
31
|
-
#### Required Parameters
|
32
|
-
|
33
|
-
* `network` ([List of supported auto-ads networks](https://www.ampproject.org/docs/reference/components/ads/amp-auto-ads#supported-ad-networks))
|
34
|
-
|
35
|
-
#### Structure
|
36
|
-
|
37
|
-
<%= amp_auto_ads(network, options) %>
|
38
|
-
# <amp-auto-ad type=network></amp-ad>
|
39
|
-
|
40
|
-
|
41
|
-
## Examples
|
42
|
-
|
43
|
-
Some examples may be here in the future.
|
File without changes
|
@@ -1,37 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_css`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_css` allows allows the use of stylesheets in AMP documents.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 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
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Disabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Build-in with the [Stylesheets Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/stylesheets.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): Yes
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
#### Required Parameters
|
30
|
-
|
31
|
-
None.
|
32
|
-
|
33
|
-
#### Structure
|
34
|
-
|
35
|
-
<%= amp_css do %>
|
36
|
-
/* Your CSS here */
|
37
|
-
<% end %>
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,86 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_embed`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_embed` allows to easily embed ads with AMP, not hurting performance. It is an alias to the [`amp_ad`](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs/amp_ad.md) helper.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 0.5.4 (Pre-release) - 2017-03-19
|
14
|
-
|
15
|
-
[**Changelog for version 0.5.4**](https://github.com/slooob/amp-html/blob/master/CHANGELOG.md#054-pre-release---2017-03-19)
|
16
|
-
|
17
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Enabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Installable with the [Advertisements Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/ad.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): Yes
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
[**AMP Reference**](https://www.ampproject.org/docs/reference/components/ads/amp-ad)
|
30
|
-
|
31
|
-
#### Required Parameters
|
32
|
-
|
33
|
-
* `network` (if not set in the AMP-HTML configuration)
|
34
|
-
* `size` (or `width` & `height`)
|
35
|
-
|
36
|
-
#### Structure
|
37
|
-
|
38
|
-
<%= amp_embed(network, options) %>
|
39
|
-
# <amp-ad type=network layout="responsive"></amp-ad>
|
40
|
-
|
41
|
-
**Note:** `layout` defaults to `responsive` if not explicitly permitted.
|
42
|
-
|
43
|
-
|
44
|
-
## Examples
|
45
|
-
|
46
|
-
Setting width & height:
|
47
|
-
|
48
|
-
<%= amp_embed("a9", width: 400, height: 300) %>
|
49
|
-
<%= amp_embed("a9", size: "400x300") %>
|
50
|
-
# <amp-ad type="a9" layout="responsive" width=400 height=300></amp-ad>
|
51
|
-
|
52
|
-
Creating a sticky ad at the bottom of the viewport:
|
53
|
-
|
54
|
-
<%= amp_embed("a9", sticky: true) %>
|
55
|
-
# <amp-sticky-ad layout="nodisplay">
|
56
|
-
# <amp-ad type="a9" layout="responsive"></amp-ad>
|
57
|
-
# </amp-sticky-ad>
|
58
|
-
|
59
|
-
Setting a placeholder:
|
60
|
-
|
61
|
-
<%= amp_embed("a9", placeholder: "my-ad-screencap.jpg") %>
|
62
|
-
# <amp-ad type="a9" layout="responsive">
|
63
|
-
# <amp-img placeholder src="my-ad-screencap.jpg"></amp-img>
|
64
|
-
# </amp-ad>
|
65
|
-
|
66
|
-
Setting a fallback:
|
67
|
-
|
68
|
-
<%= amp_embed("a9", fallback: "my-ad-screencap.jpg") %>
|
69
|
-
# <amp-ad type="a9" layout="responsive">
|
70
|
-
# <amp-img fallback src="my-ad-screencap.jpg"></amp-img>
|
71
|
-
# </amp-ad>
|
72
|
-
|
73
|
-
**Note:** Currently you can only pass `sticky` **or** `placeholder` **or** `fallback` as an option.
|
74
|
-
|
75
|
-
`amp_ad` also takes a block:
|
76
|
-
|
77
|
-
<%= amp_embed("a9", options) do %>
|
78
|
-
<%= amp_placeholder("amp-img", src: "my-ad-screencap.jpg") %>
|
79
|
-
<%= amp_fallback("amp-img", src: "my-ad-screencap.jpg") %>
|
80
|
-
<% end %>
|
81
|
-
# <amp-ad type="a9" layout="responsive">
|
82
|
-
# <amp-img placeholder src="my-ad-screencap.jpg"></amp-img>
|
83
|
-
# <amp-img fallback src="my-ad-screencap.jpg"></amp-img>
|
84
|
-
# </amp-ad>
|
85
|
-
|
86
|
-
**References:** [`amp_placeholder`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_placeholder.md), [`amp_fallback`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_fallback.md)
|
@@ -1,70 +0,0 @@
|
|
1
|
-
|
2
|
-
# [Helpers](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#amp-html-helpers) / `amp_facebook`
|
3
|
-
|
4
|
-
|
5
|
-
## Information
|
6
|
-
|
7
|
-
`amp_facebook` allows to easily embed ads with AMP, not hurting performance.
|
8
|
-
|
9
|
-
---
|
10
|
-
|
11
|
-
### Quick info
|
12
|
-
|
13
|
-
#### Latest update: 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
|
-
#### [DeepIntegration](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#deepintegration-helpers): Disabled
|
18
|
-
|
19
|
-
#### [Availability](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#availability-of-helpers): Installable with the [Social Component](https://github.com/slooob/amp-html/tree/master/lib/amp-html/components/docs/social.md)
|
20
|
-
|
21
|
-
#### [Takes a block?](https://github.com/slooob/amp-html/tree/master/lib/amp-html/helpers/docs#takes-a-block): Yes
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
## General
|
26
|
-
|
27
|
-
### Reference
|
28
|
-
|
29
|
-
[**AMP Reference**](https://www.ampproject.org/docs/reference/components/social/amp-facebook)
|
30
|
-
|
31
|
-
#### Required Parameters
|
32
|
-
|
33
|
-
* `href`
|
34
|
-
* `size` (or `width` & `height`)
|
35
|
-
|
36
|
-
#### Structure
|
37
|
-
|
38
|
-
<%= amp_facebook(href, options) %>
|
39
|
-
# <amp-facebook data-href=href layout="responsive"></amp-facebook>
|
40
|
-
|
41
|
-
**Note:** `layout` defaults to `responsive` if not explicitly permitted.
|
42
|
-
|
43
|
-
|
44
|
-
## Examples
|
45
|
-
|
46
|
-
Setting width & height:
|
47
|
-
|
48
|
-
<%= amp_facebook("https://www.facebook.com/zuck/posts/10102593740125791", width: 486, height: 657) %>
|
49
|
-
<%= amp_facebook("https://www.facebook.com/zuck/posts/10102593740125791", size: "486x657") %>
|
50
|
-
# <amp-facebook data-href="https://www.facebook.com/zuck/posts/1010259374012579"1 layout="responsive" width=486 height=657></amp-facebook>
|
51
|
-
|
52
|
-
Embedding a post:
|
53
|
-
|
54
|
-
<%= amp_facebook("https://www.facebook.com/zuck/posts/10102593740125791", width: 486, height: 657) %>
|
55
|
-
# <amp-facebook data-href="https://www.facebook.com/zuck/posts/10102593740125791" layout="responsive" width=400 height=300></amp-facebook>
|
56
|
-
|
57
|
-
Embedding a video:
|
58
|
-
|
59
|
-
<%= amp_facebook("https://www.facebook.com/zuck/posts/10102593740125791", type: "video", width: 486, height: 657 ) %>
|
60
|
-
# <amp-facebook data-href="https://www.facebook.com/zuck/posts/10102593740125791" data-embed-as="video" layout="responsive" width=400 height=300></amp-facebook>
|
61
|
-
|
62
|
-
`amp_facebook` also takes a block:
|
63
|
-
|
64
|
-
<%= amp_facebook("https://www.facebook.com/zuck/posts/10102593740125791", width: 486, height: 657) do %>
|
65
|
-
<%= amp_placeholder("blockquote", class: "facebook-post") do %>
|
66
|
-
<p>The story how I became what some people would call a frontend engineer and an exploration into what that even means</p>
|
67
|
-
<% end %>
|
68
|
-
<% end %>
|
69
|
-
|
70
|
-
**References:** [`amp_placeholder`](https://github.com/slooob/amp-html/blob/master/lib/amp-html/helpers/docs/amp_placeholder.md)
|