Skip to content

A vuepress plugin uses XmlRpc to synchronize Vuepress content to WordPress

Notifications You must be signed in to change notification settings

lzwdot/vuepress-plugin-to-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vuepress Plugin To WordPress

A plugin uses XmlRpc to synchronize Vuepress content to WordPress, implements all the interfaces in XML-RPC_WordPress_API.

use:

plugins: [
  //...
     ['vuepress-plugin-to-wordpress', {
       username: 'root',
       password: 'root',
       options: {
         https: false,
         host: 'localhost',
         port: 80,
         path: "/wordpress/xmlrpc.php"
       },
       onPrepared: (wpRpc, app) => {
         app.pages.forEach(page => {
           const content = {
             post_author: 1,
             post_type: 'post',
             post_title: page.frontmatter.title,
             post_content: page.frontmatter.content,
           }
           wpRpc.newPost(1, content).send((err, data) => {
             console.log(err, data)
             // ...
           })
         })
       }
     }]
  //...
]

Refer to tests/wordpress-test.js for other API interfaces

test

npm run test

About

A vuepress plugin uses XmlRpc to synchronize Vuepress content to WordPress

Resources

Stars

Watchers

Forks

Packages

No packages published