{"id":15043552,"url":"https://github.com/clay/amphora","last_synced_at":"2025-04-14T23:12:30.821Z","repository":{"id":28954053,"uuid":"32480128","full_name":"clay/amphora","owner":"clay","description":"Middleware for Express that composes components into renderable pages","archived":false,"fork":false,"pushed_at":"2024-10-02T15:16:11.000Z","size":3671,"stargazers_count":31,"open_issues_count":54,"forks_count":23,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-14T23:12:17.800Z","etag":null,"topics":["clay","express","javascript","redis"],"latest_commit_sha":null,"homepage":"https://claycms.gitbooks.io/amphora/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-18T19:38:22.000Z","updated_at":"2024-10-02T15:16:14.000Z","dependencies_parsed_at":"2024-06-18T21:26:59.552Z","dependency_job_id":"ae89e12f-2e34-4eea-8f29-415c66aad699","html_url":"https://github.com/clay/amphora","commit_stats":null,"previous_names":["nymag/amphora"],"tags_count":236,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clay%2Famphora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clay%2Famphora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clay%2Famphora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clay%2Famphora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clay","download_url":"https://codeload.github.com/clay/amphora/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975329,"owners_count":21192210,"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":["clay","express","javascript","redis"],"created_at":"2024-09-24T20:49:15.518Z","updated_at":"2025-04-14T23:12:30.804Z","avatar_url":"https://github.com/clay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n![illustration of an amphora](https://raw.githubusercontent.com/nymag/media/master/amphora-logo.png)\n\n_\"A new way to organize, edit, and deliver the web, one component at a time.\"_\n\n[![CircleCI](https://circleci.com/gh/clay/amphora.svg?style=svg)](https://circleci.com/gh/clay/amphora) [![Coverage Status](https://coveralls.io/repos/nymag/amphora/badge.svg?branch=master\u0026service=github\u0026t=WhTOg8)](https://coveralls.io/github/nymag/amphora?branch=master)\n\nPowering [New York Magazine](http://nymag.com/), [Vulture](http://www.vulture.com/), [The Cut](http://www,thecut.com/), [Grub Street](http://www.grubstreet.com/).  \nCreated by New York Media.\n\n## Table of Contents\n\n* [Introduction](./#introduction)\n* [Installation](./#installation)\n* [Usage](./#usage)\n* [Contribution](./#contribution)\n* [Advanced Topics](./#advanced-topics)\n\n## Introduction\n\nAmphora is a mixin for [Express](https://github.com/strongloop/express) that:\n\n* Composes components into renderable pages\n* Uses any key-value store of your choice \\(e.g., Mongo, Redis, LevelDB, etc.\\)\n* Provides an API for managing instances of components, uris, and pages\n\n[Components are reusable, configurable, self-contained bits of the web.](https://github.com/nymag/amphora/wiki#clay-is-divided-into-components)\n\nAmphora is a core part of New York Media's Clay project, an open-source content management system.\n\nIt follows semver and is stable as of v1.0.0.\n\n## Installation\n\n```text\nnpm install --save amphora\n```\n\n## Usage\n\nClay separates concerns into two main areas: components and sites. Create two new directories in your project:\n\n```text\n/components  (where your custom components live)\n/sites       (for site-specific settings, routes, and assets)\n```\n\nIn your project's main server file \\(e.g. `app.js`\\), instantiate a new Amphora instance.\n\n```javascript\nvar amphora = require('amphora'),\n  port = process.env.PORT || 3000;\n\nreturn amphora()\n  .then(function (server) {\n    server.listen(port);\n  });\n```\n\nFor additional configuration, you may pass in an Express app / router. You can also override the default templating engine\\(s\\) with your own.\n\n```javascript\nvar app = require('express')(),\n  amphora = require('amphora'),\n  amphoraHtml = require('amphora-html'),\n  port = process.env.PORT || 3000,\n  env;\n\n// add project-specific settings to your app\napp.set('strict routing', true);\napp.set('trust proxy', 1);\n\n// add custom settings to your templating engine\nenv.addGlobal('projectName', process.env.PROJECT_NAME);\n\nreturn amphora({\n  app: app,\n  renderers: {\n    default: 'html',\n    html: amphoraHtml\n  }\n}).then(function (server) {\n  server.listen(port);\n});\n```\n\n### How to create a component\n\nComponents in Clay have the following structure:\n\n```text\n/component-name     unique name of your component\n    template.handlebars   your template\n    schema.yml            describes how the component's data is edited\n```\n\nAll of these files are optional.\n\n### How to create a template\n\nThe template you create is dependent on whichever renderer you'd like to use. The Clay Core team supports an [HTML renderer](https://github.com/clay/amphora-html) using [Handlebars](http://handlebarsjs.com/) template, but the choice is yours. Either request a renderer or build one on your own!\n\n### How to create a schema\n\n[Kiln](https://github.com/nymag/clay-kiln) uses a component's schema.yml to determine how it is edited. [Visit the Kiln wiki](https://github.com/clay/clay-kiln/wiki/Schemas-and-Behaviors) for examples of how to write schema files for your components.\n\n## Contribution\n\nFork the project and submit a PR on a branch that is not named `master`. We use linting tools and unit tests, which are built constantly using continuous integration. If you find a bug, it would be appreciated if you could also submit a branch with a failing unit test to show your case.\n\n## Advanced Topics\n\n* [New Concepts For Developers and Designers](https://github.com/clay/amphora/wiki#for-developers-and-designers)\n* [Bootstrapping Data](https://github.com/clay/amphora/tree/master/lib/bootstrap.md)\n* [Routing](https://github.com/clay/amphora/tree/master/lib/routes)\n* [Plugins](https://github.com/clay/amphora/tree/master/docs/plugin.md)\n* [Subsites](https://github.com/clay/amphora/tree/master/docs/subsites.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclay%2Famphora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclay%2Famphora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclay%2Famphora/lists"}