GithubHelp home page GithubHelp logo

wellercs / quickconcat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from filamentgroup/quickconcat

0.0 2.0 0.0 125 KB

a simple dynamic concatenator for html, css, and js files, written in php

License: Other

ColdFusion 38.80% PHP 55.89% CSS 4.73% JavaScript 0.57%

quickconcat's Introduction

quickconcat

a simple dynamic concatenator for html, css, and js files, written in PHP

  • Copyright 2012, Scott Jehl, Filament Group, Inc.
  • Dual licensed under MIT and GPLv3

concat.php accepts 2 query strings:

	* files (required): a comma-separated list of root-relative file paths
	* wrap (optional): Enclose each result in an element node with url attribute? False by default.

Build Status

Example CSS url:

quickconcat.php?files=css/a.css,css/b.css,css/c.css

Example JS url:

quickconcat.php?files=js/a.js,js/b.js,js/c.js

Example HTML url:

quickconcat.php?files=a.html,b.html,c.html

Example HTML url with wrapped entries:

quickconcat.php?files=a.html,b.html,c.html&wrap

Note that when wrap is passed, like above, each file will be wrapped in a entry element with a url attribute corresponding to the URL from which the content was included. For example:

<entry url="a.html">...content from file a here...</entry><entry url="b.html">...content from file b here...</entry><entry url="c.html">...content from file c here...</entry>

optional .htaccess ideas

To clean up your file paths, gzip output, and more, you might consider incorporating some server rewrites via Apache .htaccess or otherwise. Here's an example that allows for cleaner urls and zipped output:

# Cleaner URLs for quickconcat.php
# this allows for urls like this: "/path/to/file.html,path/to/fileb.html=concat"
# or wrapped, "/path/to/file.html,path/to/fileb.html=concat&wrap"
RewriteEngine On
RewriteRule ^([^\?]+)=concat(&wrap)?$ quickconcat.php?files=$1$2

# compress transfer
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/javascript
</IfModule>

With the above dropped into your .htaccess file, you can concatenate files like this: /path/to/file.html,path/to/fileb.html=concat or like this (if you want to add wrappers) /path/to/file.html,path/to/fileb.html=concat&wrap

quickconcat's People

Contributors

jefflembeck avatar jeffsebring avatar staabm avatar wellercs avatar zachleat avatar

Watchers

 avatar  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.