Project

kblog

0.0
No commit activity in last 3 years
No release in over 3 years
Kblog is a very simplistic and lightweight mountable blog-engine for rails provides simple helper in your views.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.2.0
>= 0
 Project Readme

Kblog¶ ↑

Simple blog-engine for rails. Authentication can be done either role-based or via http-basic-auth. No specific authentication-framework needed. No relation to author present.

installation¶ ↑

  • gem install kblog

  • rake kblog:migrations:install

  • rake db:migrate

  • rails g kblog # creates kblog_init.rb in config/initializers

  • add the engine to route.rb:

# routes.rb mount Kblog::Engine => “/kblog”

  • perhaps add provided css to your layoutfile:

<%= stylesheet_link_tag ‘kblog/articles’, :media => “all” %>

adopt config/initializer/kblog_init.rb:

role-based authentication:: role-based rights to create/alter blog-articles user_class must respond_to :roles - and each roles string representation role.to_s == Kblog.auth_role expects current_user beeing available in views and controller

# config/initializer/kblog_init.rb Kblog.auth_type = ‘role’ Kblog.auth_role = ‘blogger’ # role needed to alter blogs

basic-auth:: makes use of simple http-basic auth. configure with desired name/passwword # config/initializer/kblog_init.rb Kblog.auth_type == ‘basic’ Kblog.authname = ‘blogger’ Kblog.authpassword = ‘changeme’

usage¶ ↑

  • add helper

use it for displaying <num> articles. if argument <truncate> is greater than 0 - blog-text will be truncated after <truncate> chars

<%= display_latest_articles(num,truncate=0) %>

to your views

  • if mounted to /kblog visit index: /kblog/articles -