From 6e8f33dc2c5c1c6c26bf0d45613ac340e06562bd Mon Sep 17 00:00:00 2001 From: x1a0t <405028157@qq.com> Date: Fri, 6 Jan 2023 18:16:58 +0800 Subject: [PATCH] feat: update landing page --- .../pages/workspace/[workspaceId]/[pageId].tsx | 17 +++++++++++------ .../templates/Welcome-to-AFFiNE-Alpha-v2.0.md | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx b/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx index 998ec29941..05c2c17eba 100644 --- a/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx +++ b/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { - useRef, - useEffect, - useState, - ReactElement, PropsWithChildren, + ReactElement, + useEffect, + useRef, + useState, } from 'react'; import { styled } from '@/styles'; import { EditorHeader } from '@/components/header'; @@ -16,6 +16,7 @@ import type { NextPageWithLayout } from '../..//_app'; import WorkspaceLayout from '@/components/workspace-layout'; import { useRouter } from 'next/router'; import { usePageHelper } from '@/hooks/use-page-helper'; + const StyledEditorContainer = styled('div')(() => { return { height: 'calc(100vh - 60px)', @@ -63,8 +64,12 @@ const Page: NextPageWithLayout = () => { currentPage!.addBlock({ flavour: 'affine:frame' }, pageId); // If this is a first page in workspace, init an introduction markdown if (isFirstPage) { - editor.clipboard.importMarkdown(exampleMarkdown, `${frameId}`); - currentWorkspace!.setPageMeta(currentPage!.id, { title }); + editor.clipboard + .importMarkdown(exampleMarkdown, `${frameId}`) + .then(() => { + currentWorkspace!.setPageMeta(currentPage!.id, { title }); + currentPage!.resetHistory(); + }); } currentPage!.resetHistory(); } diff --git a/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md b/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md index e0fc661340..6495135903 100644 --- a/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md +++ b/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md @@ -10,6 +10,11 @@ Let us know what you think of this latest version. 2. More complete Markdown support and improved keyboard shortcuts; 3. New features such as dark mode; Switch between view styles using the ☀ and 🌙. 4. Clean and modern UI/UX design. +5. You can self-host locally with Docker. + +```basic +docker run -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-self-hosted:alpha-abbey-wood +``` **Looking for Markdown syntax or keyboard shortcuts?** @@ -23,15 +28,21 @@ Let us know what you think of this latest version. - Copy and paste **images** into your pages, resize them and add captions - Add horizontal line dividers to your text with `---` and `***` - Changes are saved **locally**, but we still recommend you export your data to avoid data loss -- Insert code blocks with syntax highlighting support using ``` +- Insert code blocks with syntax highlighting support using ````` ### Playground: [] Try a horizontal line: `---` -[] What about a code block? ``` +[] What about a code block? ````` -        console.log('Hello world'); +```javascript +console.log('Hello world'); +``` + +[] Can you resize this image? + +![](https://cdn.affine.pro/694fdbab78e0da3ed7922eba7d506dcf12f57308e1904dd694f53eb2.jpg) **How about page management?**