Skip to content

Releases: hydro-cloud/wp-post

1.2.0

27 Oct 10:07
c2f8cc9

Choose a tag to compare

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

26 Mar 01:59
627941c

Choose a tag to compare

Merge pull request #9 from hydro-cloud/develop

Develop

1.0.0

20 Mar 09:46

Choose a tag to compare

first major release

0.0.3

20 Mar 09:43

Choose a tag to compare

hotfix.

0.0.1

17 Mar 12:23

Choose a tag to compare

first release.