
Open source template for building static web sites with Prismic.io and AWS S3 - ykarikos
http://futurice.com/blog/cms-done-right-vol-3
======
jaxondu
Thinking of moving a static site to S3 + CloudFront + AWS Certificate Manager
with the purpose of enabling HTTPS for the site. Seems like CloudFront does
not support index document even if you've enabled it on S3
([https://tiffanybbrown.com/2016/01/aws-certificate-
manager-s3...](https://tiffanybbrown.com/2016/01/aws-certificate-
manager-s3-cloudfront-urls/index.html)). You can't have URL such as
[https://example.com/about/](https://example.com/about/). Instead need to
specifically use URL
[https://example.com/about/index.html](https://example.com/about/index.html).

Will look into Netlify and Aerobatic next. Are there other PaaS/SaaS that
makes it easy to host HTTPS static site generated from Jekyll/Hugo?

~~~
adyus
I'm using index document paths on S3 + CloudFront right now, it's definitely
possible. Unfortunately, I don't remember exactly what I did to make it work.
Some more Googling might give you the answer.

Edit: the setting is called "Default Root Object" when setting up a CloudFront
distribution with an S3 origin.

~~~
jjnoakes
Does that setting apply to any subdirectory? The article linked in a comment
above states otherwise.

~~~
brandur
> Does that setting apply to any subdirectory? The article linked in a comment
> above states otherwise.

No, unfortunately it doesn't.

One workaround that I use is to upload files without an extension and
explicitly set their content type as `text/html` in S3. So a request to
`/about` just serves a file in your S3 bucket called `about`. This works with
both CloudFront and S3.

I wrote about a few more details of the process here:
[https://brandur.org/fragments/aws-static-hosting-
workaround](https://brandur.org/fragments/aws-static-hosting-workaround)

------
neogenix
What we do is create a static site using Jekyll (or any other SSG) and then
add teletext.io on top for content management. Then host it in S3 or GitHub
pages.

See: [https://medium.com/teletext-io-blog/empower-your-static-
gene...](https://medium.com/teletext-io-blog/empower-your-static-generated-
jekyll-site-with-instant-content-management-
capabilities-82ce5569d7fb#.pod52hcoo)

~~~
drijkhof
I like the simplicity of just using a static site setup with a SSG, nice!

------
cyberferret
Seems pretty cool. I host several static web sites on S3 and am pretty happy
with the results. I am presuming that this toolset will make collaboration and
organisation of said sites much better.

Question - How well does it work if the S3 website is linked to a CloudFront
CDN? Does it take care of asset versioning or URL invalidations when updates
are done? That is by far the most tedious part of S3 Web + CloudFront for me.
I just invalidate the whole site from top down whenever I make changes just to
make sure I don't miss anything, but a more automated, granular approach would
be better, and I am hoping that Prismic can assist?

------
sadache
Here is a _very_ quickstart tutorial to test prismic.io
[https://prismic.io/quickstart](https://prismic.io/quickstart)

Don't hesitate to ask questions!

~~~
virtualwhys
^ co-creator of the Play! Framework

disclaimer: no affiliation with Prismic.io

...and Play is really quite awesome, thanks Guillaume and Sadache! Thanks for
the open bar you guys sponsored after Scala.io Paris conference as well ;-)

------
0xCMP
This is a pretty nice setup for those who aren't technical or couldn't be
expected to setup a local environment to test in.

I used to work in IT at a place with used this GOD-AWFUL CMS that did this
similarly but was written in apparently jQuery-plugin-hell and ASP.NET Forms.
The website to edit was slow (many seconds per page. In page JS actions took
many seconds) and required manual deploys.

Code could not be edited outside the browser editors (PHP, JS, etc.)

So a system that publishes a static site on S3 fairly easily seems like a win
to me.

------
shortformblog
Oh man, this is clever. Out of curiosity, can Prismic's content editor be made
to work with a secondary CMS like WordPress or Drupal without a lot of
trouble?

One of the problems I've run into as a writer is that … well, nearly every
copy editing tool out there sucks, and the ones that didn't (Poetica,
Editorially) inevitably don't have a business model and get bought out.

------
nir
What's the advantage of S3+CDN over plain GitHub Pages?

~~~
owenconti
HTTPS for custom domains is why I didn't go with GitHub Pages.

