https://github.com/pdq/contentful-table
A simple table Contentful UI extension
https://github.com/pdq/contentful-table
contentful
Last synced: 5 months ago
JSON representation
A simple table Contentful UI extension
- Host: GitHub
- URL: https://github.com/pdq/contentful-table
- Owner: pdq
- License: mit
- Created: 2020-01-29T17:06:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T02:22:29.000Z (about 1 year ago)
- Last Synced: 2024-12-17T20:15:00.207Z (5 months ago)
- Topics: contentful
- Language: TypeScript
- Homepage: https://pdq.github.io/contentful-table/
- Size: 527 KB
- Stars: 2
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Table
A _simple_ table Contentful UI extension: [view demo](https://pdq.github.io/contentful-table/)
## Contentful
### Console
Create an extension and add this link to the src field:
```
https://pdq.github.io/contentful-table/
```### CLI
First, [setup](#setup) your environment.
#### Configure
Create a configuration file with your credentials for Contentful.
```sh
cp .env.example .env
```Add `SPACE_ID`, `CONTENTFUL_MANAGEMENT_ACCESS_TOKEN` and other values in `.env` in order to upload this extension to your Contentful space.
Then, source the variables into your environment. For a cross-platform experience, we're [waiting](https://github.com/toddbluhm/env-cmd/issues/112) on a new release of [env-cmd](https://www.npmjs.com/package/env-cmd) for variable expansion in NPM scripts.
#### Create
```sh
npm run contentful:create
```This will register the extension in your space on Contentful.
#### Update
Since the extension is self-hosted, the project does not need to be updated in Contentful after changes are made. However, if fields like `EXTENSION_NAME` or `EXTENSION_SRC` are altered, then the extension should be updated.
```sh
npm run contentful:update
```### Content Model
To use this UI extension in a Content Model:
1. Add a new field `JSON Object`
1. Configure the field under the "Appearance" tab to use the UI Extension "Table"## Setup
Install the dependencies:
```sh
npm install
```## Publish
To publish your own hosted URL, you may deploy changes to the extension hosted from `gh-pages`. Merge your changes into `master` to initiate the Github Actions hook or run:
```sh
npm run publish
```If you elect to use Github Actions to automate deployment, make sure to add a deployment key to deploy to your repo's Github Actions as [documented here](https://github.com/marketplace/actions/github-pages-action#1-add-ssh-deploy-key).
## Develop
```sh
npm start
```### Documentation
- [contentful-cli extension API](https://github.com/contentful/contentful-cli/tree/master/docs/extension)
- [contentful-ui-extensions-sdk API](https://github.com/contentful/ui-extensions-sdk)### Issues
- [`Uncaught ReferenceError: regeneratorRuntime`](https://github.com/parcel-bundler/parcel/issues/1762) - workaround: using `"browserslist": ["last 1 Chrome versions"]`. [To be fixed in Parcel 2.0](https://github.com/parcel-bundler/parcel/issues/1762#issuecomment-480687638)
- [`env-cmd` variable expansion in NPM scripts](https://github.com/toddbluhm/env-cmd/issues/112)## Code of Conduct
This project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/). For more information see this project's [Code of Conduct](./CODE_OF_CONDUCT.md).
## License
Copyright (c) PDQ.com. All rights reserved.Licensed under the [MIT license](./LICENSE).