GithubHelp home page GithubHelp logo

huangge1199 / hexotowordpress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onekyle/hexotowordpress

0.0 0.0 0.0 6.91 MB

convert hexo markdown posts to wordpress

License: MIT License

Python 100.00%

hexotowordpress's Introduction

HexoToWordPress python3.7

Convert your hexo markdown posts to html then publish to your wordpress blog.

中文

从Hexo迁移到WordPress

Project file structure

├── .env
├── .gitignore
├── LICENSE
├── README.md
├── blog_uploader
│   ├── __init__.py
│   ├── config.py
│   ├── main.py
│   ├── markdown_parser.py
│   └── wordpress_publisher.py
└── image_scraper.py

Markdown file format

Before use this script, you should make sure your post was created by hexo command or it has a hexo post format:

---
title: Your post title
date: 2021-04-01 20:16:49
tags: [Python]
---

...content...

Usage

upload blog

install python-wordpress-xmlrpc

pip install python-wordpress-xmlrpc

read the python-wordpress-xmlrpc doc to get the your wordpress xmlrcpath.

fill your xmlrcpath, user name and passwd in .env.

WORDPRESS_XMLRCPATH=https://blog.1kye.com/xmlrpc.php
WORDPRESS_USER_NAME=YourName
WORDPRESS_USER_PASSWD=Password

then you can upload your post to your wordpress blog.

python -m blog_uploader.main file

upload blog with image

download images

usage: image_scraper.py [-h] [-s STYLE] [-n COUNT] dir

positional arguments:
  dir                   存储图片目录

optional arguments:
  -h, --help            show this help message and exit
  -s STYLE, --style STYLE
                        下载图片的风格
  -n COUNT, --count COUNT
                        批量下载的个数
python image_scraper.py imgs -s code -n 10

upload blog

python -m blog_uploader.main mds imgs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.