Skip to content

Commit

Permalink
Post Author blocks: Add example and preview (WordPress#62978)
Browse files Browse the repository at this point in the history
* enable example for author blocks

* moved example to index.js so it's translatable
  • Loading branch information
MaggieCabrera authored and carstingaxion committed Jul 18, 2024
1 parent 51a228f commit 18c6662
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/post-author-biography/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
}
},
"usesContext": [ "postType", "postId" ],
"example": {
"viewportWidth": 350
},
"supports": {
"spacing": {
"margin": true,
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/post-author-name/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
}
},
"usesContext": [ "postType", "postId" ],
"example": {
"viewportWidth": 350
},
"supports": {
"html": false,
"spacing": {
Expand Down
8 changes: 8 additions & 0 deletions packages/block-library/src/post-author/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { postAuthor as icon } from '@wordpress/icons';

/**
Expand All @@ -15,6 +16,13 @@ export { metadata, name };

export const settings = {
icon,
example: {
viewportWidth: 350,
attributes: {
showBio: true,
byline: __( 'Posted by' ),
},
},
edit,
};

Expand Down

0 comments on commit 18c6662

Please sign in to comment.