Giter Site home page Giter Site logo

fall-project-johnchaffee's Introduction

Build Blog Script

Introduction

This script creates a static blog from a new file plus existing html files. It is designed around my workflow and probably won't be useful to anyone else. When running the script, it adds/renames the new.html file to the blog, and updates the index.html, feed.xml, and supporting files.

Workflow

  • Create a new blog post using the new.html file as a template.
  • The template contains sections for the header, footer, sidebar and post content.
  • When editing the template, you should only edit the "FullPost" section, and the categories in the head.
  • Optional categories may be entered, one per line, in the meta category lines in the head.
  • There should only be one blog title/url line surrounded by h2 tags.
  • All urls must be absolute (for the feed.xml)
  • All styles must be inline (for the feed.xml)
  • After editing the new.html file, run the build_blog.rb script to start the process. You'll be prompted to add the new.html file to the blog, then the supporting files will be rebuilt (index, feed, and supporting files).

File Structure

The root directory (/blog) contains:

  • Template files (feedfooter.txt, header.txt, new.html, sidebar.html, etc.)
  • Generated blog posts (2011-01-01-my-first-blog-post.html, etc.)
  • Generated supporting files (archive.html, category1.html, etc.)
  • The /app folder (described below)

/blog

2011-01-01-my-first-blog-post.html
2011-01-02-my-second-blog-post.html
2011-01-03-my-third-blog-post.html
/app
archive.html
category1.html
category2.html
category3.html
feed.xml
feedfooter.txt
feedheader.txt
footer.txt
header.txt
index.html
new.html
sidebar.html

The /app directory contains the code. The meat is in the /lib directory:

  • build_blog.rb -- script that prompts user to add a new blog post and/or rebuilding the site.
  • build_all_pages.rb -- code that generates the static site.
  • create_new_post.rb -- code that adds new blog post.

/app

Gemfile
Gemfile.lock
/lib
	build_all_pages.rb
	build_blog.rb
	create_new_post.rb
Rakefile.rb
README.md
/spec
	build_blog_spec.rb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.