Merge branch 'master' of github.com:benallfree/pockethost

This commit is contained in:
Ben Allfree 2023-01-25 12:54:47 +00:00
commit f11ea2ec90
10 changed files with 31 additions and 6 deletions

View File

@ -8,7 +8,14 @@ declare namespace App {
// interface Platform {}
}
type DocPage = Metadata<{ title: string }>
/**
* Taken from markdown plugin. For some reason importing here causes ts errors
*/
interface Metadata<TAttributes extends {} = {}> {
attributes: TAttributes
body: string
}
type DocPage = Metadata<{ title: string; published: boolean }>
declare module '*.md' {
const content: DocPage
export = content

View File

@ -1,5 +1,6 @@
---
title: Cloud Functions
published: false
---
# Cloud Functions

View File

@ -1,5 +1,6 @@
---
title: Frequently Asked Questions
title: FAQ
published: false
---
# Frequently Asked Questions

View File

@ -1,5 +1,6 @@
---
title: FTP Access to Instances
published: false
---
# FTP Access to Instances

View File

@ -1,5 +1,6 @@
---
title: Managing Your Instance
published: true
---
# Managing your Instance

View File

@ -1,7 +1,10 @@
---
title: Introduction
published: true
---
# PocketHost Docs
## Instance
Welcome to PocketHost!
PocketHost is the zero-config, up-in-30-seconds hosting platform for PocketBase. If you're looking for a developer and production experience more like Firebase and Supabase, you've come to the right place.

View File

@ -1,3 +1,4 @@
import { dev } from '$app/environment'
import { env as _env } from '$env/dynamic/public'
import publicRoutes from '$util/public-routes.json'
import { boolean } from 'boolean'
@ -17,7 +18,8 @@ export const envb = (name: string, _default: boolean) => boolean(env(name, _defa
export const PUBLIC_APP_DB = env('PUBLIC_APP_DB', 'pockethost-central')
export const PUBLIC_APP_DOMAIN = env('PUBLIC_APP_DOMAIN', 'pockethost.io')
export const PUBLIC_APP_PROTOCOL = env('PUBLIC_APP_PROTOCOL', 'https')
export const PUBLIC_DEBUG = envb('PUBLIC_DEBUG', false)
export const PUBLIC_DEBUG = envb('PUBLIC_DEBUG', dev)
export const PUBLIC_POCKETHOST_VERSION = base.version

View File

@ -1,12 +1,17 @@
<script lang="ts">
import { PUBLIC_DEBUG } from '$src/env'
import { pages } from '../../docs'
</script>
<div class="docs">
<div class="container">
<div class="toc">
{#each Object.entries(pages) as [v, k], i}
<div><a class="nav-link" href={`/docs/${v}`}>{k.attributes.title}</a></div>
{#each Object.entries(pages).filter(([k, p]) => p.attributes.published || PUBLIC_DEBUG) as [v, k], i}
<div>
<a class={`nav-link ${k.attributes.published ? '' : 'text-danger'}`} href={`/docs/${v}`}
>{k.attributes.title}</a
>
</div>
{/each}
</div>
<div class="body">

View File

@ -17,4 +17,7 @@
}
</script>
{#if !md.attributes.published}
<div class="text-danger">Draft</div>
{/if}
{@html md.body}

View File

@ -230,6 +230,7 @@ h6 {
.docs img {
max-width: 100%;
height: auto;
transform: scale(0.5); /* Sangit is taking 2x pixel denisty images */
border: 1px solid var(--bs-gray-500);
padding: 15px;
}