[WordPress] 外掛分享: JAMStackPress

前言介紹

  • 這款 WordPress 外掛「JAMStackPress」是 2021-04-27 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2022-07-26,距離現在已有 1013 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 5.7.1 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

guilledutra | jamstackpress | santiagocajal |

外掛標籤

pwa | spa | static | headless | jamstack |

內容簡介

JAMStackPress – 提升你的 WordPress 後端功能

這個外掛程式透過擴展 WP-JSON API,在 WP-JSON API 回應中新增一組有用的欄位,讓你的前端開發更容易。JAMStackPress 也提供一些選擇性過濾器,讓內容能輕鬆變成前端可使用的格式(無需在前端層次進行取代或廣告圖片寬高屬性的設置)。最後,我們還將兩個額外端點 (聯繫表單和網站地圖) 新增至 WP-JSON API 中,非常有用!
我們考慮了你的靜態網站開發可能遇到的各種情況,換句話說,我們會盡力讓你的生活更輕鬆,只需專注於開發解耦式的前端。

額外欄位 (jamstackpress 物件)

我們包含了一些額外欄位,可以在外掛程式管理頁面中啟用,讓你的前端開發更輕鬆:

人性化的日期欄位 (使用在 WordPress 面板中定義的地區語言):
"readable_date": "March 26, 2018"

文章完整的網址串列,並遵循你在 WordPress 固定連結選項中的設置:
"routes": {
"slug": "/category/post-title/",
"front_link": "https://frontenddomain.com/category/post-title/"
}

每種尺寸的特色圖片網址:

"featured_image": {
"thumbnail": "http://example.com/wp-content/uploads/2022/07/thumbnail-150x150.jpg",
"medium": "http://example.com/wp-content/uploads/2022/07/medium-300x200.jpg",
"medium_large": "http://example.com/wp-content/uploads/2022/07/medium-large-768x512.jpg"
"large": "http://example.com/wp-content/uploads/2022/07/large-1024x683.jpg"
}

SEO 標題和描述標籤 - 與 Yoast 和 RankMath 外掛兼容:
"seo": {
"title": "文章標題",
"description": "文章 SEO 描述"
}

額外端點

JAMStackPress 包含 2 個可選端點,為了讓你的前端開發任務更輕鬆而設計:

/jamstackpress/v1/contact
這個端點會作為聯繫表單後端資源。會儲存一個 jp_contact 自訂文章,並在每次成功提交後發送電子郵件。

使用方式:

在選項面板中啟用自訂聯繫表單流程端點。
填寫並儲存與聯繫表單端點相關的其他選項:聯繫電子郵件、聯繫失敗訊息、聯繫成功訊息和 reCaptcha 密鑰 (Google reCaptcha V3)。

發送到自訂聯繫表單端點的請求,以下是使用 js fetch() 呼叫聯繫表單端點的範例

fetch('https://example.com/wp-json/jamstackpress/v1/contact?',{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '姓名',
email: '[email protected]',
subject: '聯繫主旨',
message: '聯繫表單內容的內容',
recaptach_token: 'xxxxxxxxxxx'})
})

/jamstackpress/v1/sitemap
這個端點會回傳完整的文章和分類網址串列,以下是回傳串列的範例:
["/sapiente/eveniet-velit-et-aut-est-et-inventore/","/sapiente/aliquid-aut-ut-eius-excepturi-magni/","/nulla-molestias/eius-ratione-mollitia-aliquam/","/uncategorized/aut-qui-repudiandae-nihil-iste/","/uncategorized/test/","/aliquam/","/ipsa-ratio

原文外掛簡介

JAMStackPress – Power-up you WordPress backend
This plugin extends the WP-JSON API by adding a new useful set of fields to the WP-JSON API response, this new set of fields will make your front-end development easier. JAMStackPress also applies some optional filters
to the content in order to make it front-end ready (no need to make replacements or ad image width and height attrs at front-end level). Finally we also adds to more endpoints to the WP-JSON API (contact form and sitemap) very useful!
We think about the possible scenarios of development for your static website, so in other words, we’ll try to make your life easier, so that you only think about developing your decoupled front-end.
Extra fields (jamstackpress object)
We include some extra fields that can be activated in the plugins administration page, that will make your front-end development easier:

Human readable date field (uses the locale defined in your WordPress panel):
"readable_date": "March 26, 2018"

Post’s full slug and front-end link respecting your WordPress permalinks selection:
"routes": {
"slug": "/category/post-title/",
"front_link": "https://frontenddomain.com/category/post-title/"
}

Featured image URLs one for every size:
"featured_image": {
"thumbnail": "http://example.com/wp-content/uploads/2022/07/thumbnail-150x150.jpg",
"medium": "http://example.com/wp-content/uploads/2022/07/medium-300x200.jpg",
"medium_large": "http://example.com/wp-content/uploads/2022/07/medium-large-768x512.jpg"
"large": "http://example.com/wp-content/uploads/2022/07/large-1024x683.jpg"
}

SEO tags Title and Description – Compatible With Yoast and RankMath plugins:
"seo": {
"title": "Post Title",
"description": "Post SEO description"
}

Extra endpoints
JAMStackPress includes 2 optional endpoints, always with the porpoise in mind of making your front end development tasks much more easier
/jamstackpress/v1/contact
This endpoint acts as a contact form back-end resource. Will save a jp_contact custom post and send an email on every success submission.
How to use it:

Enable the custom contact form endpoint in the options panel.
Fill and save the rest of the options related to the contact endpoint: Contact email, Contact Fail Message, Contact Success Message and reCaptcha Secret Key (google reCaptcha V3).

Send a request to the custom contact form endpoint, here is an example of a call to the contact form endpoint using js fetch()
fetch('https://example.com/wp-json/jamstackpress/v1/contact?',{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Name',
email: '[email protected]',
subject: 'Contact Subject',
message: 'Body of the contact form message',
recaptach_token: 'xxxxxxxxxxx'})
})

/jamstackpress/v1/sitemap
This endpoint will return a full list of posts and categories slugs, here is a sample of returned list:
["/sapiente/eveniet-velit-et-aut-est-et-inventore/","/sapiente/aliquid-aut-ut-eius-excepturi-magni/","/nulla-molestias/eius-ratione-mollitia-aliquam/","/uncategorized/aut-qui-repudiandae-nihil-iste/","/uncategorized/test/","/aliquam/","/ipsa-ratione/","/nulla-molestias/","/perferendis-modi/","/sapiente/","/uncategorized/","/unde-temporibus/","/ut-quo/"]
Content filters & Deploy tools
Content filters
– Replace your WordPress base URL with the front-end URL defined in the plugin settings.
– Add image width and height attributes to every image placed at the content.
– Add _blank target to every external link at the content.
Deploy tools
– Trigger front-end build: You can specify a build webhook url for triggering a deployment in your front-end site, directly from your WordPress back-end. This
is specially useful to keep your front-end site always updated with the latest content, without having to manually trigger a deploy.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「JAMStackPress」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.0.1 | 0.0.2 | 0.0.3 | 0.0.4 | 0.0.5 | 0.1.0 | 0.1.2 | 0.1.3 | trunk |

延伸相關外掛(你可能也想知道)

  • WPGraphQL 》WPGraphQL 是一個免費、開源的 WordPress 外掛,為任何 WordPress 網站提供可延伸的 GraphQL schema 和 API。, 以下是一些有助於你開始使用 WPGraphQL 的連結...。
  • WPGraphQL for ACF 》- WPGraphQL for Advanced Custom Fields 是一個免費的開源 WordPress 外掛,將 ACF Fields 和 Field Groups 添加到 WPGraphQL Schema 中。, - 創建 ACF Fiel...。
  • Headless Mode 》Headless 模式為所有嘗試訪問網站的用戶設置重定向。僅允許訪問 REST API、WP GraphQL API 或任何已登錄的用戶嘗試訪問無頭安裝以編輯或創建文章的請求。。
  • Faust.js 》 Faust 外掛與 Faust NPM 套件 協同工作,透過 GraphQL 調變和 REST API 端點,讓解耦式前端與 WordPress 進行驗證,並扮演 Faust 前端應用程式與 WordPress ...。
  • Headless WooCommerce Made Easy with CoCart 》重要訊息, 自 2022 年 10 月 5 日起,WordPress.org 中的 CoCart 外掛將不再進行重大更新,此舉是為了專注於付費的 CoCart Pro 版本。只有針對錯誤的次要修復...。
  • CoCart CORS Support 》這款免費的外掛程式為 CoCart 提供支援 CORS,允許 CoCart 在多個網域上運作。, 只需安裝並啟用,無需任何配置!, 工具和庫, , CoCart Beta Tester 讓您輕鬆...。
  • WPGraphQL Blocks 》總結:透過wp-graphql外掛,可將Gutenberg塊轉換成JSON資料。, , 問題與答案:, , 問題:wp-graphql是什麼外掛?, 答案:wp-graphql是在WordPress上使用Graph...。
  • WP Headless 》登入的使用者會被重新導向到文章的編輯頁面,而未登入的使用者必須先登入。這表示您可以根據您的永久連結設定分享一個可讀取的連結直接到編輯器。, 對於任務...。
  • CoCart – Cart API Enhanced 》此免費 WordPress 外掛是針對 CoCart 的附加元件,可增強傳回給購物車和添加到其中的商品的資料。, 功能, 每個添加到購物車的商品都會傳回以下資料:, , 返回...。
  • WPGraphQL IDE 》總結:WordPress 外掛 GraphQL IDE for WPGraphQL 為使用者提供一個更直觀的界面,方便進行 GraphQL 查詢和測試。, , 問題與答案:,
      ,
    • CoCart JWT Authentication 》- CoCart的免費附加元件可讓您透過簡單的JWT Token進行身份驗證。- 啟用PHP HTTP授權標頭- 大多數共享主機默認已禁用HTTP授權標頭。- 要啟用此選項,您需要通...。
    • Publish to Netlify 》使用 WordPress 作為後端,輕鬆將靜態網站部署到 Netlify。此外掛使用 Netlify webhook 觸發部署流程,建構您的靜態網站。。
    • WP Headless CMS Framework 》該外掛提供一個框架,將 WordPress 設置為無頭 CMS。, 框架選項包括:, , JSON Web Token 身份驗證(可選), 將 Gutenberg 區塊數據添加到 REST 響應中(可選...。
    • WUXT Headless WordPress API Extensions 》此外掛會為 WordPress Rest API 添加一些擴充功能,旨在使 WordPress 作為 Headless CMS 更易於使用。, 它原本是為 WUXT 設計的,WUXT 是一個帶有 NuxtJs 的 ...。
    • Gato GraphQL 》- Gato GraphQL 是一個能夠與 WordPress 網站的資料互動的工具,可以檢索、操作和再次儲存任何您所需的資料, - Gato GraphQL 可以處理來自多個外掛的功能:, ...。

文章
Filter
Apply Filters
Mastodon