Add deploy instructions
This commit is contained in:
parent
1e4f234d4a
commit
7618ba4f54
24
README.md
24
README.md
|
@ -5,12 +5,32 @@ It takes a list of existing RSS feeds, aggregates their contents and displays th
|
||||||
|
|
||||||
It was inspired by other software packages such as [Planet](<https://en.wikipedia.org/wiki/Planet_(software)>) and [MoonMoon](https://moonmoon.org/) but runs on top of Cloudflare Workers instead of being deployed on your own server.
|
It was inspired by other software packages such as [Planet](<https://en.wikipedia.org/wiki/Planet_(software)>) and [MoonMoon](https://moonmoon.org/) but runs on top of Cloudflare Workers instead of being deployed on your own server.
|
||||||
|
|
||||||
This ends up being specially useful for communities, in order to follow the work being done and published by its members. Some examples of existing "planets" (using different software):
|
This ends up being specially useful for communities, in order to follow the work being done and published by its members. Some examples of existing "planets" (but using different software):
|
||||||
|
|
||||||
- https://planet.debian.org/
|
- https://planet.debian.org/
|
||||||
- https://planet.kde.org/
|
- https://planet.kde.org/
|
||||||
- https://planet.gnome.org/
|
- https://planet.gnome.org/
|
||||||
|
|
||||||
|
**Note:** This project is still in its early days, so expect some rough edges. Any contributions are welcome.
|
||||||
|
|
||||||
# How to deploy
|
# How to deploy
|
||||||
|
|
||||||
Add later
|
First you need to have [wrangler]() correctly setup on your machine. Then:
|
||||||
|
|
||||||
|
1. Clone this repository
|
||||||
|
2. Create a `wrangler.toml` file based on the existing `wrangler.toml.example`
|
||||||
|
3. Create KV namespaces and their ids to the `kv_namespaces` setting on `wrangler.toml`
|
||||||
|
4. Add your `account_id` and customize all the `vars` in `wrangler.toml`. `FEEDS` should be
|
||||||
|
a string of coma separated urls, to each of the RSS/ATOM sources that will be part of your planet.
|
||||||
|
5. Run `wrangler publish`
|
||||||
|
|
||||||
|
## Customize the generated HTML
|
||||||
|
|
||||||
|
Each community has its own identity, so you should be able to easily customize the look and feel
|
||||||
|
of the generated page. To do so, before publishing you can edit the `templates/list_posts.handlebars` file.
|
||||||
|
|
||||||
|
After you should "precompile" that file using the following command:
|
||||||
|
|
||||||
|
> \$ handlebars templates/list_posts.handlebars -f templates/list_posts.precompiled.js -c handlebars/runtime
|
||||||
|
|
||||||
|
**Note:** You need to have handlebars installed "globally" for this step.
|
||||||
|
|
8
index.js
8
index.js
|
@ -24,12 +24,6 @@ async function handleRequest(request) {
|
||||||
|
|
||||||
const path = new URL(request.url).pathname
|
const path = new URL(request.url).pathname
|
||||||
|
|
||||||
//REMOVE LATER
|
|
||||||
if (path.includes('cron')) {
|
|
||||||
await handleScheduled(null)
|
|
||||||
return new Response('cron', { status: 201 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path === '/') {
|
if (path === '/') {
|
||||||
let content = await WORKER_PLANET_STORE.get('html')
|
let content = await WORKER_PLANET_STORE.get('html')
|
||||||
response = new Response(content, {
|
response = new Response(content, {
|
||||||
|
@ -40,7 +34,7 @@ async function handleRequest(request) {
|
||||||
response = new Response(content, {
|
response = new Response(content, {
|
||||||
headers: { 'content-type': 'application/rss+xml' }
|
headers: { 'content-type': 'application/rss+xml' }
|
||||||
})
|
})
|
||||||
// } else if (path === 'atom') {
|
// } else if (path === '/atom') {
|
||||||
// let content = await WORKER_PLANET_STORE.get('atom')
|
// let content = await WORKER_PLANET_STORE.get('atom')
|
||||||
// response = new Response(content)
|
// response = new Response(content)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue