pandastrike / haiku9 Goto Github PK
View Code? Open in Web Editor NEWStatic Site Publishing
License: ISC License
Static Site Publishing
License: ISC License
It's possible for a file in a repo to change content type without changing anything within (which is detected by the md5 hash). Add a check for content type in the sync.
In work on ps.com, it appears fonts are being served as html/text
, when it should be application/font-woff
.
Maybe we can have an alternative attribute named coverage
or something like that, with values like global
or regional
. Alternatively, we can just default it, which I think we do already.
I forgot to add this. We can use the path, the key, and the format to figure out what to render. These are all already asset properties.
I used to be a big fan of this idea, where you establish a pipeline via filenames. So:
foo.html.jade
would generate foo.html
.
images, pass through assets, blog pagination, browserify bundles…
We should avoid readFile when a template is already cached.
Also, check if marked and stylus support caching; if not, implement our own caching.
Even though Jade implements caching, its simplistic. haiku9 should implement LRU caching of compiled functions.
Currently, objects within an S3 bucket must be less than 5GB in size. If you attempt to upload a bigger file, the AWS SDK automatically splits it into chunks that get stored as separate objects. This complicates both static website delivery and MD5 integrity checks during S3 sync.
Currently, H9 takes no steps to handle this edge case. Should we acknowledge that files that large are unlikely to be used and disallow them? Or should we accommodate them?
> [email protected] test /vagrant/haiku9
> coffee test/index.coffee
Haiku9 static-site generation
Compile Stylus files AssertionError: File site.css not built
Haiku9 static-site generation
Passes through json files AssertionError: File manifest.json not built
Haiku9 static-site generation
Compiles Jade files AssertionError: File index.html not built
Haiku9 static-site generation
Compiles CoffeeScript files AssertionError: File site.js not built
Haiku9 serve task
Starts a local server on the default port AssertionError: Server did not respond
Haiku9 static-site generation
Passes through xml files AssertionError: File browserconfig.xml not built
Beginning task 'build'...
Beginning task 'survey'...
Beginning task 'survey/pass-thru'...
Beginning task 'build'...
Beginning task 'survey'...
Beginning task 'survey/pass-thru'...
Task 'survey/pass-thru' completed in 394ms.
Beginning task 'build'...
Beginning task 'survey/image'...
Beginning task 'survey'...
Beginning task 'survey/pass-thru'...
Task 'survey/image' completed in 6ms.
Beginning task 'survey/stylus'...
Task 'survey/stylus' completed in 5ms.
Beginning task 'survey/jade'...
Beginning task 'data'...
Task 'data' completed in 32ms.
Task 'survey/jade' completed in 40ms.
Beginning task 'survey/coffee'...
Task 'survey/coffee' completed in 3ms.
Beginning task 'survey/markdown'...
Beginning task 'build'...
Task 'survey/markdown' completed in 2ms.
Beginning task 'survey'...
Beginning task 'survey/posts'...
Beginning task 'survey/pass-thru'...
Task 'survey/posts' completed in 1ms.
Beginning task 'survey/bundle'...
Task 'survey/bundle' completed in 5ms.
Task 'survey' completed in 465ms.
Task 'build' completed in 484ms.
Task 'survey/pass-thru' completed in 182ms.
Beginning task 'survey/image'...
Task 'survey/image' completed in 8ms.
Beginning task 'survey/stylus'...
Task 'survey/stylus' completed in 2ms.
Beginning task 'survey/jade'...
Beginning task 'data'...
Beginning task 'build'...
Beginning task 'survey'...
Beginning task 'survey/pass-thru'...
Task 'data' completed in 14ms.
Task 'survey/jade' completed in 15ms.
Beginning task 'survey/coffee'...
Task 'survey/coffee' completed in 1ms.
Beginning task 'survey/markdown'...
Task 'survey/markdown' completed in 1ms.
Beginning task 'survey/posts'...
Task 'survey/posts' completed in 1ms.
Beginning task 'survey/bundle'...
Task 'survey/bundle' completed in 7ms.
Task 'survey' completed in 218ms.
Task 'build' completed in 229ms.
Task 'survey/pass-thru' completed in 200ms.
Beginning task 'survey/image'...
Task 'survey/image' completed in 6ms.
Beginning task 'survey/stylus'...
Task 'survey/stylus' completed in 2ms.
Beginning task 'survey/jade'...
Beginning task 'data'...
Task 'data' completed in 10ms.
Task 'survey/jade' completed in 13ms.
Beginning task 'survey/coffee'...
Task 'survey/coffee' completed in 1ms.
Beginning task 'survey/markdown'...
Task 'survey/markdown' completed in 1ms.
Beginning task 'survey/posts'...
Task 'survey/posts' completed in 1ms.
Beginning task 'survey/bundle'...
Task 'survey/bundle' completed in 2ms.
Task 'survey' completed in 228ms.
Task 'build' completed in 237ms.
Task 'survey/pass-thru' completed in 220ms.
Beginning task 'survey/image'...
Beginning task 'build'...
Beginning task 'survey'...
Beginning task 'survey/pass-thru'...
Task 'survey/image' completed in 9ms.
Beginning task 'survey/stylus'...
Task 'survey/stylus' completed in 0ms.
Beginning task 'survey/jade'...
Beginning task 'data'...
Task 'data' completed in 5ms.
Task 'survey/jade' completed in 6ms.
Beginning task 'survey/coffee'...
Task 'survey/coffee' completed in 1ms.
Beginning task 'survey/markdown'...
Task 'survey/markdown' completed in 2ms.
Beginning task 'survey/posts'...
Task 'survey/posts' completed in 0ms.
Beginning task 'survey/bundle'...
Task 'survey/bundle' completed in 4ms.
Task 'survey' completed in 252ms.
Task 'survey/pass-thru' completed in 156ms.
Beginning task 'survey/image'...
Task 'build' completed in 259ms.
Task 'survey/image' completed in 2ms.
Beginning task 'survey/stylus'...
Task 'survey/stylus' completed in 2ms.
Beginning task 'survey/jade'...
Beginning task 'data'...
Task 'data' completed in 5ms.
Task 'survey/jade' completed in 8ms.
Beginning task 'survey/coffee'...
Task 'survey/coffee' completed in 1ms.
Beginning task 'survey/markdown'...
Task 'survey/markdown' completed in 1ms.
Beginning task 'survey/posts'...
Task 'survey/posts' completed in 0ms.
Beginning task 'survey/bundle'...
Task 'survey/bundle' completed in 1ms.
Task 'survey' completed in 174ms.
Task 'build' completed in 183ms.
Task 'survey/pass-thru' completed in 80ms.
Beginning task 'survey/image'...
Task 'survey/image' completed in 2ms.
Beginning task 'survey/stylus'...
Task 'survey/stylus' completed in 1ms.
Beginning task 'survey/jade'...
Beginning task 'data'...
Task 'data' completed in 3ms.
Task 'survey/jade' completed in 4ms.
Beginning task 'survey/coffee'...
Task 'survey/coffee' completed in 1ms.
Beginning task 'survey/markdown'...
Task 'survey/markdown' completed in 1ms.
Beginning task 'survey/posts'...
Task 'survey/posts' completed in 0ms.
Beginning task 'survey/bundle'...
Task 'survey/bundle' completed in 1ms.
Task 'survey' completed in 91ms.
Task 'build' completed in 97ms.
Right now, the build
test runs against examples/simple-site
, which includes testing jade, coffeescript and stylus templates all in one test.
First, that makes our tests rely on the example site, so if we change the example site for documentation / quick-start purposes, it may break our tests.
Second, it lumps all building tests into a single build. Does it make sense to have one fixture site to test jade, one to test coffeescript, one to test stylus etc? This doesn't seem like a huge deal right now since those three things cover separate concerns, but if we add a markdown test, and start adding additional asset types, the single simple site will get cluttered and hard to manage.
Basically, don't run the blog tasks if the settings aren't there…
Ex: blurb9.com
forwards to www.blurb9.com
.
Low priority, in any event.
Since S3 supports redirects, we can introduce .link
files that contain URLs. The corresponding asset type is a pass through. When published, we'll add the 301
for the corresponding URL to the URL in the link.
This should include optimization, compression, and responsive image support.
Although you can create your own custom middleware, we could provide a nice default.
Ex: post-formatting?
We can build on the middleware (#3) to create a simple CLI to serve up assets or compile them.
Could (initially) be as simple as:
15% done...
20% done...
...
Currently, H9 makes you specify the region for the bucket storing your site. There's not a strongly compelling reason to do this, other than it made things easier during development. If you don't use the correct region when querying against a bucket, you get a 301
error that prevents syncing.
Work should be done to make the region
field optional.
Or some equivalent which supports modular code broken into multiple files, compiling them into a single file during the pipeline build?
Not just for loading template data, but possibly for accessing from the site itself.
The name of environment could be the key. Not a high-priority, just slightly simpler.
Whenever creating a new bucket, sometimes you get a bucket does not exist when you try to sync with it. Right now I have a 5 second wait, but that's super hacky and doesn't always work. Look into confirming the bucket's existence after creation.
This hasn't even been tested informally. The use case is compiling a Jade template with a collection of blog posts.
Example:
s3:
domain: pandastrike.com
region: us-west-2
web:
index: index
error: 404
environments:
staging:
hostnames:
- staging
- test
cache:
expires: 60 # 1 minute
production:
cname: true
hostnames:
- www
cache:
expires: 1800 # 30 minutes
Building on #5, we want to be able for a blog summary to be able to reference an arbitrary directory containing the post assets.
This is bit trickier. We need to run the server and then send requests to it and make sure they return 200s. That's a good starting point.
Currently the tests don't test the renderers.
Example:
$ h9 publish staging
We can define an environment called default
to be used if none is specified.
Layouts and partials help in modularizing jade templates. We need to support them.
Use when instead of evie
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.