ghpages-convert

0.1.9 • Public • Published

ghpages-convert

A command line tool to convert github page templates to blogs

Build Status

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:

  1. In a repository, select Settings --> Automatic Page Generator
  2. Follow the instructions and pick a template that best fits
  3. Once the Automatic Page Generator is complete, your page will be available
  4. clone your repository to your machine
git clone <your repository
  1. Switch your branch to the gh-pages branch
git checkout gh-pages
  1. 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
  1. Add the added files to your git repository
$: git add _layouts/*
$: git add _posts/*
$: git add _includes/*
$: git add _assets/*
  1. Commit your changes
$: git commit -a
  1. Push changes to github
$: git push
  1. View your page using its url and start adding files to the posts directory.

Package Sidebar

Install

npm i ghpages-convert

Weekly Downloads

12

Version

0.1.9

License

MIT

Last publish

Collaborators

  • tjchaplin