Iβm using Netlify and Netlify Identity for handling the CMS part.
Code
Add a /static/admin/config.yml file:
backend:
name: git-gateway
branch: master # Branch to update (optional; defaults to master)
publish_mode: editorial_workflow
# These lines should *not* be indented
media_folder: "static/images/uploads" # Media files will be stored in the repo under static/images/uploads
public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads
collections:
- name: "pages" # Used in routes, e.g., /admin/collections/blog
label: "Pages" # Used in the UI
folder: "content/" # depending on how you have this setup it may be like `content/pages`
create: true # Allow users to create new documents in this collection
slug: "{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- { label: "Layout", name: "layout", widget: "hidden", default: "page" }
- { label: "Title", name: "title", widget: "string" }
- { label: "Featured Image", name: "thumbnail", widget: "image" }
- { label: "Body", name: "body", widget: "markdown" }
and a /static/admin/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example using NetlifyCMS</title>
</head>
<body>
<!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
</body>
</html>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
Then, enable Netlify Identity for the site in the Netlify dashboard. Add an email to use for testing and/or editing.
open localhost:1111/admin/index.html and input your domain. It should work!
I want to build my pages based on data stored in a database. So Iβd fetch the data from an API during compilation, then create my pages based on it. In my case I have an API where clients are able post, update and delete articles. And I want to be able to build a Zola site based on that data every X minutes, or on demand.
Iβm also interested a page structure/templating solution, where I can define a route or collection like domain.com/page/{slug} to have content like:
^ I imagine the latter could actually work with Zola right now, where a shortcode like that references some HTML which should load the page content and insert it from the API?