Question

While creating GitHub Pages for my project I was suggested to import existing README.md as the project's homepage. Later, I merged gh-pages with master and ended up with both index.html and README.md.

The "problem" is that the updates to README.md won't affect index.html. Is there any simple way to keep them in sync? Preferably with zero Jekyll knowledge...

Was it helpful?

Solution

Here's what I came up with, in case someone is interested.

Typically I write HTML using Jade preprocessor, and luckily it does support GitHub Flavored Markdown which is the language README.md is written in. So my steps where as following:

  1. Translate index.html generated by GH Pages to Jade. I used online html2jade tool;
  2. Save the output to index.jade;
  3. Locate section block in the resulting markup in index.jade and replace its entire content with:

    section include:md README.md

  4. Run jade index.jade which produces new, automatically generated index.html;
  5. Commit both files to gh-pages.

See example in this commit on GitHub.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top