Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat: update landing page

x1a0t6e8f33dc2c5c
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,
+ PropsWithChildren,
+ ReactElement,
useEffect,
+ useRef,
useState,
- ReactElement,
- PropsWithChildren,
} 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? `````
+
+```javascript
+console.log('Hello world');
+```
+
+[] Can you resize this image?
-        console.log('Hello world');
+![](https://cdn.affine.pro/694fdbab78e0da3ed7922eba7d506dcf12f57308e1904dd694f53eb2.jpg)
**How about page management?**