Git Product home page Git Product logo

smallcage's Introduction

SmallCage – a simple website generator

<img src=“https://travis-ci.org/saito/smallcage.png” alt=“Build Status” />

SmallCage is a simple, but powerful website generator. It converts content and template files, which has common elements in a website, to a plain, static website. No database, no application container, and no repeat in many pages is needed. You can keep your site well with very little work.

With SmallCage, you can

  • simply separate your template from content.

  • convert your content to a plain, static website. It’s easy to serve and test.

  • generate multi pages from a single CSV file or even Google Docs spreadsheet.

  • share your template with various web applications: Ruby on Rails, WordPress, and MovableType.

  • manage your website with a source code management system like a Git, Subversion, and CVS.

  • customize the rules of convert with Ruby.

Please visit our wiki for more detailed discussion.

Installation

$ sudo gem install smallcage

Usage

If successfully installed, smc command will be available.

$ smc
Usage: smc <subcommand> [options]
SmallCage 0.1.9 - a simple website generator
Subcommands are:
    update [path]                    Build smc contents.
    clean  [path]                    Remove files generated from *.smc source.
    server [path] [port]             Start HTTP server.
    auto   [path] [port]             Start auto update server.
    import [name|uri]                Import project.
    export [path] [outputpath]       Export project.
    uri    [path]                    Print URIs.
    manifest [path]                  Generate Manifest.html file.

Options are:

    -h, --help                       Show this help message.
    -v, --version                    Show version info.

Create document root.

$ mkdir htdocs
$ cd htdocs

Import default project.

$ smc import
Import: base
Create:
  /_smc
  /_smc/helpers
  /_smc/helpers/base_helper.rb
  /_smc/helpers/site_helper.rb
  /_smc/templates
  /_smc/templates/default.rhtml
  /_smc/templates/footer.rhtml
  /_smc/templates/header.rhtml

Import these files?[Yn]: y
A /_smc
A /_smc/helpers
A /_smc/helpers/base_helper.rb
A /_smc/helpers/site_helper.rb
A /_smc/templates
A /_smc/templates/default.rhtml
A /_smc/templates/footer.rhtml
A /_smc/templates/header.rhtml
:

Publish all smc files.

$ smc update
A /index.html
A /sample/index.html
A /sample/redirect.html
A /sample/sub/contents.html
A /sample/sub/index.html

Start HTTP server.

$ smc server . 8080

…and access localhost:8080

smallcage's People

Contributors

koseki avatar kosudahidemori avatar saito avatar

Stargazers

Arthur Dayne avatar Taro Hanamura avatar Angus H. avatar Shunya Hagiwara avatar otsuka avatar contexart avatar  avatar SATO Akihiro avatar Bluemark avatar  avatar

Watchers

 avatar Bluemark avatar SATO Akihiro avatar  avatar

smallcage's Issues

add uri command

$ smc uri

prints URI list of publish files.

This command is useful for confirming output of URI templates.

Cannot execute smc command on ruby 2.7.2

$ ~/.rvm/bin/rvm 2.7.2 do smc up
Traceback (most recent call last):
        8: from /home/bonchi/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:24:in `<main>'
        7: from /home/bonchi/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:24:in `eval'
        6: from /home/bonchi/.rvm/gems/ruby-2.7.2/bin/smc:23:in `<main>'
        5: from /home/bonchi/.rvm/gems/ruby-2.7.2/bin/smc:23:in `load'
        4: from /home/bonchi/.rvm/gems/ruby-2.7.2/gems/smallcage-0.2.8/bin/smc:6:in `<top (required)>'
        3: from /home/bonchi/.rvm/gems/ruby-2.7.2/gems/smallcage-0.2.8/bin/smc:6:in `require'
        2: from /home/bonchi/.rvm/gems/ruby-2.7.2/gems/smallcage-0.2.8/lib/smallcage.rb:23:in `<top (required)>'
        1: from /home/bonchi/.rvm/gems/ruby-2.7.2/gems/smallcage-0.2.8/lib/smallcage.rb:23:in `require'
	/home/bonchi/.rvm/gems/ruby-2.7.2/gems/smallcage-0.2.8/lib/smallcage/loader.rb:1:in `<top (required)>': uninitialized constant Syck::ENGINE (NameError)

Add local configuration file.

If you want to create site-wide configuration and it can be committed, you can use /_dir.smc file.But sometimes, local machine configuration is needed.

  • Move between HTTP/HTTPS at live server, but not at local machine.
  • Link of external application with subdomain.
  • Path of external tools.
  • etc.

Local config file will be merged with root directory object(_dir.smc). The config file path will be:

  • /_smc/localconf.yml
  • /_smc/local.smc
  • /_smc/_dir.smc

.smc? .yml? Overwrite only root directory config?

common prefix directory bug

When there are files like below,

  • ./a/index.html.smc
  • ./ab/index.html.smc
  • ./abc/index.html.smc

$ smc update

A /a/index.html
A /ab/index.html
A /abc/index.html

This is OK. Then, update only ./a/ directory.

$ smc update ./a/

U /a/index.html
D /ab/index.html
D /abc/index.html

The last 2 files should not be changed. It has nothing to do with current update(smc update a).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.