FAQ
This synergizes well with the gosu toolkit I announced earlier. This and
gosu are definitely alpha. I would like to create some "official" filters
like markdown, etc. Please provide ideas and help test.

Check it out http://github.com/mgutz/goa

See the filters package to see how simple it is to write a filter

import (
     "github.com/mgutz/goa"
     f "github.com/mgutz/goa/filter"
     "github.com/mgutz/gosu")
func Project(p *gosu.Project) {
     p.Task("default", []string{"add-headers", "bundle-scripts"})

     p.Task("add-headers", func() {
         pi := goa.NewPipeline()
         pi.Pipe(
             f.Load("test/**/*.txt"),
             f.AddHeader("COPYRIGHT\n"),
             f.ReplacePath("test", "dist"),
             f.Write(),
         ).Run()
     })

     p.Task("bundle-scripts", func() {
         pi := goa.NewPipeline()
         pi.Pipe(
             f.Load("test/**/*.js"),
             f.Cat(";", "dist/bundle.js"),
             f.AddHeader("COPYRIGHT\n"),
             f.Write(),
         ).Run()
     })}


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Matt Silverlock at Jul 7, 2014 at 6:41 am
    I'd love to see a filter that can version assets by calculating the SHA-1 hash, saving a copy of the file as <name>-<hash> and appending it to the filename in the href attribute too. i.e. point it at your CSS folder, your JS folder and your header template and let it get to work.

    Super useful for CSS & JS assets and better practice than using query strings (as some proxy implementations ignore them).

    (I may work on this myself when I get some time, but I'm putting the idea out there)

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mgutz at Jul 7, 2014 at 6:50 am
    I could do that but I suggest a different approach

    Create a folder structure like this

    public/
         {{version}}/ # yep curly braces
             css/
             jss/

    On release, replace {{version}} in all text files with the current version
    say "1.0.0". Serving is as simple as pointing to "public". This is designer
    friendly since they like to hard code paths in their mockups.
    On Sunday, July 6, 2014 11:41:53 PM UTC-7, Matt Silverlock wrote:

    I'd love to see a filter that can version assets by calculating the SHA-1
    hash, saving a copy of the file as <name>-<hash> and appending it to the
    filename in the href attribute too. i.e. point it at your CSS folder, your
    JS folder and your header template and let it get to work.

    Super useful for CSS & JS assets and better practice than using query
    strings (as some proxy implementations ignore them).

    (I may work on this myself when I get some time, but I'm putting the idea
    out there)
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJul 7, '14 at 6:20a
activeJul 7, '14 at 6:50a
posts3
users2
websitegolang.org

2 users in discussion

Mgutz: 2 posts Matt Silverlock: 1 post

People

Translate

site design / logo © 2022 Grokbase