Code Monkey home page Code Monkey logo

assets's Introduction

Assets

Assets provides asset compilation, concatenation and fingerprinting. Asset details are stored in a file at secrets/assets.json by default.

Usage

Use the assets package to organize assets however you like within your src folder, and output them in compressed form in your public/assets folder when you come to deploy your app.

  // Load asset details from json file on each run
  err := appAssets.Load()
  if err != nil {
    // If no assets loaded, compile for the first time (produces files in public/assets)
    err := appAssets.Compile("src", "public")
    if err != nil {
      server.Fatalf("#error compiling assets %s", err)
    }
  }

// Use the asset helpers to generate fingerprinted assets (either one fingerprinted file in production or a list of all files in development) - this is similar to the Rails asset pipeline.

  view.Helpers["style"] = appAssets.StyleLink
  view.Helpers["script"] = appAssets.ScriptLink

assets's People

Contributors

kennygrant avatar

Stargazers

 avatar  avatar Tor avatar Abishek Muthian avatar zbv avatar Matt Ma avatar  avatar Thomas Boerger avatar  avatar Torsten Curdt avatar Damon Zhao avatar Aaron avatar Morgan avatar Qasim Zaidi avatar Alan Grosskurth avatar

Watchers

 avatar James Cloos avatar  avatar Abishek Muthian avatar

assets's Issues

Resize image assets

Image assets should perhaps be copied into public, and resized for use on a website. At present I just leave them in public instead as static images.

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.