[WordPress] 外掛分享: Gist Block by Pantheon

首頁外掛目錄 › Gist Block by Pantheon
WordPress 外掛 Gist Block by Pantheon 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
2914 天前
最後更新
問題解決
WordPress 4.4+ v0.1.1 上架:2018-02-05

內容簡介

使用 Pantheon 的 Gist Block 外掛,您可以在 Gutenberg 文章中嵌入 GitHub Gists。只需添加「GitHub Gist」區塊,貼上 Gist 的 URL,即可看到它變成美妙的預覽。

想知道區塊是如何運作的嗎?這是一個很好的探索機會。具體而言,請檢查以下實現細節:

區塊 UI 註冊在 blocks/github-gist/index.js 中。當在 Gutenberg 中預覽區塊時,使用自定義代碼生成嵌入。
後備 HTML 內容實際上是存儲在文章內容中的內容。
使用動態渲染回調將區塊轉換為 GitHub 的標準 Gist 嵌入代碼。

閱讀「如何將短碼轉換為 Gutenberg 區塊」以獲得有關該插件的更詳細解釋。

有任何問題需要澄清嗎?請查看 GitHub 上的該項目,了解任何問題,反饋,建議或拉取請求。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Gist Block by Pantheon」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The Gist Block by Pantheon makes it possible to embed GitHub Gists in your Gutenberg posts. Simply add the “GitHub Gist” block, paste the URL to your Gist, and see it transform to a wonderful preview.
Curious as to how blocks work? This is a great one to explore. Specifically, check out these implementation details:

Block UI is registered in blocks/github-gist/index.js. When the block is previewed in Gutenberg, custom code is used to generate the embed.
Fallback HTML content is what’s actually stored in the post content.
A dynamic render callback is used to transform the block to GitHub’s standard Gist embed code.

Read “How to Convert a Shortcode to a Gutenberg Block” for a more detailed explanation of the plugin.
Something we can clarify? Check out the project on GitHub for any questions, feedback, suggestions, or pull requests.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon