
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
= Kublog
Kublog is a simple yet complete way to have a Product Blog that integrates with your apps user base. It includes social sharing, atom feeds and moderated comments.
Built for Rails 3.1, Kublog is a complete stack, fully configurable solution.
Currently live for Rutanet[http://rutanet.com] on http://rutanet.com/blog and other products at Innku[http://innku.com].
== Features
== Kublog Basic Usage
Kublog is a mountable Engine that assumes you use the following tools for development:
In your Gemfile
gem 'kublog', '0.9.0'
Generate migrations and all the code you'll likely want to customize.
rails generate kublog:install
Run the migrations
rake db:migrate
Mount the engine on your routes
mount Kublog::Engine => "/blog(.:format)"
Include the author module under the model that will have access to create posts on the blog:
class User < ActiveRecord::Base include Kublog::Author end
Configure your blog's basic information on initializers/kublog.rb
Kublog.setup do |config| config.blog_name = 'Example blog' config.blog_description = 'Best blog ever' config.default_url_options = {:host => 'www.exampleblog.com'} end
Kublog uses I18n, the install generator will create the file locales/kublog/en.yml, make sure to add its content to your own en.yml file or add the following line on your application.rb also include the folders under locales:
config.i18n.load_path += Dir[File.join(Rails.root, 'config', 'locales', '**', '*.{rb,yml}')]
To get the most of Kublog you'll want to Integrate your Users, Add E-mail Notifications and Configure your Social Networks.
== Integrate your Users
The install generator will create the file controllers/kublog/application_controller.
On this file you will see the definitions of two empty methods current_user and is_admin?. Since Kublog is an isolated mountable Engine, you will need to define this methods, even if you have them on your apps application_controller.
After you finish, it might will look something like this:
def current_user
@current_user ||= User.find(session[:user_id])
end
def is_admin?
@current_user.admin?
end
It's important to know that if you're using Devise, you won't need a current_user method. If the model you're using is named something other than user, you can call the controller access method inside of current_user.
=== Author#to_s
I recommend you define a to_s method for your Author such as:
def to_s
"#{self.name} #{self.last_name}"
end
== Add E-mail Notifications
To add E-mail notifications, include the Kublog::Notifiable module into the user class that will be notified.
class User < ActiveRecord::Base
include Kublog::Notifiable
end
The E-mail from which they will receive the notification is configured in your kublog.rb initializer:
config.author_email "Kublog Test <test@kublog.com>"
You may also configure a block to specify that the user receives the notification from the author's E-mail:
config.author_email do |post|
post.user.email
end
=== Configure your social Networks
Configuring Twitter is pretty easy, you might want to create a twitter app on https://dev.twitter.com/
You will need to feed Kublog:
=== Sample twitter configuration on initializers/kublog.rb
config.twitter do |twitter|
twitter.consumer_key = 'your-consumer-key'
twitter.consumer_secret = 'your-consumer-secret'
twitter.oauth_token = 'your-oauth-token'
twitter.oauth_token_secret = 'your-consumer-secret'
end
Configuring Facebook Fan page posts is a little trickier, you will only need the access token for your Fan Page.
Find out how to get it here: https://github.com/innku/authorizefb
=== Sample Facebook configuration on initializers/kublog.rb
config.facebook_page_token = 'your-page-token'
== What's coming
If you wish to work on this. Fork it and pull request, please =)
== Check out the code
Kublog is made to be as simple as possible so you can modify fork it, modify it and reuse it. Please do.
FAQs
Unknown package
We found that kublog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.