Skip to content

用于以简化的语法在 Rails 工程中迅速编写 layout,省去一些冗余的代码。目前用于 eshare 项目中。

Notifications You must be signed in to change notification settings

mindpin/simple-page-layout

Repository files navigation

simple-page-layout

layouts made easy for rails 3

Build Status Gem Version Code Climate

dependencies

  • haml

Usage

include in Gemfile:

gem 'simple-navbar'

in your layout file:

-# in file views/layouts/my_layout.html.haml

!!!
- simple_page_layout 'My Site', :html_lang => :zh do
  -# your code here like:
  .page-content
    yield

and then in a view of this layout:

- page_title 'page title'

.foo bar

you will get:

<!DOCTYPE html>
<html lang='zh'>
  <head>
    <title>My Site | page title</title>
    <meta content="authenticity_token" name="csrf-param" />
    <meta content="Gf5GH0+iJtxdjZyNo+3qMV+1DqO9v8/jAHmV/Bq5Eis=" name="csrf-token" />
    <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <!-- your code here -->
    <div class="foo">
      bar
    </div>
    
    <script src="/assets/jquery.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
    <script src="/assets/application.js?body=1" type="text/javascript"></script>
  </body>
</html>

About

用于以简化的语法在 Rails 工程中迅速编写 layout,省去一些冗余的代码。目前用于 eshare 项目中。

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages