Coder Social home page Coder Social logo

blogit's Introduction

blogit – the almost too uncomplicated bash blogger

NOTE: blogit is handcrafted for my needs, powering my website, and most likely won't serve you, unless you configure it for your own needs. It doesn't treat the server as a black box – blogit actually needs to know a few things about your servers inner workings. That said, feel free to check it out. Below are instructions if you still want to use it for your own needs.

Blogit powers hjorthjort.com

Blogit pushes markdown documents to a specified server and "publishes" them.

What you need:

  • A shell that runs bash scripts.
  • A server for hosting.
  • Login credentials for that server or access via ssh key.
  • A blogpost written in markdown or html.

What it does:

What you have to do is this:

  1. Open blogit in your texteditor and set your username and IP to the preferred values in the top of the document. Also change the variable rootpath to reflect the place on your server where you want your posts to go. You only have to do this once.
  2. Create a folder called blog-posts on your server where you want your posts to go, under the folder you set as rootpath.
  3. cd into folder with your post (optional, but gives you more managable, legible and less revealing filenames in the end).
  4. On the command line, write "blogit publish ". For example: "blogit publish README.md".

Blogit then does the following:

  1. Converts your post to html using pandoc.
  2. Enters your server via ssh. If you don't have an ssh key, you will have to enter your password here.
  3. Writes the post to a new file with the same name as your post, with an added ".html" at the end. For example "README.md.hmtl".
  4. Creates a file called .post-index.txt and writes the path name of your new post at the top of that file. For example "~/my-site/blog-posts/README.md.html".

You can now have html posts as well as an index sorted in reverse chronological order over the posts in your blog-posts file.

The way I use this is that I in index.php at my site do a foreach loop over the lines in .post-index.txt and for each of them I print out the contents of the file that line points to, as well as any additional information I want to add, like timestamps, horisontal divisors and such. I also use the contents of .post-index.txt to create a list over recent blogposts at the top of my site, complete with links to these posts.

blogit's People

Contributors

hjorthjort avatar

Watchers

James Cloos avatar  avatar

blogit's Issues

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.