Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert GitHub Wiki into GitHub pages?

I want my existing GitHub Wiki to be served as GitHub pages.

I tried copying all the .md files into /docs and setting that as the source for pages - but it breaks all the internal links.

So I see Read the [[documentation]] or [[Help|get help]]. rather than links.

What's the easiest way to host my wiki on GitHub pages?

like image 492
Terence Eden Avatar asked Dec 16 '16 11:12

Terence Eden


People also ask

How do I publish a GitHub repository to pages?

Publishing from a branchOn GitHub, navigate to your site's repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Pages. Under "Build and deployment", under "Source", select Deploy from a branch.

What is a GitHub wiki page?

For more information, see "GitHub's products." Every repository on GitHub.com comes equipped with a section for hosting documentation, called a wiki. You can use your repository's wiki to share long-form content about your project, such as how to use it, how you designed it, or its core principles.

What is the difference between GitHub and GitHub Pages?

The purpose of GitHub Pages is to provide the GitHub user a way to create personal websites for themselves and websites for their projects / repositories. For each registered GitHub account (representing a user or an organization) you can register one User Page, but an unlimited Project pages.


2 Answers

You need to create manual Markdown links to each page.

[[documentation]] and [[Help|get help]] style links are wikilinks and generally only used in wikis. They are not part of the standard Markdown syntax and not supported by Jekyll (which GitHub Pages uses under the hood). Note that GitHub Wiki supports both styles, so you could edit your links before importing if you like.

Either way, you need to edit your links to manually point to the appropriate pages using the standard markdown syntax:

Read the [documentation](path/to/documentation/) or [Help](path/to/get_help.html)

Of course, you will need to adjust the above paths to point at the correct location. As an alternative, you may be able to use Jekyll permalinks, which could provide a shortcut for you to identify specific pages without specifying a full path.

like image 63
Waylan Avatar answered Oct 21 '22 12:10

Waylan


Just received this direct from GitHub.


There is no easy answer I am afraid. You will need to script or manually change the wiki format URLs to proper markdown format.

We did just add relative links to GitHub Pages though:

https://github.com/blog/2290-relative-links-for-github-pages

Which should make things easier at least, as you won't need to fully qualify all the URLs.

So you can change:

Read the [[documentation]] or [[Help|get help]].

to

Read the [documentation](documentation.md) or [Help](get%20help.md).

Alternatively, you may be able to use pandoc and the script below to do the conversion for you:

https://github.com/philipashlock/mediawiki-to-markdown

But I haven't tested it myself so I can't guarantee it will work.

This could be useful feature though, so I will share it with the team in the hope of an easy converter in the future

like image 25
Terence Eden Avatar answered Oct 21 '22 11:10

Terence Eden