Releases: hydro-cloud/wp-post
Releases · hydro-cloud/wp-post
1.2.0
Changes
LinkCard
- Automatic conversion of link cards by default true->false
- No rendering to link cards if link card acquisition fails or there are missing items
Configs
- WPPost config can now be obtained with getConfig() and the value of each item can be changed.
This includes the automatic link card conversion and endpoint URLs mentioned above.
How to use
- For instances.
import WPPost from "wp-post";
const wpost = new WPPost(docPath);
+ // If you want to change the config.
+ // Set up automatic conversion to a link card.
+ wpost.getConfig().useLinkCardHtmlGenerator = true; // default: false
+ // https://example.com/wp-json/wp/v2/posts -> https://example.com/wp-json/wp/v2/myposts
+ wpost.getConfig().apiPostUrl = "myposts"; // default: posts
+ // https://example.com/wp-json/wp/v2/media -> https://example.com/wp-json/wp/v2/mymedia
+ wpost.getConfig().apiMediaUrl = "mymedia";// default: media
//
const apiUrl = "https://example.com/wp-json/wp/v2";
const authUser = "userName or email";
const authPassword = "xxxs xxxs xxxs xxxs xxxs xxxx";
//
const postId = await wpost.postAsync(apiUrl, authUser, authPassword);- For CLI.
Link card auto-conversion enabled/disabled, endpoint URL changes added.
$ wppost config.
? What is your apiUrl? https://<apiUrl>
? What is your authUser ? authUser ?
? What is your authPassword ? xxx xxx xxx xxx xxx xxx xxx xxx ?
+? What is your wp-api of Post(ex. 'posts') ? (posts)
+? What is your wp-api of Media(ex.'media') ? (media) ?
+? Automatically convert a-tags into link cards? ? (y/N)1.1.0
Merge pull request #9 from hydro-cloud/develop Develop
1.0.0
first major release
0.0.3
hotfix.
0.0.1
first release.