ghpages-convert
v0.1.9
Published
A command line tool to convert github page templates to blogs
Downloads
17
Maintainers
Readme
ghpages-convert
A command line tool to convert github page templates to blogs
Installation
Install globally so that the executible is available on the command line
npm install ghpages-convert -g
Convert
$: cd ~/myGithubPage
$: ghpages-convert
//-> your github page template will now be converted to a bloggable format for jekyll
Before and After Examples
- Before a github pages project is converted using ghpages-convert
- After a github pages project is converted using ghpages-convert
Motivation
Github provides nice templates to use for your applications and projects. The templates don't utilize some of the full features of Jekyll, the engine Github uses to generate and serve pages. To make the conversion of template pages to a blog type format can be time consuming and difficult.
This project takes github page templates and converts them to a bloggable jekyll format. This includes the creation of the following directories:
- _layouts - page/post layouts
- _includes - page/post includes such as header/footer etc
- _posts - individual post directory
- _assets - images and such that can be linked
ghpages-convert parses the html in the index.html file generated through github's automatic page generator and breaks up the html into the respective folders.
Steps by Step
You should follow Github instructions for how to use the Automatic Page Generator.
Once you have created your page you can skip to step 4
I have also provided a brief summary of all the instructions:
- In a repository, select Settings --> Automatic Page Generator
- Follow the instructions and pick a template that best fits
- Once the Automatic Page Generator is complete, your page will be available
- clone your repository to your machine
git clone <your repository
- Switch your branch to the gh-pages branch
git checkout gh-pages
- run ghpages-convert to convert your page
$: cd ~/myGithubPage
$: ghpages-convert
//-> your github page template will now be converted to a bloggable format for jekyll
- Add the added files to your git repository
$: git add _layouts/*
$: git add _posts/*
$: git add _includes/*
$: git add _assets/*
- Commit your changes
$: git commit -a
- Push changes to github
$: git push
- View your page using its url and start adding files to the posts directory.