gi-no / hanmoto

Public pages management with Asset Pipeline.

Home Page:https://rubygems.org/gems/hanmoto

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hanmoto

Public pages management with Asset Pipeline.

Inspired by gakubuchi.

Usage

In app/views/public_pages/404.html.haml:

- provide(:title, 'Not found')
%h1 Not found
%p This webpage is not found.
%p= link_to 'Home', root_path

In app/views/public_pages/500.html.haml:

- provide(:title, 'Server error')
%h1 Server error
%p This webpage is not working.

In app/views/public_pages/robots.text.erb:

<% unless Rails.env.production? %>
User-Agent: *
Disallow: /
<% end %>

In app/views/layout/public.html.haml:

!!!
%html
  %head
    %title #{yield(:title)} | MyAPP
    = stylesheet_link_tag 'application', media: 'all'
    = favicon_link_tag '/favicon.ico'
  %body
    = yield

Compile the templeate with:

rake assets:precompile

or

rake hanmoto:publish

This will generate public/404.html, public/500.html, and public/robots.txt.

Installation

Add this line to your application's Gemfile:

gem 'hanmoto'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hanmoto

Configuration

In config/initializers/hanmoto.rb, you can configure the following values.

Hanmoto.configure do |config|
#   config.view_dir = 'public_page'
#   config.layouts = {
#     html: 'public',
#   }
end

If you set ENV['DISABLE_HANMOTO_ON_PRECOMPILE'] ,you can disable auto execution of hanmoto:publish on assets:precompile.

export DISABLE_HANMOTO_ON_PRECOMPILE=1
# then disable auto execution of hanmoto:publish on assets:precompile task.

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

About

Public pages management with Asset Pipeline.

https://rubygems.org/gems/hanmoto

License:MIT License


Languages

Language:Ruby 91.9%Language:JavaScript 3.5%Language:CSS 2.3%Language:HTML 1.5%Language:Haml 0.7%