All Projects â†’ yasaichi â†’ gakubuchi

yasaichi / gakubuchi

Licence: MIT License
📄 Static pages management with Asset Pipeline

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to gakubuchi

core
🔥 Antares Core Implemenation. Most important project layer, this is the heart for your app. ACL, notifiter, console, geoip, areas, utils and many more...
Stars: ✭ 24 (-47.83%)
Mutual labels:  asset-pipeline
sprockets-standalone
Rack task library for using Sprockets standalone.
Stars: ✭ 15 (-67.39%)
Mutual labels:  asset-pipeline
sprockets-bumble d
Sprockets plugin to transpile modern javascript using Babel, useful while migrating to ES6 modules
Stars: ✭ 32 (-30.43%)
Mutual labels:  asset-pipeline
Ramses
The Rx Asset Management System for motion picture production
Stars: ✭ 48 (+4.35%)
Mutual labels:  asset-pipeline
OpenAssetIO
An open-source interoperability standard for tools and content management systems used in media production.
Stars: ✭ 140 (+204.35%)
Mutual labels:  asset-pipeline
Sprockets-PHP
Sprockets for PHP
Stars: ✭ 50 (+8.7%)
Mutual labels:  asset-pipeline
socket.io-rails
Rails asset pipeline wrapper for socket.io
Stars: ✭ 57 (+23.91%)
Mutual labels:  asset-pipeline
phoenix assets webpack
Asset Pipeline with Webpack on Phoenix
Stars: ✭ 52 (+13.04%)
Mutual labels:  asset-pipeline
Assimp
The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.
Stars: ✭ 7,309 (+15789.13%)
Mutual labels:  asset-pipeline
Blendid
A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
Stars: ✭ 5,026 (+10826.09%)
Mutual labels:  asset-pipeline
TACTIC-Handler
PySide based TACTIC client for maya, nuke, 3dsmax, houdini, etc
Stars: ✭ 67 (+45.65%)
Mutual labels:  asset-pipeline
pwdcalc
Take no risk and help your users to choose good passwords!
Stars: ✭ 11 (-76.09%)
Mutual labels:  asset-pipeline
webpack-asset-pipeline
🚀 A missing link for the asset pipeline alternative with Webpack.
Stars: ✭ 31 (-32.61%)
Mutual labels:  asset-pipeline

Gakubuchi

Gem Version Build Status Code Climate Test Coverage

Gakubuchi provides a simple way to manage static pages (e.g. error pages) with Asset Pipeline.

Installation

Put this in your Gemfile:

gem 'gakubuchi'

Run the installation generator with:

rails g gakubuchi:install

Or specify the name of directory for static pages:

rails g gakubuchi:install -d html

They will install the initializer into config/initializers/gakubuchi.rb and create the directory in app/assets.
If you don't specify the -d option, templates will be used as default.

Usage

In app/assets/templates/404.html.slim:

doctype html
html
  head
    title The page you were looking for doesn't exist (404)
    meta name='viewport' content='width=device-width,initial-scale=1'
    = stylesheet_link_tag 'application', media: 'all'
  body
    .dialog
      div
        h1 The page you were looking for doesn't exist.
        p You may have mistyped the address or the page may have moved.
      p If you are the application owner check the logs for more information.

Open the following URL in your browser to check the templeate:

http://localhost:3000/assets/404.html

Compile the templeate with:

rails assets:precompile

This will generate public/404.html.

Template engines

Gakubuchi supports some template engines: ERB, Haml and Slim.
When you want to use Haml or Slim, you need to put them in your Gemfile:

# Use Haml
gem 'haml'

# Use Slim
gem 'slim'

Using assets

Gakubuchi enables you to use assets (e.g. CSS or JavaScript files) in static pages.
Note that you may need to add them to the precompile array in config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w(error.css error.js)

Using helpers

You can also use helpers provided by Sprockets::Rails::Helper in static pages.
Examples of them are given below.

  • asset_path
  • content_tag
  • favicon_link_tag
  • image_tag
  • javascript_include_tag

If you want to get the list of all available helpers, please execute the following code.

Sprockets::Rails::Helper.instance_methods

Configuration

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

leave_digest_named_templates # false by default
template_directory           # 'templates' by default

Contributing

You should follow the steps below.

  1. Fork the repository
  2. Create a feature branch: git checkout -b add-new-feature
  3. Commit your changes: git commit -am 'Add new feature'
  4. Push the branch: git push origin add-new-feature
  5. Send us a pull request

We use Appraisal to test with different combinations of sprockets and sprockets-rails.

bundle install
appraisal install

# Run RSpec with a specific combination
appraisal 'sprockets-rails 3 with sprockets 4' rspec

# Run RSpec with all combinations
appraisal rspec

License

MIT License. Copyright 2015 Yuichi Goto.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].