开发者 |
jamstackpress
scajal guilledutra santiagocajal |
---|---|
更新时间 | 2022年7月27日 01:04 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.0.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
"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": {
"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:
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: 'example@example.com',
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