Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering a GitHub wiki on a GitHub Pages Jekyll site

I have a repository with a wiki full of over 80 pages. I want to render an index of all the wiki pages on the Jekyll (GitHub Pages) site for the project, as well as render each page on the site using a custom layout, and using the styles of the rest of the site.

To do this, my first instinct was to use git submodules to include the pages from the wiki (which GitHub exposes as a git repo) in the Jekyll site's repo. But that's as far as I got: As far as I can tell, there is nowhere that Jekyll will accept markdown files that don't conform as a post. They aren't named with a date, and they don't have any frontmatter, so Jekyll just ignores them.

To get around this, I would normally just write a plugin to do what I wanted. But because the site is hosted on GitHub pages, it won't allow any plugins that I create.

So, I really don't know how to proceed. Is it even possible without custom plugins?

like image 260
Wasabi Fan Avatar asked Aug 30 '14 04:08

Wasabi Fan


People also ask

How does Jekyll work on GitHub?

Jekyll is a static site generator with built-in support for GitHub Pages and a simplified build process. Jekyll takes Markdown and HTML files and creates a complete static website based on your choice of layouts. Jekyll supports Markdown and Liquid, a templating language that loads dynamic content on your site.

Does GitHub Pages use Jekyll?

GitHub Pages are public web pages for users, organizations, and repositories, that are freely hosted on GitHub's github.io domain or on a custom domain name of your choice. GitHub Pages are powered by Jekyll behind the scenes, so they're a great way to host your Jekyll-powered website for free.

Can I use GitHub Pages without Jekyll?

Yes, you just have to add the link to the CSS file in the html file and the styling will work. You'll also just need a single CSS file if you want to.


1 Answers

The idea is :

  1. download my plugin
  2. read the docs
  3. install and rake
  4. drink a beer

What the raketask/plugin are doing once installed and configured (5 minutes) :

  1. rake wikisub add a git submodule pointing to your wiki. Must be a public wiki but can be on another repository
  2. copy and transform downloaded wiki pages as markdown with yaml front matter
  3. build Jekyll, then the plugin intercept wiki pages links conversion to transform them as Jekyll links
  4. order pizzas

For now the only problem (or not) is that Kramdown doesn't do well with Github markdown. You have to switch to redcarpet.

Two other tasks are available :

  • rake wikibuild : rebuild wiki pages

  • rake wiki : synch wiki page, build and optionally push change to Jekyll repository

Et hop!

like image 174
David Jacquel Avatar answered Sep 20 '22 15:09

David Jacquel