penmark-cms
v1.0.0
Published
A package to enable a CMS embedded within your website
Readme
Penmark 📝🐧
A lightweight CMS you can embed directly into your Markdown-based, Github-backed website/blog. No need to switch between multiple websites, your website/blog is the only place you need.
- Open source 🙌
- No tracking/ads 📡🚫
- WYSIWYG or Markdown support M⬇✍
- Own your data: drafts are stored in your repo 📝
This package is a set of 3 components that allow you to enable this CMS experience:
- Login: used to login to get GitHub credentials
- Drafts: used to create & edit drafts (stored in your own GitHub repo)
- Edit: used to edit existing blog posts
Getting started
Here is how to import these 3 components:
- Login Component:
- Add a hidden page of your blog (for instance,
/login). This is intended to be only used by the editor of the blog, not readers of the blog. Anybody accessing this page will see the login buttons. - Add the following script to the body:
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/LoginClient.js"></script>
- Add a hidden page of your blog (for instance,
- Drafts Component:
- In your home page of your website, add the following script:
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/DraftsClient.js"></script> - This will only be visible when you are logged in, and only GitHub users who have contributor access to the underlying repository will be able to see the drafts.
- In your home page of your website, add the following script:
- Edit Component:
- In each page of your individual blog post, add the following script:
<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/PostClient.js"></script> - This will add an edit button only for logged in users.
- In each page of your individual blog post, add the following script:
Inspired by utterances.
