Code Monkey home page Code Monkey logo

ssi's Introduction

Server Side Includes Script

This script will read HTML files and interpolate the server-side include statements. This was created so that web sites that are almost completely static can have their includes processed before being uploaded to a static site service like Amazon's S3.

Information about server-side includes can be found at the httpd or nginx website. The only SSI command supported at this time is include.

The processing is recursive so please avoid circular includes.

The work was inspired by the rbssi script.

Installation

  • gem install ssi

Usage

See the help message for the options:

# /usr/bin/ssi --help

If the inplace option is not specified, the resultant content will be printed to standard out as a preview. No files are altered in this mode.

We will usually modify the files inplace. This will be done like so:

# /usr/bin/ssi -i 'orig' file1 file2

This will modify file1 and file2 after making a backup of each file with the .orig extension. Use the empty string '' if you do not want to make backups. CAUTION: The inplace option will overwrite the backup if run consecutively!

When processing the server-side includes for a many files under the current directory, I use a combination of find and xargs:

# find . -type f -name "*html" -print0 | xargs -0 /usr/bin/ssi -i ''

To Do

  • Tests

Bugs

  • This gem was not thoroughly tested. More testing is in progress.

Found a bug?

Contact

  • Mail

    bwong114 [at] gmail.com

ssi's People

Stargazers

Sergey Ponomarev avatar Kota Fujiwara avatar

Watchers

Fup Duck avatar James Cloos avatar

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.