Git Product home page Git Product logo

wp_img_mover's Introduction

wp_img_mover

This script identifies src property from <img> tags in .md files, copies the image file to Dropbox (if they were hosted on your Wordpress server), and changes the <img> tags to .md format.

Usage:

  1. Install Python and lxml.

  2. Download the images hosted on your Wordpress site.

    Connect to your host via ftp. You may find the images in something like /wp-content/uploads

  3. Edit the script wp_img_mover.py to set the correct urls / paths in lines 9-13.

    srcUrlPrefix: prefix of the original image src url, excludes the part "year/mo/imagename.jpg",

    e.g. 'http://azaleasays.com/wp-content/uploads/'

    destUrlPrefix: prefix of the Dropbox url where you would like to host the image,

    e.g. 'https://dl.dropboxusercontent.com/u/308058/blogimages/'

    srcImgDirPrefix: directory on your local machine where you temporarily store the downloaded images from Wordpress.

    e.g. '/Users/azalea/Downloads/uploads/'

    destImgDirPrefix: directory under Dropbox's Public folder where you would like to store the images.

    e.g. '/Users/azalea/Dropbox/Public/blogimages/'

    postsDir: directory where your jekyll blog posts are located. i.e. _posts

    e.g. '/Users/azalea/Dropbox/projects/azalea.github.io/_posts/'

  4. Create a test branch for your Jekyll project.

  5. Run the script by:

    python wp_img_viewer.py

  6. Check very carefully to see if everything is ok.

    If so, merge the test branch to master.

    If not, edit the script at your will and retry.

wp_img_mover's People

Contributors

azalea avatar

Watchers

 avatar  avatar

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.