• Stars
    star
    246
  • Rank 164,726 (Top 4 %)
  • Language
    Ruby
  • Created about 16 years ago
  • Updated about 15 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimalist blogging engine without textareas based on Markdown, Ruby, Sinatra and Git push hooks

Marley¶ ↑

Marley is minimal blog engine without admin interface written in Sinatra framework (sinatra.rubyforge.org).

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 installing and deploying the application, and for syncing articles from your local machine to the server.

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

In case you like to use Marley, you should fork it and then make your own branch for your own styling, so you can git pull any future updates from the master and then merge/cherry-pick them into your branch. Marley has support for themes: see themes directory. Just duplicate the default directory and start tweaking. Obviously, do not use the restafari theme for your own blog, please.

Ingredients¶ ↑

  • Sinatra, Rack and Thin

  • ActiveRecord and SQLite

  • Akismet filtering (see ./vendor/akismetor.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 save it as config/config.yml.

Install the application with this Rake task:

$ rake app:install

Load this URL in your browser:

http://localhost:4567

You’re done. SRSLY.

Deployment on server¶ ↑

Ensure that you have correct information in config/config.yml. Rename example deploy file to config/deploy.rb and fill in proper information for: user, repository, deploy_to, app, web, db. Then run:

  • cap deploy:setup

  • cap deploy:cold

Normal Capistrano deployment procedures apply (ie. you use cap deploy very often).

Of course, you have to ensure that there is at least some content on the server in data directory. See next section!

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.) See Capistrano task cap sync:setup:hook for setting this up.

  • 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). Github then calls Marley’s /sync and it will git pull changes from Github. How is this authenticated? Good question. By setting up a (possibly long and secure) token in the config file. OMG! Could be overheard in the internets! If you’re worried or prudent, do not use this. (See Capistrano task cap sync:setup:github for adding remote Github repo on the server!)

You can set-up last two options by running Capistrano task cap sync:setup. Choose whether you like to upload your local data as a Git repository to the server (and setup post-receive hook in doing so) or you want to clone data from Github repository. You should add a Post-Receive URL in your repo’s administration on Github as told by the task when it has runned.

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

Managing spam¶ ↑

Marley displays spam comments on the article page, by default. You can easily mark and delete spam in admin interface, when you prepend article URL with admin – as in localhost:4567/admin/my-slashdotted-article.html. Log in with credentials set in config.yml.

In addition, there are Rake and Capistrano tasks for easily destroying spam from command line or a cron job: rake manage:spam:prune and cap manage:spam:prune. You just lose “false positives” this way. But there aren’t much of them with Akismet.

Todo¶ ↑

  • Authenticate Github hook by HTTP-Auth, not token

  • 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 restafari_org branch, please

More Repositories

1

retire

A rich Ruby API and DSL for the Elasticsearch search engine
Ruby
1,870
star
2

elasticsearch-paramedic

A simple tool to inspect the state and statistics about ElasticSearch clusters
JavaScript
664
star
3

monittr

Ruby and web interface for Monit statistics
Ruby
237
star
4

localized_country_select

Rails plugin for localized "country_select" helper with Rake task for downloading locales from Unicode.org's CLDR
Ruby
180
star
5

pushr

Deploy Rails applications automatically by running Capistrano tasks with Git post-commit hooks
Ruby
113
star
6

ember-data-elasticsearch

elasticsearch adapter for Ember Data
JavaScript
94
star
7

rails-deployment-setups-sprinkle

Collection of recipes for various Ruby On Rails deployment setups
Ruby
69
star
8

tire-contrib

Additions and extensions for the Tire gem
Ruby
65
star
9

chef-hello-cloud

A demo of a full stack Rails application deployment (1x load balancer, 3x appserver, 1x database, 3x elasticsearch) with Chef Server
Ruby
59
star
10

visualizing-couchdb-changes-with-node-js

An experiment in basic real-time visualization of CouchDB _changes stream with Node.js and Socket.IO
JavaScript
32
star
11

chef-solo-hello-world

A tutorial for Chef Solo
Ruby
31
star
12

yaml_micro_chat

YAML based micro-chat in Sinatra framework for Ruby
Ruby
31
star
13

rails_i18n_demo_app

Demo for Rails 2.2 internationalization &amp; localization features
Ruby
27
star
14

dotfiles

Vim Script
19
star
15

couchdb-showcase

A small application to demonstrate basic CouchDB features
JavaScript
18
star
16

clearance_http_auth

Simple, instant HTTP Basic Authentication for applications using Clearance
Ruby
16
star
17

redis_twitter_example

An executable tutorial showcasing Twitter “lookalike” in Redis for the Czech and Slovak PostgreSQL User Group talk
Shell
14
star
18

hide

Search for Jekyll websites
Ruby
13
star
19

sheep_in_your_shoes

A tutorial game in Shoes for teaching OOP
Ruby
12
star
20

sinatra_workshop_tutorials

Collection of small apps to demonstrate Sinatra micro-framework and it's stage
Ruby
10
star
21

workshop_tutorial_application

Tutorial Ruby on Rails application (similar to www.tadalist.com) coded live on workshops. Development steps can be reconstructed from commits.
Ruby
10
star
22

smokes

Tracking your nicotine intake with CouchDB and Protovis
JavaScript
9
star
23

colibriary

Demo application to show how to use Cucumber stories in Czech
Ruby
8
star
24

markout

Export sexy formatted documents with history from plain text files. Work in progress.
JavaScript
8
star
25

shoes_demonstration_apps

Collection of tiny apps to demonstrate Shoes GUI toolkit at lectures, user group meetings, etc
Ruby
7
star
26

elastic-stack-demo

Demo of the observability features of the Elastic Stack
Go
6
star
27

gotalks

JavaScript
5
star
28

es-rails-example

Demo for the Elasticsearch integration with Ruby On Rails (ElasticON 2016)
Ruby
5
star
29

wikipedia_history_viz

Ruby
5
star
30

elasticsearch_webexpo_demo

Demo of Distributed Features for Webexpo 2011
Ruby
4
star
31

resque-demo

A set of scripts to demonstrate the Resque framework for processing background jobs
Ruby
3
star
32

markout-tmbundle

Ruby
3
star
33

consolelog

A ConsoleWriter for rs/zerolog
Go
3
star
34

calculator

Calculator: example repository for Git workshops
JavaScript
2
star
35

tdd_tutorial_by_numbers

Test-Driven Development in Ruby by Numbers (tutorial)
Ruby
2
star
36

test_default_url_options

testing default_url_options in Rails
Ruby
2
star
37

bouncy_air

Just. Fooling. Around
ActionScript
2
star
38

dm-elasticsearch

Ruby
2
star
39

pushr_notifiers

Example of notification classes for Pushr. Heavily inspired by Integrity
Ruby
2
star
40

pushr_test_app

Just testing something :)
Ruby
1
star
41

wikipedia_metal_umlaut

1
star
42

webexpo_demo_app

Demonstrační aplikace pro přednášku na konferenci Webexpo
Ruby
1
star
43

tire_facet_filter_problem

Ruby
1
star
44

karmi.github.com

1
star
45

slingshot

Ruby client for ElasticSearch
1
star