From a34ac702a55ef1791035a2b04941ff0c17577b0e Mon Sep 17 00:00:00 2001 From: Suman Maity Date: Sat, 10 Dec 2022 21:33:05 +0100 Subject: [PATCH] Introduce medium importer (#499) Merge pull request 499 --- docs/_data/importer_dependencies.yml | 2 ++ docs/_importers/medium.md | 27 +++++++++++++++ lib/jekyll-import/importers/medium.rb | 36 +++++++++++++++++++ test/mocks/medium_feed.xml | 50 +++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 docs/_importers/medium.md create mode 100644 lib/jekyll-import/importers/medium.rb create mode 100644 test/mocks/medium_feed.xml diff --git a/docs/_data/importer_dependencies.yml b/docs/_data/importer_dependencies.yml index 8f82c967..b7dd4777 100644 --- a/docs/_data/importer_dependencies.yml +++ b/docs/_data/importer_dependencies.yml @@ -50,6 +50,8 @@ jrnl: - safe_yaml marley: - safe_yaml +medium: +- safe_yaml mephisto: - mysql2 - sequel diff --git a/docs/_importers/medium.md b/docs/_importers/medium.md new file mode 100644 index 00000000..67101e4d --- /dev/null +++ b/docs/_importers/medium.md @@ -0,0 +1,27 @@ +--- +layout: docs +title: Medium +prev_section: marley +link_source: medium +next_section: mephisto +permalink: /docs/medium/ +--- + +To import your posts from [Medium](https://medium.com/), run: + +{% highlight bash %} +$ ruby -r rubygems -e 'require "jekyll-import"; + JekyllImport::Importers::Medium.run({ + "username" => "name", + "render_audio" => false, + "canonical_link" => false, + })' +{% endhighlight %} + +The `username` refers to the medium username, and it's a mandatory field. + +Other optional fields are as follows: +* `canonical_link` – copy original link as `canonical_url` to post. (default: `false`) +* `render_audio` – render `