peterjc / mediawiki_to_git_md

Convert a MediaWiki export XML file into MarkDown as a series of git commits
MIT License
54 stars 17 forks source link

MediaWiki redirects --> Jekyll's redirection #8

Closed peterjc closed 9 years ago

peterjc commented 9 years ago

See https://help.github.com/articles/redirects-on-github-pages/

Consider a MediaWiki page like this from http://biopython.org/wiki/Git which redirects to http://biopython.org/wiki/SourceCode

#REDIRECT [[SourceCode]]

The pandoc GitHub Flavour Markdown output results in a place holder page Git.md with a link to the new page.

What we seem to need to do instead is to add a redirect_from line to the Jekyll header in SourceCode.md, e.g.


---
... existing meta data like title ...
redirect_from: "/wiki/Git"

---

Update: Even easier, we can edit Git.md with the redirect_to tag instead. For instance,


---
title: Git
redirect_to: /wiki/SourceCode

---
This page should redirect you to [SourceCode](SourceCode "wikilink").
peterjc commented 9 years ago

Appears to be working as of https://github.com/peterjc/mediawiki_to_git_md/commit/7144e27dc96b257584a166f5c9ac68452a0f3553

TODO: Use the _config.yml entry baseurl with prefix?