GithubHelp home page GithubHelp logo

codeigniter-assets's Introduction

jackboberg

Print up to date contact information

Usage

npx jackboberg

Background

Inspired by johnkpaul and searls, but this approach does not require installing a global module, and it will always be up to date. It pretty prints by default, and outputs JSON if specified.

npx jackboberg -j
npx jackboberg --json

codeigniter-assets's People

Contributors

apcomplete avatar jackboberg avatar leekung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter-assets's Issues

Unable to gzip compress cached css/js

I can't seem to gzip compress the cached css/js files that are generated.

They have the correct Content-Type but they just won't respond. Any idea how to remedy this?

I am using the following in my .htaccess:

# ----------------------------------------------------------------------
# Gzip compression
# ----------------------------------------------------------------------

<IfModule mod_deflate.c>

  # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
  <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
      SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
      RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    </IfModule>
  </IfModule>

  # Compress all output labeled with one of the following MIME-types
  <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/atom+xml \
                                  application/javascript \
                                  application/json \
                                  application/rss+xml \
                                  application/vnd.ms-fontobject \
                                  application/x-font-ttf \
                                  application/xhtml+xml \
                                  application/xml \
                                  font/opentype \
                                  image/svg+xml \
                                  image/x-icon \
                                  text/css \
                                  text/html \
                                  text/plain \
                                  text/x-component \
                                  text/xml
  </IfModule>

</IfModule>

is config/assets.php used?

take a brief look on the source code, it seems we have to pass config param each time we are going to use the library. is it correct? can we put all the config on config/assets.php, so doesnt need to define config param each time we're going to use the library?

thx

Cache file is empty, url not contains path to scripts and css files

Code from my header view:

load->helper('assets'); $assets = array( 'main.css', 'theme/theme_style.css', ); add_assets($assets); echo get_assets(); ?>

it dishaply:

----------------- My directories structure: --------------- application public_html ...|_assets .......|_cache/604016905a30921163fced20a4d75f87.css --cache file forever is empty !!! .......|_css/main.css, ............|_theme/theme_style.css system etc.. ------------------------ my config: --------------------------- $config['script_dirs'] = array('js/'); $config['style_dirs'] = array('css/'); $config['cache_dir'] = 'assets/cache/'; $config['combine_css'] = TRUE; $config['minify_css'] = TRUE; $config['combine_js'] = TRUE; $config['minify_js'] = TRUE; $config['auto_update'] = TRUE; $config['static_cache'] = FALSE;

Minify doesn't work.

First of all, thanks for the library.

I've got this config.php:

$config['script_dirs'] = array('assets/script/');

$config['style_dirs'] = array('assets/style/');

$config['cache_dir'] = 'assets/cache/';

$config['combine_css'] = TRUE;

$config['minify_css'] = TRUE;

$config['combine_js'] = TRUE;

$config['minify_js'] = TRUE;

$config['auto_update'] = FALSE;

$config['static_cache'] = TRUE;

controllers/home.php

class Home extends CI_Controller {

    public function index()
    {
        $this->load->library('assets');

        $this->load->helper('assets');

        $this->assets->add('common/app.css');
    }
}

Folder structure:

application/
assets/styles/cache/
assets/styles/common/app.css
system/
index.php

app.css:

@charset 'UTF-8';

* {
    outline: 0 !important;
}

html, body {
    width: 100%;
    height: 100%;
}

On cache folder, now I've got those files:

main.min.css
store.json

and the content of main.min.css, is the same of the original. Why? I don't understand this…

PS: sorry for my english.

Problem if there is 'url_suffix' in the config

Hi,

Thanks for your lib, I'm just trying now but it seems to be the one ;-)

In my CI config file I got an "url_suffix" which is '.html'
and the link generated is like ".css.html" so I've just modified the line 737 (assets library file) to fix that.

-- $url = site_url($dir . $path);
++ $url = base_url($dir . $path);

Hope that helps

Vinz

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.