markdown-blog-push-tool
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Markdown blog push tool for node.js

A tool for processing markdown file blogs, supports uploading blog platforms and uploading pictures to image beds

The md files of hexo and docusaurus can be uploaded

This project uses metaweblog-api to complete the blog upload

install

npm install markdown-blog-push-tool

Usage

init

const MarkdownBlogPushTool = require("../");
const { resolve } = require("path");
const Authorization = "xxx"; // TODO :  use your smms Authorization
const apiUrl = "xxx"; // TODO : use your blog API instead
const username = "xxx"; // TODO: your username
const password = "xxx"; // TODO: use your password
const replaceURL = true; // TODO: is replaceURL
const replaceURLReg = new RegExp("https://s2.loli.net/"); // TODO: replaceURL rule
const markdownBlogPushTool = new MarkdownBlogPushTool(
  { apiUrl, username, password }, // metaWeblogOptions
  { Authorization, replaceURL, replaceURLReg } // replaceImgOptions
);

upload and replace all images and push all post to apiUrl

// TODO: your md file dir
const path = resolve(__dirname, "./assets");
//  upload and replace all images and push all post to apiUrl
markdownBlogPushTool.pushMarkdownBlog(path, true);

push all post to apiUrl

// push all post to apiUrl
markdownBlogPushTool.pushMarkdownBlog(path);

upload and replace all images

// upload and replace all images
markdownBlogPushTool.replaceImgUrl(path);

example

example

reference

/markdown-blog-push-tool/

    Package Sidebar

    Install

    npm i markdown-blog-push-tool

    Weekly Downloads

    3

    Version

    1.1.4

    License

    MIT

    Unpacked Size

    385 kB

    Total Files

    21

    Last publish

    Collaborators

    • bitbw