Git Product home page Git Product logo

frajer's Introduction

Marley

Marley is minimal blog engine without admin interface written in Sinatra framework (sinatrarb.heroku.com/).

It has no admin interface for writing posts. Use your favorite text editor to edit plain-text files and synchronize them to server. Marley uses plain-text files for storing articles and SQLite database for storing comments (set data location in config.yml). It comes with Rake and Capistrano tasks for deploying the application and syncing articles from your local machine to the server.

The master branch is bare application, restafari_org branch is what will runs www.restafari.org.

You *should make your own branch* for your own styling, so you can git pull any future updates from the master and then merge them into your branch.

It is currently alpha software.

Ingredients

  • Sinatra, Rack and Thin

  • ActiveRecord and SQLite

  • Typekey Antispam filtering (see ./vendor/antispammer.rb)

  • YAML configuration

  • RDiscount for Markdown –> HTML conversion

  • Builder for Atom feed generation

  • Rake and Capistrano tasks

Installation and dependencies

You have to install or update following Rubygems:

sudo gem install sinatra rack thin activerecord sqlite3-ruby rdiscount builder capistrano

Edit this configuration file:

config/config.example.yml

and rename it to config.yml.

Install the application with this Rake task:

rake app:install

Load this URL in your browser:

http://localhost:4567

Deployment

First time:

  • Use Capistrano task cap upload_config to copy config.yml to server

  • cap deploy:setup

  • cap deploy:cold

Then:

  • cap deploy

Synchronizing content

Marley has no administrative interface for writing articles inside some silly <textarea>. It assumes you like to write in your favorite text editor, using Markdown, previewing on the fly, and just synchronize when you’re ready to publish.

There are several ways how to do that:

  • You can be hardcore and write articles over SSH in Vim directly on the server for “just-in-time-publication” when you hit :w

  • You can be less glorious, of course, and save your articles to some folder on your disk and scp-ing said folder to the server. Or use SFTP? Cyberduck drag & drop? Aaargh, not reccommended unless you really like to see what you’re doing, in real time.

  • You can implement some sane practice and start versioning your writing with Git. (What else?) This way, you can setup remote repository on your server, just push-ing changes whenever you feel like you want to say something in public. A post-commit hook is completely neccessary in this case, of course. (It isn’t paramount of convenience having to SSH on your server to run git pull origin master in some folder.) There will be a Marley Capistrano task for setting this up in the future? You bet.

  • When you already use Git, you can push to Github (where else?), and have Github call Marley by it’s Post-Receive Hooks (github.com/guides/post-receive-hooks). See the get "/sync" route dangling towards the end of the marley.rb? You get the picture.

Of course, put other ideas in the Marley Wiki (github.com/karmi/marley/wikis)

Todo

  • Implement data syncing logic (git push to remote with post-receive hook, Github post-commit hook to Marley, etc)

  • Add minimal admin interface feature for filtering spam comments (based on HTTP-Auth)

  • Do not show spam comments in HTML and feed (after ^^^)

  • Enable commenters edit their comments for 15 minutes after posting (based on cookie)

  • Kick Markdown formatting into a Formatter so everyone can use whatever formatter she likes

  • Kick articles extraction logic into an Interface so everyone can use whatever data store she likes, not being plain (texter) like me

Licence

Copyright © 2008 Karel Minarik (www.karmi.cz)

Code released under the MIT license, do not reuse graphical assets and styles in the master branch, please

frajer's People

Contributors

karmi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

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.