[WordPress] 外掛分享: Git it Write – Write posts from GitHub

首頁外掛目錄 › Git it Write – Write posts from GitHub
WordPress 外掛 Git it Write – Write posts from GitHub 的封面圖片
100+
安裝啟用
★★★★
4.7/5 分(7 則評價)
592 天前
最後更新
問題解決
WordPress 4.4+ PHP 5.3+ v2.0 上架:2020-08-14

內容簡介

Git it Write允許將存儲在Github存儲庫中的markdown文件發布到您的WordPress網站中。因此,使用此外掛程序,當存儲庫中添加、更新文件時,WordPress文章將相應地添加、更新。

此插件的靈感來自於類似於Jekyll、Next.js、Gatsby.js等靜態站點生成器的編寫內容的markdown方式。這是一種類似於WordPress的想法,其中markdown文件從Github解析並發佈為文章。

實時範例:源Github存儲庫 (/docs/文件夾) 至發布的文章

這允許人們與文章合作,分享在Github中的編輯和建議,當WordPress文章被拉取後,它將自動更新。

如果存儲庫包含以下結構的文件,

docs\
guide\
introduction.md
getting-started.md
help\
faq.md

那麼如下的文章將被創建(如果已配置永久鏈接,並且文章類型支持“層次結構”即逐層創建文章(例如:頁面))

https://example.com/docs/guide/introduction/
https://example.com/docs/guide/getting-started/
https://example.com/help/faq/

🎲 此插件的用途是什麼?

使用Github存儲庫中的文件發布文章。
以Markdown格式編寫文章。
在桌面應用程序中編寫文章(Notepad++,Sublime Text,Visual studio code)。
與社區合作,在 Github 上的文件上進行編輯和建議,並將其發佈到WordPress。
所有Git及其版本管理系統的優點。

🚀 某些用例

可用於文檔文章、常見問題解答、Wiki等。
編寫博客文章。
任何可能需要社區參與的文章。

✨ 功能

Markdown將被處理並作為HTML發布文章。
源文件中使用的圖像將上傳到WordPress。
支持相對鏈接。
在源文件中設置文章屬性,例如文章狀態、標題、順序、類別、標籤等。
支持Webhook,每當存儲庫更改時,它會更新插件以拉取最新更改並發布文章。
添加多個存儲庫。
發布到任何文章類型。
如果它們在文件夾下,文章將按層次方式發布。例如:如果文件夾dir1中有一個文件hello.md,它將在WordPress中作為dir1/hello/發布,如果文章類型支持層次結構。
支持像標註、類別、自定義字段設置的文章元數據。

ℹ 注意事項

現在只會拉取和發布Markdown文件。
當源文件在Github上刪除時,文章不會被刪除。
建議啟用永久鏈接結構。
建議選擇支持層次結構的文章類型。
圖像必須存在於存儲庫根目錄下的_images文件夾中。Markdown文件必須在文件中相對使用它們。

🥗 建議

建議在WordPress網站中啟用永久鏈接結構,這樣,如果您在docs\reference\my-post.md下有文件,那麼將發佈文章,例如https://example.com/docs/reference/my-post/。當文章類型支持層次結構時,它們將逐層發布。

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Git it Write – Write posts from GitHub」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Git it Write allows to publish the markdown files present in a GitHub repository to your WordPress site. So with this plugin, whenever the files are added, updated in the repository the WordPress post will be added, updated accordingly.
This plugin is inspired from static site generators like Jekyll, Next.js, Gatsby.js on how content is written is markdown. This is a similar idea for WordPress where markdown files are parsed from GitHub and published as posts.
👓 Live example: Source github repository (/docs/ folder) to Posts published
⚡ Getting started: Get started with Git it write. Learn how to write .md files and publish posts on WordPress.
This allows people to collaborate with the post, share edits and suggestions in GitHub which when pulled the WordPress post will be updated automatically.
If a repository has files in the below structure,
docs/
guide/
introduction.md
getting-started.md
help/
faq.md

Then below posts will be created like below (if permalinks are configured and the post type supports “hierarchy” i.e creating posts level by level (example: pages))
https://example.com/docs/guide/introduction/
https://example.com/docs/guide/getting-started/
https://example.com/help/faq/

🎲 What is the use of this plugin ?

Publish posts using the files in your GitHub repository.
Write your posts in Markdown format.
Write your posts on your desktop application (Notepad++, Sublime Text, Visual studio code).
Collaborate, involve communities on the files in GitHub and publish them on WordPress.
All the advantages of Git and it’s version management system.

🚀 Some use cases

Can be used for documentation posts, FAQs, Wikis etc.
Write blog posts.
Any articles which may need community involvement.

✨ Features

Markdown will be processed and post will be published as HTML.
Images used in the source file will be uploaded to WordPress.
Relative links are supported.
Set post properties like post status, title, order, category, tags etc, in the source file itself.
Webhook support (whenever repository is changed, it updates the plugin to pull the latest changes and publish the posts)
Add multiple repositories.
Publish to any post type.
Posts are published in hierarchial manner if they are under folders. Example: a file dir1/hello.md will be posted as dir1/hello/ in WordPress if the post type supports hierarchy.
Support for post metadata like setting tags, categories, custom fields.

ℹ Note

Only Markdown files will be pulled and published right now
Posts won’t be deleted when it’s source file is deleted on GitHub.
It is preferred to have a permalink structure.
It is preferred to select a post type which supports hierarchy.
Images have to present only in _images folder in the repository root. Markdown files have to relatively use them in the file.

🥗 Recommendation
It is recommended that a permalink structure is enabled in the WordPress site so that, if you have file under docs/reference/my-post.md then a post is published like https://example.com/docs/reference/my-post/. This will be the result when post type has hierarchy support. They will be posted level by level for every folder in the repository. The folder’s post will be taken from the index.md file if exists under that folder.
🏃‍♂️ Using the plugin

Have a GitHub repository where all the source files (markdown files) are maintained (organized in folders if needed the exact structure)
In the plugin settings page, click add a new repository.
Enter the details of the repository to pull the posts from and under what post type to publish them.
Save the settings
Click “Pull the posts” and then “Pull only” changes. This will publish posts for all the markdown files.
To automatically update posts whenever repository is updated, configure webhook as mentioned in the settings page.

Links

Documentation
Support forum/Report bugs
Donate
Contribute on GitHub

延伸相關外掛

文章
Filter
Mastodon