Submit Search
Upload
20分で作るGutenbergのブロック追加プラグイン
•
0 likes
•
91 views
J
jyokyoku
Follow
第1回 群馬 WordPress Meetupで発表した資料です。
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 39
Download now
Download to read offline
Recommended
React Native - Introductory Tutorial
React Native - Introductory Tutorial
scottcrespo
웹개발도구
웹개발도구
Seungho Han
プロジェクト名は重要 ~一度浸透したプロジェクト名を変える話~ #opendevcon
プロジェクト名は重要 ~一度浸透したプロジェクト名を変える話~ #opendevcon
ik-fib
本当は怖い「2次受け少額案件」の世界
本当は怖い「2次受け少額案件」の世界
jyokyoku
IDEのすすめ
IDEのすすめ
jyokyoku
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
Recommended
React Native - Introductory Tutorial
React Native - Introductory Tutorial
scottcrespo
웹개발도구
웹개발도구
Seungho Han
プロジェクト名は重要 ~一度浸透したプロジェクト名を変える話~ #opendevcon
プロジェクト名は重要 ~一度浸透したプロジェクト名を変える話~ #opendevcon
ik-fib
本当は怖い「2次受け少額案件」の世界
本当は怖い「2次受け少額案件」の世界
jyokyoku
IDEのすすめ
IDEのすすめ
jyokyoku
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More Related Content
Featured
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
Featured
(20)
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
20分で作るGutenbergのブロック追加プラグイン
1.
20 Gutenberg 1 WordPress Meetup @jyokyoku
2.
2
3.
3 36 WordPress 2017 2018 100 2
4.
Gutenberg 4
5.
5
6.
1. 2. 6
7.
• – – – 7
8.
• – – – 8
9.
9
10.
1. PHP [
] 2. JavaScript ES6 [ ] 3. React [ ] 4. JSX [ ] 10
11.
PHP • ordPress 11
12.
JavaScript ES6 • JavaScript •
ES6 JavaScript – ES6 = ECMAScript 6th Edition – let const Class import/export – ES6 12
13.
React • Facebook JavaScript •
jQuery – AirBNB Slack Dropbox Instagram Facebook • Gutenberg React Component • 2 13
14.
JSX • React • JavaScript
HTML • React HTML – var element = <h1 className=“title”>Title</h1> 14
15.
15
16.
1. node.js [
] 2. Babel [ ] 3. Webpack [ ] 16
17.
node.js • JavaScript • npm • 17
18.
Babel • • ES6 JSX JavaScript •
ES6 JSX 18
19.
Webpack • • JavaScript 1 • • Babel –
Gulp Browserify 19
20.
• PHP JavaScript
ES6 • ES6/JSX • 20
21.
21 !! !?
22.
22
23.
Create Guten Block 23
24.
• Gutenberg • Babel SCSS
1 • npx • node.js 24
25.
$ cd /wp/wp-content/plugins/ $
npx create-guten-block { } 25
26.
26
27.
27 plugin.php src/block/block.js JS src/block/editor.scss CSS src/block/style.scss
CSS src/init.php PHP
28.
• block.js • CSS
SCSS CSS CSS • JS CSS init.php 28
29.
29
30.
30
31.
block.js • registerBlockType • edit
HTML • save HTML 31
32.
• npm start • JSX
ES6 SCSS 32 $ cd /wp/wp-content/plugins/{ } $ npm start
33.
edit • pluginAttrs init.php •
JSX 33 edit: function( props ) { const imgPath = pluginAttrs.imgDir + '/wapu.png'; return ( <div className={ props.className }> <img src={ imgPath } /> </div> ); },
34.
save • edit • return 34 save:
function( props ) { const imgPath = pluginAttrs.imgDir + '/wapu.png'; return ( <div className={ props.className }> <img src={ imgPath } /> </div> ); },
35.
35
36.
36
37.
37
38.
• edit save • •
CapitalP – https://capitalp.jp/tag/before-gutenberg/ 38
39.
39
Download now