medium2jekyll assists in migrating from a Medium blog to a jekyll-based blog, notably one hosted on github.io. Specifically, it helps with - text scraping/formatting html to markdown - image downloading from posts - markdown cleaning for post content extraction
To port your own Medium blog, start by downloading the github package from here:
devtools::install_github("data-steve/medium2jekyll")
Then all you need to start the process is your Medium handle from the url of your Medium blog.
For example, if url to your Medium page is www.medium.com/@fun_times
, then @fun_times
is the handle. From this (or even the full url), medium2jekyll will start the transfer process.
Simply plop your Medium handle in the main medium2jekyll function like so:
library(medium2jekyll)
medium2jekyll("@fun_times") # not a real medium acct
The function goes through the following steps:
If you're like me, you wanted to transfer blog platforms because you not only have old content, but you also have new content. medium2jekyll comes with one helper function for this:
new_post("some title")
new_post()
has several things going on to save the file with the correct file-naming conventions that Jekyll expects, namely , one that has a date and file name as a markdown file. For example, new_post("the end of the year", date = "2016-12-31")
would create and open a file named 2016-12-31-the-end-of-the-year.md
with markdown boilerplate already containing the title in titlecase.
There are other aspects of the medium2jekyll package which are generically useful for converting html files to markdown that I may explore further at my new blog: data-steve.github.io.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.