Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cabin

Package Overview
Dependencies
Maintainers
3
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cabin

Static site generator scaffolding for grunt

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-28.66%
Maintainers
3
Weekly downloads
 
Created
Source

Cabin Beta

Cabin is a simple and extensible static site generator powered by Grunt.

NPM version
Dependency Status
Travis Status

Getting Started

First install cabin globally with the following command:

npm install -g cabin

You can then scaffold a static generator with the following command:

cabin new <destination folder> [user/repo]

The first parameter is the name of the destination folder, and the second is the GitHub username and repository name of a theme to use for the site. If the theme parameter is left blank, the default theme will be used.

After scaffolding a site generator, you can run it by entering the following command in the destination folder:

grunt

This will build your site, start a static file server, open a browser tab with the site's homepage, and start a watch process to rebuild your site when your source files change. Try editing or creating a new markdown file in the posts folder (if you are using the default theme) and upon save your site will be automatically rebuilt. Refresh the page to see the changes, if you'd like Livereload functionality, you can use the Livereload browser extensions.

Themes

Cabin themes provide styling and structure for your static site project. They work great out of the box and as starting points for more customized sites.

Avaliable Themes

colinwren/Candy

Blogging theme with Disqus for comments

colinwren/Blok

Colorful blogging theme

ChrisWren/icoDoc

Minimalist project documentation theme using icons in the navigation

Creating Themes

Configuration

The only file explicitly required is a cabin.json configuration in the root of the repo. This file describes what CSS preprocessors and template languages that your theme supports as well as the configuration for grunt-pages. We currently support EJS and Jade templates and the Sass and LESS style languages.

Here is an example cabin.json file which states that the project supports Sass, Jade, and has the specified config for the grunt-pages task:

{
  "style": [
    "Sass"
  ],
  "template": [
    "Jade"
  ],
  "gruntPages": {
    "posts": {
      "src": "posts",
      "dest": "dist",
      "layout": "src/layouts/post.jade",
      "url": "blog/posts/:title"
    }
  }
}

Note: the configuration of the cabin.json must have dist as the destination folder and the theme files must match the folder structure described below.

Theme file locations

Your theme must conform to the following folder structure in order to work with the Gruntfile that Cabin generates.

├── README.md
├── cabin.json
├── posts
│   └── Sample posts
├── site
│   └── Generated site files
└── src
    ├── images
    │   └── Theme image files
    ├── layouts
    │   └── Theme layout templates
    ├── pages
    │   └── Theme page templates
    └── styles
        └── Theme stylesheets

The best way to learn about how to develop a theme is by referencing the default theme.

Changelog

0.1.2 - The Gruntfile now copies fonts from the src/styles/fonts folder.

0.1.1 - The Gruntfile now copies fonts from the src/styles/fonts folder.

0.1.0 - grunt server is now the default task. The Gruntfile template now copys images, vanilla css, and scripts and no longer copies .ico and .htaccess files.

0.0.2 - Use git clone instead of downloading theme zips from GitHub repos.

0.0.1 - Only copy specified file extensions from themes.

0.0.0 - Initial push.

FAQs

Package last updated on 06 Jul 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc