351 points · by hunvreus · 2y ago · 119 comments
1. You log in with your GitHub account.
2. You select the GitHub repo where your site/app is at (whether it's Next.js, 11ty, Hugo, Nuxt... as long as you're using flat files for content).
3. You add a single config file to your repo to define the content types and other settings (e.g. media folder).
4. Congrats: you now have a user friendly CMS to manage content + media BUT all changes are still tracked like regular commits (under your account) on GitHub.
I started using Jekyll around 2009 and over the course of the past 10+ years, I've helped build major sites and tiny blogs with Hugo, Gatsby, Next.js and more recently 11ty.
I still love it.
BUT once you're done building, managing content and media can be a bit of a pain. You have a few options:
- Edit files directly (on GitHub or your local). Good luck getting your colleagues on the marketing team to do that.
- Hook up a headless CMS like Contentful, Sanity, or Strapi. That works, but it's one more dependency and (IMHO) overkill in most cases.
- OR you could use something like [Decap CMS](https://decapcms.org/). Really cool project, but I've never been a fan of the UI/UX, and it's been a bit of a pain to setup (maybe that's just me).
I wanted something as simple as possible, preferably with nothing to install or deploy.
Back in 2018, I had built a prototype (Jekyll+) [1] with the idea of getting a CMS set up by just adding a single configuration file to your GitHub repository.
Pages CMS [2] is a continuation of that idea. It's 100% free and Open Source: https://github.com/pages-cms/pages-cms.
If you don't want to use the online version because you're not comfortable signing up with your GitHub account, consider the following options:
- Use a fine-grained personal access token [3], there's an option on the login screen. There is still a bug if you try to access a repo that isn't part of your token scope, but I'll get it fixed in the next couple of days.
- Deploy it yourself (for free) on Cloudflare Pages. Literally 5 minutes of work max. I made a video walking you through the process [4].
- Check out the intro video on the front page [2] (a bit crap, but I'll get a better one up in the next few days).
I use it actively with a few other teams, I hope it will be of use to some of you.
I'm already working on adding a few nicer features, like collaborative editing and email invites (to let non-developers login without a GitHub account).
PS: I've spent the past 8+ years building a business and only recently got back into coding. I'd love pointers as to what I could do better (and how I can manage my Powerpoint PTSD).
[1]: https://github.com/hunvreus/jekyllplus/
[2]: https://pagescms.org
[3]: https://docs.github.com/en/authentication/keeping-your-accou...
Me personally I'd like to see something that supports easily creating and using different types of objects besides pages (such as: events, books, recipes, etc.), like content types and fields and views in wordpress or drupal, ideally aligned with schema.org like https://www.drupal.org/project/schemadotorg I think Hugo might support content types in YAML or something.
Disclaimer: I used to work a lot with Drupal 10+ years ago. I more or less wanted the same kinds of features in Pages CMS.
Am I gathering correctly that this does not actually require you to host a backend somewhere? The GitHub OAuth will work even if the CMS is just statically hosted on Cloudflare Pages / Netlify? This was something I always found a little strange about Netlify CMS / Decap, the fact that it required you to either use Netlify or self host their git-gateway.
Edit: Nevermind, I saw it does the auth through serverless functions https://github.com/pages-cms/pages-cms/tree/main/functions/a... I guess it's impossible to do it frontend-only, looks like a fair compromise to me
You don't have to host anything if you use the online version, but you can self host it fairly easily for free on Cloudflare Pages: https://pagescms.org/docs/development/#deploy-on-cloudflare
It's pretty much just that cross site requests are disabled.
I didn't have a `media` entry in my pages.yml, which meant the rich text editor wasn't loading (JS error was being thrown). When I added that entry, it started working! Brilliant work!
I'm using Jekyll, with yaml frontmatter, and it's not clear how to specify the body. The documentation says that a rich text field could be set up with a "name" option (and gives "body") as an example but my Markdown files don't specify a name for the body.. it's just... there:
https://github.com/colinramsay/colinramsay.github.io/blob/ma...
I'm probably missing something but happy to open an issue if not.
[1] Uploaded Media using Pages interface: https://github.com/conceptualGabrielPutnam/JAMA4JS/blob/main...
Might be kind of nice if it allowed file upload/delete on folders you have not specifically called out for a function.
On my desktop at least, the user icon is also in the lower left, and then opens the choice window off the screen to the right.
> Tried it out [1], and with a bit of work got it to function. Media, posts, all seem to upload and be viewable. With the lead-in, kind of thought it was going to be "click-a-button, you're done." However, had to wander around a bit figuring out what format zones in the blog example were, and where they needed to be. Also kind of thought it was going to restyle my GitHub page or something, which did not seem to be the case (probably just false expectations)
Agreed. For the 1.0.0 release, I want to have a configuration wizard that does most of it for you: select where your files/collections are and it infers the configuration from existing entries.
Hopefully I get it working in the next couple of weeks.
On the second comment, kind of figure it was a WIP currently, hence suggestions. Thanks for the work, as its a fairly light weight way to have a quick little CMS.
I had been planning to re-host Notion media files to Cloudflare R2 and rewrite content, but it might just be simpler to use Pages CMS due to built-in R2 support.
But also, I like using Notion apps on the go. Hmm.
Any preference of storing said posts in a database or .mdx markdown file?
My favourite was Forestry (RIP) which was replaced by TinaCMS which simply didn't solve the same problem and it was for React websites anyway. CloudCannon now offers something similar to Forestry but requires you to host with them. Netlify CMS had potential but always felt poorly built and fragile, it was turned into Decap CMS when Netlify abandoned it. I admit I have not tried Decap, maybe because I never liked Netlify CMS.
Forestry was right in the sweet spot. It had the following.
* Able to be installed "over the top" of a markdown based site at any stage of the project without deep integration into the codebase. * Does an OK job at inferring content types from folder structure+ssg type and fields from frontmatter, writes config as flat files to git. You can edit these to refine/improve the inital schema. * no lockin to a specific hosting provided.
Look forward to trying Pages CMS
> Does an OK job at inferring content types from folder structure+ssg type and fields from frontmatter, writes config as flat files to git. You can edit these to refine/improve the inital schema.
That's what I want to spend some time working on next week as I think the onboarding process is far too difficult right now.
I'm currently using contentlayer [https://github.com/contentlayerdev/contentlayer] to manage docs and blog content, mostly .mdx files on urlbox.com.
It works well with next.js but unfortunately is abandonware now.
I also have a few custom remark/rehype plugins.
You're right it is a pain to update articles buried in your repo especially with less technical team members. I already tried out TinaCMS to try and solve the editing issues, but their editor wasn't so nice, and it seemed to implicitly make a commit on every tiny change to any content, so I'm really hoping I could use something like this to edit my already existing content...
Tried to set it up for our open source Changelog though and getting some errors, it doesn't seem to work with .mdx files
https://github.com/juneHQ/changelog
Anyways this looks super promising
import { MdxLayout } from "components/mdx-layout.tsx";
export const meta = {
slug: "all-time-high",
publishedAt: "2022-09-16T10:00:00.000Z",
title: "All time high",
headerImage: "https://june-changelog.s3.eu-central-1.amazonaws.com/changelog_ath_cd256d0719.png",
authors: [
(...)
I suppose I should be able to hack it by defining it as a JSON frontmatter and some custom delimiters.If you let me know how you would see this working, I'll try and get something working tomorrow.
I don't particularly care about having advanced filtering or of parsing my "meta" data
media: public
content:
- name: changelog
label: Changelog
type: file
path: pages/changelogs/2022-in-review.mdx
format: code
Obviously not super useful at this stage, especially since I haven't figured out mdx support in Codemirror yet.I can probably get collections to work though in the next few days. I'll let you know.
I just tried this out, and after an hour of work, I managed to get it working for my weird use case! It's way slicker and better performant than decap. Fantastic job!
The main issue I've had with Decap and Front Matter:
I have a flat file with hundreds of entries for a _collection_. (Yes, I know I'm misusing this, but I don't have time to refactor everything)
But for my use case, I don't want to have a folder with a file for each entry. I want a flat yaml to act as the collection.
It looks like the webpages are almost a direct copy of one another, one in dark mode and one in light mode, one with a community strip and professional services and one without
I'm a technical product marketer, and I find this type of landing page copying amusing to no end.
> Static CMS is a fork of Decap (previously Netlify CMS) focusing on the core product over adding massive, scope expanding, new features.
Any plans to just go full OSS with it and do sponsorships or OSI model foundation support? If this is yet another SaaS product then we’ll have to stick with our current methods.
Very cool stuff though. Keep going! GitHub or GitLab should just buy this for their platform.
- You can self-host it for free on Cloudflare Pages: https://pagescms.org/docs/development/#deploy-on-cloudflare
- The online version is 100% free as well: https://app.pagescms.org
There may be a pro plan at some point for some more complex features. From the FAQ on the front page:
What's the "Pro" plan?
I haven't completely figured it out, but there are a few features I'm working on that I believe would only be relevant to larger teams or professional use. Things like real-time collaboration, advanced media management (e.g., image manipulation), or S3 integration. This not only requires a lot more work but also hosting costs. If you're interested, drop me a line: hunvreus@gmail.com (@hunvreus).> What's the "Pro" plan? I haven't completely figured it out
Sounds like it's free until it isn't.
Maybe we can start to refer to these types of projects as GOSS (Gated Open Source Software) or maybe COSS (Crippled Open Source Software)? :-)
Do get the updates I'll be pushing in the next few days as I'm sure I'll find bugs here and there (I just pushed a hotfix 5 minutes ago [1]).
[1]: https://github.com/pages-cms/pages-cms/releases/tag/0.2.1
I was always looking for a good web interface for Hugo. Static site generators are nice...but sometimes you really just want to drag and drop and image and write a short post without all the extra hassle of moving the file to the post directory, linking it with the file name in the post, then preview is broken because of some path issues etc.
I do use Jekyll for a few sites of mine and need this to work, if only to sort my posts. Expect this to be added back in the next few days.
I'll drop a line here once it's released.
Why do you need full access to all of my GitHub repositories?
Well, the GitHub API kinda sucks when it comes to OAuth scoping. Pages CMS relies on the OAuth App flow, which doesn't allow for granular permissions. The alternative would be to use the GitHub App flow instead, but:
It's a lot more complicated and would require us to store and orchestrate a lot more in the backend.
Since we need to impersonate users (for things like commits), we anyway need to request user tokens, which technically would give us the same access as with the OAuth App flow.
However, we do not store your GitHub OAuth tokens in the backend. The serverless functions used to facilitate the OAuth login pass the OAuth token to the front-end, allowing it to directly communicate with the GitHub API.
And if you still don't trust the online version, you can deploy your own version for free in less than 10 minutes our Cloudflare Pages.
Do let me know if I got some of this wrong (@hunvreus), and feel free to suggest improvements in the issue queue.
Additionally I've added the support for Fine-grained PATs [1], allowing you to use a repository specific token. You'll see the button that reads "Sign in with a Fine-Grained PAT" on the login screen.[1] https://github.blog/2022-10-18-introducing-fine-grained-pers...
TLDR:
> Well, the GitHub API kinda sucks when it comes to OAuth scoping. Pages CMS relies on the OAuth App flow, which doesn't allow for granular permissions.
I am planning to add an "invite by email" feature that will allow you to add users by entering their email address. They can then log in without a GitHub account and use it the same way you do (although the commit will be associated to a Pages CMS GitHub app).
Very exciting work.
As I'm quite enthused by the project, I hope you don't mind if I offer some hopefully helpful feedback:
- For the video on your landing page, ideally the youtube would be embedded so it doesn't open another window
- In regards to the video, while I love the content and info, it's not the most marketing friendly. It's over 2 minutes before the background of the video even changes. Ideally the video would get into the demo portion muuuch quicker.
- I clicked on this hackernews link, clicked through to your landing page, scrolled around, but really didn't get a grasp of what it was offering or how it worked or who or what it was for (admittedly I was prly lazy reading). Only after I watched the video, heard you specifically mention eleventy (which I personally use a lot) was my interest piqued enough to actually engage in the content and understand it more. Glad I did, but I gotta feel there's some better way of presenting what you're doing. I quite liked your calling it a wordpress-like CMS over top an existing static site stack.
Those are just the thoughts that came to me. I absolutely love the project, thrilled it's MIT too. Though I'm not really a javascript dev I could definitely see myself using and contributing!
Yep.
> In regards to the video, while I love the content and info, it's not the most marketing friendly. It's over 2 minutes before the background of the video even changes. Ideally the video would get into the demo portion muuuch quicker.
Yep. I also recorded it when I was sick, and my mic is pretty horrid.
> I clicked on this hackernews link, clicked through to your landing page, scrolled around, but really didn't get a grasp of what it was offering or how it worked or who or what it was for (admittedly I was prly lazy reading). Only after I watched the video, heard you specifically mention eleventy (which I personally use a lot) was my interest piqued enough to actually engage in the content and understand it more. Glad I did, but I gotta feel there's some better way of presenting what you're doing. I quite liked your calling it a wordpress-like CMS over top an existing static site stack.
I definitely need to level up my marketing game.
Thanks a lot for the input.
On the home screen you'll have the ability to choose from a few repos to fork with pre-configured CMS: vanilla, Next.js, Astro, 11ty, Hugo, Jekyll...
I'm still curating the projects I'll be using as a starting point, so do let me know if there are templates for your favorite SSG that you'd like me to consider.
The more challenging feature is building a configuration wizard that figures out your content structure for you. I think this will adoption a lot as the main friction right now is around getting a working config file up and running.
I'm trying to set it up with my Eleventy blog (paavandesign.com/blog) and struggling to get the body field working
Have you also checked the examples: https://pagescms.org/docs/examples/
---
So 'body' is working if I set the type to text but when I set it to rich-text there's no input generated for body
Repo is private (sorry!) but here's the settings YAML file as it stands
content:
- name: blog
label: Blog
type: collection
path: 'src/blog'
view:
fields: [ title, date]
fields:
- name: date
label: Date
type: date
- name: title
label: Title
type: string
- name: description
label: Description
type: string
- name: tags
label: Tags
type: string
- name: body
label: Body
type: rich-textPublishing a hotfix in the next hour, in the meantime it should work if you add a media attribute (you can set it as `media: ""` if you don't have an image folder).
I also found another couple edge cases that are unlikely but that I will patch in the coming days.
Thanks for that.
Any comparisons against other github based CMS?
Personally I've been using Keystatic.
For example, https://pagescms.org is an 11ty website:
- The code is hosted on GitHub: https://github.com/pages-cms/website - The site is built and hosted by Cloudflare Pages
You can have a look at the config there: https://github.com/pages-cms/website/blob/main/.pages.yml
media:
input: posts
output: /posts
categories: [ image ]
content:
- name: posts
label: posts
type: collection
path: posts
fields:
- { name: title, label: Title, type: string }
- { name: body, label: Body, type: rich-text }
The collection of posts will only show the `md` files (that's the default, but you could change it by having a `filename` attribute on your content entry) and the media folder will only show images (`jpg`, `jpeg`, `png`, `gif`, `svg`, `bmp`, `tif`, `tiff`).- There's an online version, you can just go to https://app.pagescms.org
- You can switch between repos and branches straight from the interface (just click on the repo menu in the top left corner).
It would be nice to have this support generic/arbitrary git servers. I’ve been feeling this pain point for a while and have been considering building something like this myself.
"the branch master doesn't exist, redirecting you to the default branch (master)"
master exists
Is it a public repo? I'd love to have a look.
- Keystatic: I want it to run online, not as a local app.
- Statamic: I don't want an opinionated, full-stack CMS + SSG. I want to manage content in whatever app/website I'm building whether it's Next.js, Astro, 11ty...
- Decap CMS: I mentioned it in my post, I always found Decap's UI/UX pretty lacking, and the DX wasn't that smooth either.
With that being said, each one of these projects have been around for much longer, I don't necessarily expect to compete (yet).
What's wrong with DecapCMS?