Coder Social home page Coder Social logo

Deploy Plugins about metalsmith HOT 7 CLOSED

metalsmith avatar metalsmith commented on May 21, 2024
Deploy Plugins

from metalsmith.

Comments (7)

ianstormtaylor avatar ianstormtaylor commented on May 21, 2024

what are the other steps for trigger on build? just curious to try and understand the use case better

from metalsmith.

esundahl avatar esundahl commented on May 21, 2024

Well initially I was thinking of a plugin that uploaded the destination directory to an S3 bucket after completion. After some thought though I realized it would probably be better to keep that functionality separate.

from metalsmith.

 avatar commented on May 21, 2024

I agree with esundal. Every site needs deploying if it is not generated on the server side.

Write configuration like this:

{
  build: "github-or-others"
}

And the callback function of build method needs some changes:

// from modules, here just for simplicity
function github-or-others () {
  return function (err, metalsmith, files) {
    // let `this` be metalsmith?
  }
}

//site.build(github-or-others());

For the example above, I recommend setting this to metalsmith for the ease of use, too.

from metalsmith.

christophercliff avatar christophercliff commented on May 21, 2024

For deploying to S3, you guys might be interested in http://caisson.co/. I'm working on an update to make it more flexible with an API similar to Metalsmith: https://github.com/christophercliff/caisson/tree/pluggable

If you just want to push to Github pages, an npm script can do the job: https://github.com/christophercliff/christophercliff.github.com/blob/supermaster/package.json#L10

from metalsmith.

derekconjar avatar derekconjar commented on May 21, 2024

@christophercliff Thanks for sharing.

I'm trying to piece together an easy way to deploy many static sites to s3 at once and automatically set up the CloudFront distrubutions and Route53 zones when they don't exist. Looks like caisson will make that process much simpler.

from metalsmith.

treygriffith avatar treygriffith commented on May 21, 2024

Metalsmith already has a really good event for built - the callback. Since metalsmith is all about building, having a deploy module as metalsmith middleware doesn't give you any benefit that I can think of - you already get access to the file buffers as well as the directory it was written to.

You may want to look into https://www.npmjs.org/package/bucketful . It's a dumb uploader, so it doesn't delete existing files except for overwrites, and doesn't compare ETags before uploading - but it does everything you need to create a static s3 website deployment. It's worked well for me so far.

from metalsmith.

ianstormtaylor avatar ianstormtaylor commented on May 21, 2024

+1 to @treygriffith here, closing for now

from metalsmith.

Related Issues (20)

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.