{"id":21169054,"url":"https://github.com/cosmicjs/static-website","last_synced_at":"2025-07-09T18:31:45.295Z","repository":{"id":46561295,"uuid":"71288760","full_name":"cosmicjs/static-website","owner":"cosmicjs","description":"API-Powered Static Website","archived":false,"fork":false,"pushed_at":"2021-10-05T18:17:02.000Z","size":732,"stargazers_count":51,"open_issues_count":0,"forks_count":39,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T04:51:15.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cosmicjs.com/apps/static-website","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmicjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-18T20:31:46.000Z","updated_at":"2024-08-07T18:13:17.000Z","dependencies_parsed_at":"2022-09-02T18:30:51.480Z","dependency_job_id":null,"html_url":"https://github.com/cosmicjs/static-website","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cosmicjs/static-website","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fstatic-website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fstatic-website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fstatic-website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fstatic-website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmicjs","download_url":"https://codeload.github.com/cosmicjs/static-website/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmicjs%2Fstatic-website/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502387,"owners_count":23618587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T15:22:27.338Z","updated_at":"2025-07-09T18:31:44.425Z","avatar_url":"https://github.com/cosmicjs.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API-Powered Static Website\n![HTML](https://cosmicjs.com/uploads/01c0c800-9a3e-11e6-8103-8117827beac1-html.jpg)\n### [View Demo](http://static-website.cosmicapp.co)\n### Why?\nYou get the best of all worlds:\n\n1. The flexibility to manage content from the [Cosmic JS CMS API](https://cosmicjs.com).\n2. The speed of static HTML.\n3. The option to use Markdown files.\n\n### How it Works\n\n1. The build process fetches content from the Cosmic JS API, then builds the static HTML files.\n2. [Metalsmith](http://www.metalsmith.io/) transforms your Markdown into HTML pages.\n3. A light Node.js server is used to serve static files and perform rebuilds at the route `/rebuild-site`.\n\n### Article\nFor further reading, check out the article [How to Build an API-Powered, Static Website: The Best of Both Worlds](https://cosmicjs.com/blog/how-to-build-an-api-powered-static-website-the-best-of-both-worlds).\n### Getting Started\n#### Install\nMake sure you have yarn installed.  Why?  Because it's new, we love new, and it's provides [quite a few improvements](https://code.facebook.com/posts/1840075619545360) over the old  `npm install`.\n```\ngit clone https://github.com/cosmicjs/static-website\ncd static-website\nyarn\n```\n#### Start Server\n```\nyarn start\n```\nYour static site will now be serving static files from `/build` at [http://localhost:3000](http://localhost:3000).\n\n### Easy Rebuilding\nRebuild the website at any time by accessing [http://localhost:3000/rebuild-site](http://localhost:3000/rebuild-site).\n\n### Add / Edit Content\nYou can easily manage the content in your static site on Cosmic JS.  Follow these steps:\n\n1. [Log in to Cosmic JS](https://cosmicjs.com).\n2. Create a bucket.\n3. Go to Your Bucket \u003e Apps.\n4. Install the [Static Website App](https://cosmicjs.com/apps/static-website).\n5. Deploy your Static Site to the Cosmic App Server at Your Bucket \u003e Web Hosting.\n\nNow you can edit your content and rebuild your static site on-the-fly by accessing `http://your-bucket-slug.cosmicapp.co/rebuild-site`.  \n\n### Webhooks\nIf you would like to rebuild your site after every content edit, this is made easy with Webhooks.\n\n[Click here for a tutorial on how to set up Webhooks](https://cosmicjs.com/blog/adding-webhooks-in-4-steps).\n\nTo set up your Webhooks:\n\n1. Go to Your Bucket \u003e Webhooks and add the Webhooks product to your bucket.\n2. Add a Webhook that is triggered when an object is published.\n3. Point the Webhook to `http://your-bucket-slug.cosmicapp.co/rebuild-site`.\n4. Save.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicjs%2Fstatic-website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmicjs%2Fstatic-website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicjs%2Fstatic-website/lists"}