Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
/ hanmoto Public archive
forked from aki77/hanmoto

Public pages management with Asset Pipeline.

License

Notifications You must be signed in to change notification settings

gi-no/hanmoto

 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 92.0%
  • JavaScript 3.5%
  • CSS 2.3%
  • HTML 1.5%
  • Haml 0.7%