Skip to content

stackmuncher/static-pages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackMuncher Static Site Theme with Content

Production file structure:

/ - directory root, list of recently updated profiles
/about* - this statically generated site
/* - directory pages

Deployment

Hugo cannot deploy a site to a subfolder on S3. It is always deployed to the root of the bucket. Since this site resides in /about/ folder the structure has been set up to imitate the deployed structure with this message in the root and the rest of the pages in /about/.

The GWAPI should be configured to send any /about and /about/ requests to S3 for SSG contents and any other requests to the directory Lambda.

hugo deploy for S3 does not read the keys from ~/.aws/credentials. You need to add these 2 env vars to the terminal session:

export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=

Shortcuts

  • hugo server -v --disableFastRender
  • hugo --cleanDestinationDir && hugo deploy -v

Attribution

Live stats

There is one tiny script in call-to-action partial block that loads the latest stats from a JSON file stored in S3 via CloudFront. The config requires this CORS policy in S3:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "access-control-allow-origin"
        ]
    }
]

Set Origin Request Policy in CloudFront Behaviors tab to Managed-CORS-S3Origin to allow the headers through.

About

A static site generator for content pages on stackmuncher.com

Topics

Resources

License

Stars

Watchers

Forks

Languages