Skip to content

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

License

Notifications You must be signed in to change notification settings

themanyone/gitblog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitBlog

Use GitHub as a blogging platform. Load remote content from GitHub and display it as part of a site. Free collaborative web publishing with Git.

Brought to you by TheNerdShow.com

This project has become part of 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 and synchronizing our website with README.md from each project became tiresome. Browsers routinely cache the result of AJAX queries for many hours anyway, unless instructed to do otherwise, so there is nothing wrong with having a website fetch markdown from GitHub or custom git server and convert it to HTML on demand. Then we had another thought. Why not serve even more content in markdown format?

How It Works

Use GitBlog to display README.md from a GitHub project, or create entire websites on GitHub using their simplified markdown format. GitBlog is a simple js script that takes markdown files from GitHub and displays them on a website using marked.js. Start a GitHub project containing markdown files and use GitBlog to display them as web pages.

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 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 these automatically generated tags.

Installation

  1. Get GitBlog from GitHub
  2. Update marked.js.
  3. See that the latest marked.js is in the js folder of this project.
  4. Edit this README.md or replace with custom markdown.
  5. Edit navbar.html or use FirstPage to generate the menu.
  6. 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.

Credits

Our script loads the remote content, displays it on a web page, and generates meta tags. It depends upon marked.js by Christopher Jeffrey to convert the GitHub style markdown to HTML. We also need something like Git to keep track of the version history. Git already exists and is stable. Why not use it?

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published