-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gutenberg] Add amp-timeago block #1168
Conversation
To quote #1146 (comment): It seems difficult to use <p>The new year started <amp-timeago width="auto" height="20" datetime="2018-01-01T00:00:00.000Z">January 1st, 2108</amp-timeago> and I am so glad.</p> Comes out: And: <p>The new year started <amp-timeago width="100" height="20" datetime="2018-01-01T00:00:00.000Z">January 1st, 2108</amp-timeago> and I am so glad.</p> Comes out: Both of these clearly are not right in an inline context where flowing text is desired. I'm sure it has to do with AMP's need for layout as for why the element has these constraints which make it difficult for use in an inline context. I've noticed a similar issue with If these constraints remain, I'm not sure that |
|
||
attributes: { | ||
align: { | ||
type: 'string' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the attributes should be sourced from the children element attributes, as done in amp-fit-text
: c3d9915
This prevents the data from being duplicated between the block comment attributes and the content of the block. This means that if you edit the HTML you don't have to make sure that the two sets of attributes are in sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do the same for amp-mathml
and any other blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added the sources, currently within this PR, however, not sure if this PR will get merged anytime soon, let me know if it would be better to add in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miina I think we might as well merge amp-timeago
as an experimental block for testing. So I think we should go ahead and merge the PR. Nevertheless, one thing is blocking this. I'm getting an error:
Jed localization error:
Error: Domain
amp
was not found.
I have both languages/amp.pot
and languages/amp-js.pot
files in the filesystem.
Also, it seems JS source maps aren't being when compiling? It's making it hard to debug. Can that be enabled?
@westonruter Looks like this error occurs if |
Adds
amp-timeago
Gutenberg block.Note: see discussion in #1146 on the usefulness of having this as a standalone block.