Comments (7)
what are the other steps for trigger on build
? just curious to try and understand the use case better
from metalsmith.
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.
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.
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.
@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.
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.
+1 to @treygriffith here, closing for now
from metalsmith.
Related Issues (20)
- Perf + bugfix: utf8 buffer check enhancement HOT 1
- CLI: add mechanism to pass callbacks as plugin options through metalsmith.json HOT 1
- Maintainer application HOT 1
- Amplify Build Error when trying to execute metalsmith-migrated-plugins.js HOT 6
- "TypeError: gen.next is not a function" - Metalsmith 2.5.0 HOT 5
- error HOT 1
- drag and drop theme builder HOT 4
- Add Metalsmith.watch method?
- CLI - init command HOT 1
- MS files should not depend on Object prototype
- Debug not working as expected? HOT 2
- Don't crash on broken symlinks that are ignored HOT 4
- Proposal for metalsmith.get/set() helpers HOT 1
- Metalsmith 2.6 Roadmap HOT 3
- Ordinary html file not recognized as utf-8 encoded, stopping gray-matter to parse YAML HOT 3
- Launch procedure to deprecate @types/metalsmith HOT 2
- Build callback not fired with `watch()` + async plugins HOT 13
- Feature: add encoding: utf-8 property to `File` HOT 1
- Feature: provide metalsmith.on('built')
- Unhandled rejection when using callbacks (i.e. with `.watch(spec)`) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metalsmith.