Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CMS Starter example #134

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
33 changes: 33 additions & 0 deletions examples/cms-starter/.gitignore
triozer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies

/node_modules
/.pnp
.pnp.js
.yarn

# misc

.DS_Store
\*.pem

# files

my-plugin
dev-plugin
dist

# debug

npm-debug.log*
yarn-debug.log*
yarn-error.log\*

# local env files

.env\*.local

# Packed plugin

plugin.zip
19 changes: 19 additions & 0 deletions examples/cms-starter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Framer Plugin Template

This is a template for using the Framer Plugin API in a TypeScript project.

## Quickstart

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Learn more: https://www.framer.com/developers/plugins/introduction
triozer marked this conversation as resolved.
Show resolved Hide resolved
102 changes: 102 additions & 0 deletions examples/cms-starter/datasources/articles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"id": "articles",
"fields": {
"Title": {
"type": "string"
},
"Slug": {
"type": "string"
},
"Date": {
"type": "date"
},
"Image": {
"type": "image"
},
"Categories": {
"type": "reference",
"reference": "categories",
"multiple": true
},
"Content": {
"type": "richText"
},
"Reading time": {
"type": "number"
},
"Status": {
"type": "enum",
"options": ["draft", "published", "archived"]
},
"Featured": {
"type": "boolean"
},
"Related Articles": {
"type": "reference",
"reference": "articles",
"multiple": true
}
},
"items": [
{
"Slug": "getting-started",
"Title": "Getting Started",
"Date": "2024-11-27T23:00:00.000Z",
"Image": "https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg",
"Categories": "cms,basics",
"Reading time": 5,
"Status": "published",
"Content": "<h2>Editing Content</h2><blockquote><p>You can choose to set up different types of input fields depending on your content...</p></blockquote>...",
"Related Articles": ["getting-started"],
"Featured": true
},
{
"Slug": "whats-new",
"Title": "What's New",
"Date": "2024-11-20T23:00:00.000Z",
"Image": "https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg",
"Categories": "updates",
"Reading time": 5,
"Status": "published",
"Content": "<h2>Reference Fields</h2>...",
"Related Articles": ["getting-started"],
"Featured": false
},
{
"Slug": "styling-elements",
"Title": "Styling Elements",
"Date": "2024-10-23T22:00:00.000Z",
"Image": "https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg",
"Categories": "pro-tips",
"Reading time": 5,
"Status": "published",
"Content": "<h2>New This Month</h2><p>This quality update brings canvas and layer panel improvements...</p>",
"Related Articles": ["getting-started"],
"Featured": false
},
{
"Slug": "importing-content",
"Title": "Importing Content",
"Date": "2024-10-13T22:00:00.000Z",
"Image": "https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg",
"Categories": "cms,pro-tips",
"Reading time": 5,
"Status": "published",
"Content": "<h2>Prepare your CSV file</h2><p>Make sure your file is exported as a \"CSV\" file...</p>",
"Related Articles": ["getting-started"],
"Featured": false
},
{
"Slug": "best-practices",
"Title": "Best Practices",
"Date": "2024-10-01T22:00:00.000Z",
"Image": "https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg",
"Categories": "pro-tips",
"Reading time": 5,
"Status": "draft",
"Content": "<h3>Choose Compelling Topics</h3><p>Use analytics tools to understand demographic data and user behavior...</p>",
"Related Articles": ["getting-started"],
"Featured": true
}
]
}
Loading