This commit is contained in:
Jill 2023-04-30 22:49:07 +03:00
parent f14813c88f
commit 41f30d381b
Signed by: oat
GPG Key ID: 33489AA58A955108
1 changed files with 26 additions and 22 deletions

View File

@ -1,38 +1,42 @@
# create-svelte
# cohost-blogger
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
A self-hostable front-end for [Cohost](https://cohost.org/) mimicing a CMS.
## Creating a project
## What?
If you're seeing this, you've probably already done this step. Congrats!
CMSes are stupid to host, stupid to make and stupid to find. Why bother? We have a perfectly fine Cohost. Let's use that!
```bash
# create a new project in the current directory
npm create svelte@latest
This site, pointed at a Cohost user and tag, will find every post under that tag and display it in a nice way, including the comments and proper rendering of the contents themselves.
# create a new project in my-app
npm create svelte@latest my-app
## How?
_If you're on NixOS, you should be able to integrate it into your [system config as a flake](https://git.oat.zone/dark-firepit/dotfiles/commit/26552bfb01e487fbabcdd6f72f2a1f1a0eb56cd2) or just run it with `nix run`._
First, install the dependencies:
```sh
git clone https://git.oat.zone/oat/cohost-blogger && cd cohost-blogger
npm install
```
## Developing
Afterwards, for development, you can run:
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
```
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
Or, for deployment:
To create a production version of your app:
```bash
```
npm run build
PORT=1234 node build
```
You can preview the production build with `npm run preview`.
## Configuration
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
Currently, there isn't a proper configuration system - this is not yet made to be hosted by anyone by me. You can head into [`src/lib/config.js`](https://git.oat.zone/oat/cohost-blogger/src/lib/config.js) for all instance-specific configuration, but this will be expanded into a proper system eventually:tm.
## Attributions
- **[@mintexists](https://cohost.org/mintexists)**, for help reverse-engineering the Cohost API
- **[Cohost's devteam](https://cohost.org/staff)** - while this site does interact _with_ Cohost, lots of the [Markdown processing code](https://git.oat.zone/oat/cohost-blogger/src/branch/main/src/lib/markdown) is borrowed from their sourcemaps