An open API service indexing awesome lists of open source software.

https://github.com/themanyone/gitblog

Use GitHub as a blogging platform. Grabs markdown files from GitHub and displays them on your website.
https://github.com/themanyone/gitblog

Last synced: 7 months ago
JSON representation

Use GitHub as a blogging platform. Grabs markdown files from GitHub and displays them on your website.

Awesome Lists containing this project

README

          

# [GitBlog](https://github.com/themanyone/gitblog)
GitBlog

Use [GitHub](https://github.com/themanyone/gitblog) as a blogging platform. Load remote content from GitHub and display it as part of a site. Free collaborative web publishing with [Git](https://git-scm.com/download/win).

Brought to you by [TheNerdShow.com](http://thenerdshow.com/)

This project has become part of [FirstPage](http://thenerdshow.com/firstpage).

* Keep websites up to date
* Reduce duplicate work
* Better collaboration
* Track revision history
* Work offline, and locally

## Why This Exists

We developed several [GitHub projects](https://github.com/themanyone) and synchronizing our website with [README.md](README.md) from each project became tiresome. Browsers routinely cache the result of AJAX queries for many hours anyway, unless [instructed to do otherwise](http://www.itgeared.com/articles/1401-ajax-browser-cache-issues-fix/), so there is nothing wrong with having a website fetch markdown from GitHub [or custom git server](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) and convert it to HTML on demand. Then we had another thought. Why not serve even more content in [markdown](https://help.github.com/enterprise/2.8/user/articles/basic-writing-and-formatting-syntax/) format?

## How It Works

Use [GitBlog](https://github.com/themanyone/gitblog) to display README.md from a GitHub project, or create entire websites on GitHub using their simplified [markdown](https://help.github.com/enterprise/2.8/user/articles/basic-writing-and-formatting-syntax/) format. GitBlog is a simple js script that takes [markdown](https://help.github.com/enterprise/2.8/user/articles/basic-writing-and-formatting-syntax/) files from GitHub and displays them on a website using [marked.js](https://github.com/chjj/marked). Start a GitHub project containing markdown files and use GitBlog to display them as web pages.

[GitBlog](https://github.com/themanyone/gitblog) takes a specially-crafted URL with a=author, p=project name, and f=file name containing markdown. Fill out this form and click submit for an example. Copy or bookmark the resulting page link, and add it to the sitemap or navigation bar.
GitHub Configuration
author:
project:
(opt.) file:

You may also enter the URL of local or remote [markdown](https://help.github.com/enterprise/2.8/user/articles/basic-writing-and-formatting-syntax/) files.
Load Markdown File
URL:

## Automatic Meta Tag Generation

* `#` Heading at start of page becomes the <title> tag.
* The first sentence becomes the website description.
* Keywords tag is automatically generated from content word count.
* Google [apparently indexes](http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157) these automatically generated tags.

## Installation

1. Get [GitBlog from GitHub](https://github.com/themanyone/gitblog)
1. Update [marked.js](https://github.com/chjj/marked).
2. See that the latest marked.js is in the js folder of this project.
3. Edit this README.md or replace with custom markdown.
4. Edit navbar.html or use [FirstPage](http://thenerdshow.com/firstpage) to generate the menu.
3. Copy this project to a web server.

## Testing

You may test this project

* by running `python3 -m http.server&`
* by running `php -S addr:port&`
* with `webfsd -F -p 8000&`
* using `ruby -run -ehttpd . -p8000&`
* or with [many other test servers](http://unix.stackexchange.com/questions/32182/simple-command-line-http-server).

## Credits

Our script loads the remote content, displays it on a web page, and generates meta tags. It depends upon [marked.js](https://github.com/chjj/marked) by Christopher Jeffrey to convert the GitHub style [markdown](https://help.github.com/enterprise/2.8/user/articles/basic-writing-and-formatting-syntax/) to HTML. We also need something like [Git](https://git-scm.com/download/win) to keep track of the version history. Git already exists and is stable. Why not use it?