Regarding separate Medium and non-Medium posts.
I suggest treating the Medium posts as Jekyll posts but with no content. Or include the body but don’t display it.
Then use a “medium” category or tag on all your medium posts. This can be added easily using the conversion process.
You can even have a “medium” folder inside _posts
and the posts in there will get the Medium category.
Once you have category or tag to separate Medium and non-Medium, you can update your layout so that you can handle them different.
I would avoid using the Jekyll redirect plugin as that adds extra complexity and dependency without much benefit.
On your blog listing pages, you can iterate over all posts.
And then you can set conditional statement in your blog.md or the layout for that page.
If it is a standard post, then you link to it internally.
src="{{ post.url | relative_url }}"
result is like
/repo-name/2020/01/02/my-title.html
In the case of your repo being on the root of your GitHub.io site, it will just be outputted as
/2020/01/02/my-title.html
And you can have an if statement which looks for the presence of the “medium” category and then provides an external link to your Medium blog.
Roughly
for post in posts
H2 {{ title }} {{ post.date }}
p {{ post.description }}
if medium in post.categories
src={{ post.external_url }}
else
src={{ post.url }}
endif
p i {{ post.abstract | post.extract
endfor
If the abstract
key is not set on a post, then use builtin post.extract method. Or use the Medium check there.
You may also want a link or arrow symbol or Medium logo to tell the user they are clicking on an external URL.
You may want to get all the Medium pages on your Jekyll site setup with rel canonical tag or removed from sitemap or disabled output, to avoid duplicating the content. But this is not so important. The ranking of the original medium posts won’t be affected by duplicating on another site, the duplicates just won’t appear in search results.