ampproject / amp-by-example Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: AMP by Example has been merged into amp.dev
Home Page: http://amp.dev
License: Apache License 2.0
DEPRECATED: AMP by Example has been merged into amp.dev
Home Page: http://amp.dev
License: Apache License 2.0
To give a better overview over the samples, we could split the samples into sections in the overview page, e.g.:
Implementation wise this is simple by moving the samples into respective directories.
//cc @adewale @juliantoledo @jkingyens @ymotongpoo @kul3r4 what do you think?
We could implement a hamburger style drawer menu showing all examples and sections.
Use the list of AMP video types in #41 to build one example that shows both the carousel and the accordion on the same page. This will allow people to easily compare and contrast the UX of both components.
This sample would show people how to embed interactive third-party components in an amp-iframe.
We should then also remove the vimeo sample from amp-iframe.
Powered by AMP ⚡ HTML – Version 1456954860788
AMP validation had errors:
https://ampbyexample.com/components/amp-accordion/:5:2 The attribute 'custom-element' in tag 'amp-access extension .js script' is set to the invalid value 'amp-accordion'. (see https://www.ampproject.org/docs/reference/extended/amp-access.html)
https://ampbyexample.com/components/amp-accordion/:1570:12 The tag 'amp-accordion' is disallowed.
https://ampbyexample.com/components/amp-accordion/:1571:4 The attribute 'expanded' may not appear in tag 'section'.
https://ampbyexample.com/components/amp-accordion/:1653:2 The tag 'amp-accordion' is disallowed.
Example: /advanced/how_to_create_interactive_amp_pages%253f/
The idea would be to show how to create an AMP like this: http://www.buzzfeed.com/amphtml/alexfinnis/places-in-london-every-instagram-lover-needs-to-visit that has a large (18!) number of embeds. It gives us a mechanism for tracking the impact of optimisations like: ampproject/amphtml#2434
/cc @jmadler
Move boilerplate into a template.
Can amp-access examples be added, or at least linked, from the amp-by-example website?
Using code sections in docs with triple ''' does not keep the indentation.
Example is: amp-list where the json inside the docs is not correctly indented.
The idea is that this example would show an alternative UX for embed-heavy pages.
This involves migrating to Handlebars.
[] append [experimental]
to example name in overview page
[] inject src/templates/experiment.html into example template if experimental flag is set (see #32)
[15:24:52] Validating example components/amp-ad/index.html: PASS
undefined:1
Fatal Error: Timeout: did not get to load all resources on this page
^
SyntaxError: Unexpected token F
at Object.parse (native)
at ChildProcess.<anonymous> (/Users/sbenz/Documents/projects/amp-by-example-dev/tasks/validate-example.js:63:37)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
@jkingyens have you seen this before?
Long texts in the sample files is often required (e.g. amp-carousel), but bloats the code sections. Let's automatically shorten text between html tags that is longer than 50 chars, e.g.
<p>
This is a very very very very very very very very very veryvery very very long text
</p>
becomes:
<p>
This is a very very very very very very very ...
</p>
Provide an example that shows an AMP with a large (5 or more) number of ads.
This will correct the confusion shown in threads like this: http://stackoverflow.com/questions/36138565/are-multiple-amp-ad-nodes-allowed/36179165
Hi,
amp-carousel-button not showing on mobile for the amp-carousel
Can we include ignored samples (skipValidation / experimental) in the validation report? e.g.:
Validating components/amp-list/index.html: IGNORED (in yellow)
Create an example showing that large numbers of Twitter embeds don't cause a page to jump around and the page still loads all of the embeds.
Here is a working example: http://jsbin.com/zokuno/edit?html,console,output
A sample like this shows how AMPs don't re-layout and that AMPs can render large numbers of Twitter embeds. This is valuable because this is an increasingly popular style of journalism.
Create an example with AMP cache
Hello,
I am starting with AMP for my site Need to know that we can not use AJAX ??
AND one more issue which i am getting on development
If i am adding script like this
<script async src=https://cdn.ampproject.org/v0.js></script>
-IT's fine
But If i download that script and try to add like,<script async src=folderPAth/v0.js></script>
AMP Validation ERROR Why ??
This link: https://ampbyexample.com/advanced/ should give an access forbidden or redirect.
Create a file section.json in each section dir which includes the description. Generate it automatically when running gulp create with a new section.
{
"description": "This is my section"
}
Currently none of the examples fully validate due to missing <link rel=canonical>
tags.
https://www.ampproject.org/docs/reference/spec.html#canon
Currently anchor links depend on the order (example1, example2,...). These will break if a new section is added in between. We should use a slugged version of the content instead.
Make it possible to add metadata to examples via special comment tag, e.g.
<!---{
experiment: true,
component: amp-accordion
}--->
Metadata can contain arbitrary JSON. The DocumentParser should extract the metadata and add it to a new field in Document.
This is the foundation for:
//cc @jkingyens @juliantoledo does anyone of you want to tackle this?
These sections take up a lot of space, we should make them expandable/collapsible using amp-accordion.
[21:40:56] 'compile:sitemap' errored after 186 μs
[21:40:56] ReferenceError: SAMPLES_DIR is not defined
at Gulp. (/Users/jtoledo/Documents/workspace/amp-by-example/gulpfile.js:167:19)
at module.exports (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/jtoledo/Documents/workspace/amp-by-example/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
at Function.Module.runMain (module.js:449:11)
at startup (node.js:139:18)
The list includes (at least):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.