Giter VIP home page Giter VIP logo

readably's Introduction

Readably: YAML + Slim => HTML5

                   _____
                  (, /   )          /)     /)  /)
                    /__ /  _  _   _(/ _   (/_ //
                 ) /   \__(/_(_(_(_(_(_(_/_) (/_ (_/_
                (_/                             .-/
                                               (_/

Readably is a minimal static blog engine that emits clean, readable Web pages. You can view them locally on your own computer without needing a Web server. And when you publish them to any Web server, they will function just as they did locally on your computer. This is the benefit of a static blog engine!

See my blog at http://sunaku.github.io for an example of Readably output.


Features

  • Its output is easy to read and beautiful to print in modern Web browsers.

  • Its output is self-explanatory and multi-lingual: no translation needed. (There is only 1 English phrase in the entire output, for attribution.)

  • It has simple navigation that works well in both text-mode Web browsers (such as Lynx, elinks, and w3m) and modern Web browsers (like Firefox).

  • It supports the two most popular JavaScript-based blog comment services: Disqus and IntenseDebate.

  • It supports automatic syntax highlighting of code blocks in Markdown.

  • It is implemented in less than 200 lines of pure Ruby code! :-)


Prerequisites


Installing

Setup:

git clone https://github.com/sunaku/readably.git
cd readably
bundle install # with markdown OR
bundle install --without markdown

Demo:

bundle exec rake
firefox content/index.html

Configuring

  • Edit the config.yaml and template/* files to your liking.

  • Edit the Rakefile to configure the blog processing logic. (This isn't really necessary, but you are free to do so.)


Running

NOTE: If you are using Ruby 1.8.7, add -rubygems to the following commands.

Run bundle exec rake --tasks to see available commands:

bundle exec rake preview  # Live blog preview at http://localhost:35729/.

bundle exec rake build    # Build entire blog.
bundle exec rake entry    # Build entry pages.
bundle exec rake index    # Build index pages.
bundle exec rake style    # Build stylesheet.

bundle exec rake clean    # Remove any temporary products.
bundle exec rake clobber  # Remove any generated file.

bundle exec rake upgrade  # Upgrade blog software.

Blogging

To create a new blog entry (*.readably file) from the template:

cp content/entry.readably content/your-entry-file-name.readably
edit content/your-entry-file-name.readably

To create a new blog entry (*.readably file) in a nested directory:

cp content/entry.readably content/your/path/your-entry-file-name.readably
edit content/your/path/your-entry-file-name.readably

Previewing

Run bundle exec rake preview to launch a local live preview of your blog at http://localhost:35729/ which auto-updates when you modify your blog entries.

Alternatively, you can manually preview your blog entries as follows. First, open the content/index.html file in your Web browser. Then, whenever you modify your blog sources, run bundle exec rake and refresh your Web browser.


Publishing

Use your favorite file uploading software to upload the content/ directory (while omitting *.readably files from it) to your web hosting platform.

Here is an example that uses rsync to upload to a DESTINATION. (NOTE: the trailing slash after DESTINATION is necessary!)

rsync -auv content/ --exclude '*.readably' DESTINATION/

You can take this further and make it a Rake task by adding it to Rakefile:

desc 'Publish your blog.'
task :publish => :build do
  sh "rsync -auv content/ --exclude '*.readably' DESTINATION/"
end

From then onwards, you can publish your blog at any time, simply by running:

bundle exec rake publish

Upgrading

To upgrade your copy of Readably, run the following command:

bundle exec rake upgrade

Contributing

Fork this project on GitHub and send pull requests.


Bugs, Features, Issues, Questions

File a report on the issue tracker.


License

Like my work? ๐Ÿ‘ Please spare a life today as thanks! :cow::pig::chicken::fish::speak_no_evil::v::revolving_hearts:

Copyright 2010 Suraj N. Kurapati https://github.com/sunaku

Distributed under the terms of the ISC license (see the LICENSE file).

readably's People

Contributors

dependabot[bot] avatar iirelu avatar sunaku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

isvicy

readably's Issues

Leaving published_url in config.yaml blank causes Rake to fail

Full stack trace:

undefined method `sub' for nil:NilClass
template/index.html.slim:20:in `block in singletonclass'
template/index.html.slim:65534:in `instance_eval'
template/index.html.slim:65534:in `singletonclass'
template/index.html.slim:65532:in `__tilt_24730160'
/var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/var/lib/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/iirelu/source/readably/Rakefile:155:in `render_slim_file'
/home/iirelu/source/readably/Rakefile:192:in `block in render_slim_template_task'
/home/iirelu/source/readably/Rakefile:182:in `block in render_template_task'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:207:in `block (2 levels) in invoke_prerequisites_concurrently'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/promise.rb:63:in `call'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/promise.rb:63:in `chore'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/promise.rb:45:in `work'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/thread_pool.rb:105:in `process_queue_item'
/var/lib/gems/1.9.1/gems/rake-10.1.0/lib/rake/thread_pool.rb:119:in `block (2 levels) in start_thread'
Tasks: TOP => default => build => index => content/index.html

html entity unescaping

Hello Sunaku,

I have read that HTMLEntities can take care of this. The ndash in the footer template needs to be unescaped.

I really like the idea of being able to update a post. AFAIK yours is the only blog engine that has this feature. I'm using it to provide mpg updates for my car. I have a awk/shell script that calculates the mpg every time I add a data row and outputs a fresh .readably file with a new update.

If I had more ruby experience I would work on making the tags click through to tag pages.

Cheers,
Rich

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.