{"id":19838066,"url":"https://github.com/sammy-t/snow-cms","last_synced_at":"2026-01-02T00:26:16.274Z","repository":{"id":246121837,"uuid":"813880512","full_name":"Sammy-T/snow-cms","owner":"Sammy-T","description":"A configurable CMS built with Svelte.","archived":false,"fork":false,"pushed_at":"2025-04-02T01:29:29.000Z","size":2004,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T02:31:03.046Z","etag":null,"topics":["cms","content-management-system","git-based-cms","headless-cms","static-site-generator","svelte"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/snow-cms","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sammy-T.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-11T23:32:21.000Z","updated_at":"2025-04-02T01:29:33.000Z","dependencies_parsed_at":"2024-06-26T00:48:46.786Z","dependency_job_id":"81a9e1a3-4982-4a8a-ac54-02566ddd3ded","html_url":"https://github.com/Sammy-T/snow-cms","commit_stats":null,"previous_names":["sammy-t/snow-cms"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sammy-T%2Fsnow-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sammy-T%2Fsnow-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sammy-T%2Fsnow-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sammy-T%2Fsnow-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sammy-T","download_url":"https://codeload.github.com/Sammy-T/snow-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924644,"owners_count":21666007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","content-management-system","git-based-cms","headless-cms","static-site-generator","svelte"],"created_at":"2024-11-12T12:16:42.445Z","updated_at":"2026-01-02T00:26:16.246Z","avatar_url":"https://github.com/Sammy-T.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snow CMS\n\nA configurable CMS built with [Svelte](https://svelte.dev/) and inspired by [Decap CMS](https://github.com/decaporg/decap-cms) and [Sveltia CMS](https://github.com/sveltia/sveltia-cms).\n\nI created this project because I wanted a CMS with a rich-text markdown widget, more intuitive custom preview configuration, and a configurable backend.\n\n![snow_screens_01](https://github.com/Sammy-T/snow-cms/assets/22360092/ae6b67ec-3e63-456c-a461-fb6da55d35e0)\n![snow_screens_02](https://github.com/Sammy-T/snow-cms/assets/22360092/b2f1bf6e-86b0-4580-8f06-5e426538eeef)\n\n## Features\n\n- Editor Widgets\n  - Boolean\n  - Number\n  - DateTime\n  - Text\n  - Markdown\n  - Hidden\n- Editor Preview layout templates (Using html templates with replacement tags)\n- Editor Preview styles\n- CMS Backends\n  - Local filesystem backend (Changes can be manually committed via your external Git CLI/GUI.)\n  - GitHub backend\n  - Specify your own custom backend\n- Optional hooks into editor actions\n- Output Markdown files with YAML front matter\n\n\u003e [!NOTE]\n\u003e When using the local backend, certain filesystem interactions may perform slowly on Firefox.  \n\u003e For maximum compatibility, use a Chrome-based browser.\n\n## Getting Started\n\n### Installing\n\n```bash\nnpm i snow-cms\n```\n\n### Import the CMS into your project\n\n- Create a path in your project where you want the CMS to be accessed.\\\n  ex. `[my-site]/cms`\n  - Create a javascript module and import the CMS css and js.\n  - Create an html file that loads the module and contains a root element with an id of `app`.\n- Create a path named `cms-config` in your project **at the same level** as the previously created `cms` path.\\\n  ex. `[my-site]/cms-config`\n  - Add a `config.yml` and any relevant css, html template, and js files.\n\n### Structure\n\nAn example of a basic project with the expected structure would look something like this:\n\n```\nindex.html\ncms/                        // The path to access the CMS. (Path name can be anything)\n |-- index.html             // Page that loads 'cms.js'\n |-- snow.js                // JS module that imports the CMS. (File name can be anything)\ncms-config/                 // The path containing CMS config files. (Must be named 'cms-config')\n |-- config.yml             // CMS config file\n |-- preview-template.html  // Layout template to apply to page previews in the editor\n |-- preview-styles.css     // Styles to apply to page previews in the editor\n |-- cms-actions.js         // Additional behavior to hook into editor actions. (Optional)\n```\n\n\u003e [!NOTE]\n\u003e This example assumes the use of a build system that allows importing css in js. But you should adapt importing of the css and js to your project's build system.\n\n#### cms/index.html\n\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n    \n    \u003c!-- The module that loads the CMS --\u003e\n    \u003cscript type=\"module\" src=\"snow.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- The root element used to load the CMS --\u003e\n    \u003cslot id=\"app\"\u003e\u003c/slot\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### cms/snow.js\n\n```js\n// Import the CMS css and js\nimport 'snow-cms/dist/index.css';\nimport 'snow-cms/dist/index';\n```\n\n#### cms-config/\n\nSee [Config](#config) for information on configuration as well as [dev-site/cms-config](/dev-site/cms-config) for example config files.\n\n## Development\n\n### Install [pnpm](https://pnpm.io/)\n\n```bash\nnpm install -g pnpm\n```\n\n### Install necessary packages\n\n```bash\npnpm install\n```\n\n### Run the dev server\n\n```bash\npnpm run dev\n```\n\nThen navigate to `http://localhost:5173/` in your browser to view the dev site.\n\n### Build output files\n\n```bash\npnpm run build\n```\n\nBuilt files will be output to the `dist/` directory.\n\n### Structure\n\n#### cms/\n\nContains the source files to build the CMS.\n\n#### dev-site/\n\nContains files for running the development server.\n\n*Development server site's photos by [Pixabay](https://www.pexels.com/photo/scenic-view-of-rice-paddy-247599/) and [Simon Berger](https://www.pexels.com/photo/silhouette-of-mountains-1323550/) from Pexels.*\n\n## Config\n\nSee [dev-site/cms-config](/dev-site/cms-config) for example config files.\n\n\u003e [!NOTE]\n\u003e The GitHub backend requires a [GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) to authenticate through and a server-side handler to exchange the access token. \n\u003e \n\u003e The GitHub app should be configured with `Callback URL` and `Setup URL` set to the url of the CMS.\n\u003e\n\u003e The server-side handler should exchange the received auth code for a user access token. Using one of the [Oauth App middlewares](https://github.com/octokit/oauth-app.js#middlewares) makes this easy to set up.\n\n### Widgets\n\nWidgets share the following configuration options:\n\n- `label`: The input label displayed in the editor interface.\n- `name`: The name of the input.\n- `default`: The input's default value.\n- `required`: Whether the input is required. (Defaults to `true`.)\n\n\u003e [!IMPORTANT]\n\u003e Each collection must have widgets configured for the names `title`, `date`, `draft`, and `body`.\n\n#### Boolean\n\n- `widget`: `'boolean'`\n\n```yaml\n{\n  label: 'Draft',\n  name: 'draft',\n  widget: 'boolean',\n  required: false\n}\n```\n\n\u003e [!NOTE]\n\u003e If the Boolean Widget's `required` option is set to `true` or isn't specified, \n\u003e the input's value must be `true` for editor data to submit.\n\n#### Number\n\n- `widget`: `'number'`\n- `step`: The amount the value increments / decrements by. (Defaults to `1`.)\n- `min`: The minimum value allowed.\n- `max`: The maximum value allowed.\n\n```yaml\n{\n  label: 'Cookies',\n  name: 'cookies',\n  widget: 'number',\n  step: 5\n}\n```\n\n#### DateTime\n\n- `widget`: `'datetime'`\n- `type`: `'datetime-local|date|time'` Which input to display.\n- `datetime_format`: How the datetime should be displayed.\n- `date_format`: How the date should be displayed.\n- `time_format`: How the time should be displayed.\n\n```yaml\n{\n  label: 'Publish Date',\n  name: 'date',\n  widget: 'datetime',\n  type: 'datetime-local',\n  datetime_format: 'MM.DD.YYYY HH:mm'\n}\n```\n\n\u003e [!NOTE]\n\u003e The corresponding `format` option should be set depending on the `type`.\n\n#### Text\n\n- `widget`: `'string|text'` Which input to display. Use `string` for single-line or `text` for multiline.\n\n```yaml\n{\n  label: 'Title',\n  name: 'title',\n  widget: 'string'\n}\n```\n\n#### Markdown\n\n- `widget`: `'markdown'`\n\n```yaml\n{\n  label: 'Body',\n  name: 'body',\n  widget: 'markdown'\n}\n```\n\n#### Hidden\n\n- `widget`: `'hidden'`\n- `type`: `'boolean|number|text|datetime-local|date|time'` The type of the input's value.\n- `default`: The value of the hidden input.\n\n```yaml\n{\n  name: 'hiddenValue',\n  widget: 'hidden',\n  type: 'text',\n  default: 'secret box'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammy-t%2Fsnow-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammy-t%2Fsnow-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammy-t%2Fsnow-cms/lists"}