[READ-ONLY] Mirror of https://github.com/flo-bit/bluesky-website-generator. bluesky-website-generator.vercel.app
0

Configure Feed

Select the types of activity you want to include in your feed.

cloudflare create & deploy

+36 -6
+34 -5
src/routes/+page.svelte
··· 1 1 <script lang="ts"> 2 - import { Button, Tabs } from '@fuxui/base'; 2 + import { Button, Tabs, Input } from '@fuxui/base'; 3 3 import { BlueskyLogin, UserProfile } from '@fuxui/social'; 4 4 5 + let value = $state(''); 6 + 5 7 let { data } = $props(); 8 + let form = $state<HTMLFormElement | null>(null); 6 9 7 - let form = $state<HTMLFormElement | null>(null); 10 + async function deploy() { 11 + const res = await fetch('/api/cloudflare', { 12 + method: 'POST', 13 + headers: { 'Content-Type': 'application/json' }, 14 + body: JSON.stringify({ 15 + projectName: data.user.handle.replace(/\./g, '-'), 16 + domain: value + '.polijn.com', 17 + profileHandle: data.user.handle 18 + }) 19 + }); 20 + 21 + // const data = await res.json(); 22 + // if (!res.ok) { 23 + // alert('Error: ' + data.error); 24 + // } else { 25 + // alert('Success!); 26 + // } 27 + } 8 28 </script> 9 29 10 30 <div class="mx-auto max-w-2xl"> ··· 12 32 <BlueskyLogin 13 33 login={async (handle) => { 14 34 // create and submit form with handle 15 - 35 + 16 36 if (!form) { 17 37 console.error('Form not found'); 18 38 return false; ··· 31 51 /> 32 52 33 53 <form method="POST" action="/?/login" class="hidden" bind:this={form}> 34 - <input type="hidden" name="handle" value="handle"> 54 + <input type="hidden" name="handle" value="handle" /> 35 55 </form> 36 56 {:else} 57 + <!-- Publish --> 37 58 <Button size="lg" class="absolute top-2 right-2">Publish</Button> 38 - <UserProfile class="" profile={{ ...data.user, description: '' }} /> 59 + <!-- create & deploy --> 60 + <Input 61 + sizeVariant="lg" 62 + class=" top-2 right-2" 63 + placeholder={data.user.handle.split('.')[0]} 64 + bind:value 65 + /> 66 + <Button onclick={deploy} size="lg" class=" top-2 right-2">Create & Deploy</Button> 39 67 68 + <UserProfile class="" profile={{ ...data.user, description: '' }} /> 40 69 <Tabs 41 70 active="About" 42 71 items={[
+2 -1
src/routes/api/cloudflare/+server.ts
··· 32 32 } 33 33 } 34 34 }; 35 - 35 + console.log('payload:'); 36 + console.log(payload.deployment_configs); 36 37 const res = await fetch(url, { 37 38 method: 'POST', 38 39 headers: {