mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: og image
This commit is contained in:
parent
03a068eb0b
commit
2bf83df2b3
@ -66,6 +66,12 @@ http {
|
|||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /og-image.png {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
expires 30d;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
location = /404.html {
|
location = /404.html {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
BIN
frontend/appflowy_web_app/public/og-image.png
Normal file
BIN
frontend/appflowy_web_app/public/og-image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 189 KiB |
@ -60,7 +60,7 @@ const BASE_URL = process.env.AF_BASE_URL || 'https://beta.appflowy.cloud';
|
|||||||
const createServer = async (req) => {
|
const createServer = async (req) => {
|
||||||
const timer = logRequestTimer(req);
|
const timer = logRequestTimer(req);
|
||||||
const reqUrl = new URL(req.url);
|
const reqUrl = new URL(req.url);
|
||||||
|
|
||||||
logger.info(`Request URL: ${reqUrl.pathname}`);
|
logger.info(`Request URL: ${reqUrl.pathname}`);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
@ -68,7 +68,7 @@ const createServer = async (req) => {
|
|||||||
publishName,
|
publishName,
|
||||||
] = reqUrl.pathname.slice(1).split('/');
|
] = reqUrl.pathname.slice(1).split('/');
|
||||||
|
|
||||||
logger.info(`Namespace: ${namespace}, Publish Name: ${publishName}`);
|
logger.info(`Namespace: ${namespace}, Puganblish Name: ${publishName}`);
|
||||||
|
|
||||||
if (namespace === '' || !publishName) {
|
if (namespace === '' || !publishName) {
|
||||||
timer();
|
timer();
|
||||||
@ -94,7 +94,7 @@ const createServer = async (req) => {
|
|||||||
const description = 'Write, share, and publish docs quickly on AppFlowy.\nGet started for free.';
|
const description = 'Write, share, and publish docs quickly on AppFlowy.\nGet started for free.';
|
||||||
let title = 'AppFlowy';
|
let title = 'AppFlowy';
|
||||||
const url = 'https://appflowy.io';
|
const url = 'https://appflowy.io';
|
||||||
let image = 'https://d3uafhn8yrvdfn.cloudfront.net/website/production/_next/static/media/og-image.e347bfb5.png';
|
let image = '/og-image.png';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Inject meta data into the HTML to support SEO and social sharing
|
// Inject meta data into the HTML to support SEO and social sharing
|
||||||
|
@ -47,7 +47,7 @@ export enum AlignType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface BlockData {
|
export interface BlockData {
|
||||||
bg_color?: string;
|
bgColor?: string;
|
||||||
font_color?: string;
|
font_color?: string;
|
||||||
align?: AlignType;
|
align?: AlignType;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { HEADER_HEIGHT } from '@/components/publish/header';
|
||||||
import { getHeadingCssProperty } from './utils';
|
import { getHeadingCssProperty } from './utils';
|
||||||
import { EditorElementProps, HeadingNode } from '@/components/editor/editor.type';
|
import { EditorElementProps, HeadingNode } from '@/components/editor/editor.type';
|
||||||
import React, { forwardRef, memo } from 'react';
|
import React, { forwardRef, memo } from 'react';
|
||||||
@ -10,7 +11,15 @@ export const Heading = memo(
|
|||||||
const className = `${attributes.className ?? ''} ${fontSizeCssProperty} level-${level}`;
|
const className = `${attributes.className ?? ''} ${fontSizeCssProperty} level-${level}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div {...attributes} ref={ref} id={`heading-${node.blockId}`} className={className}>
|
<div
|
||||||
|
{...attributes}
|
||||||
|
ref={ref}
|
||||||
|
id={`heading-${node.blockId}`}
|
||||||
|
style={{
|
||||||
|
scrollMarginTop: HEADER_HEIGHT,
|
||||||
|
}}
|
||||||
|
className={className}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -44,15 +44,10 @@ export const ImageBlock = memo(
|
|||||||
}}
|
}}
|
||||||
className={`${className || ''} image-block relative w-full py-1 ${url ? 'cursor-pointer' : 'cursor-default'}`}
|
className={`${className || ''} image-block relative w-full py-1 ${url ? 'cursor-pointer' : 'cursor-default'}`}
|
||||||
>
|
>
|
||||||
<div ref={ref} className={'absolute left-0 top-0 h-full w-full select-none caret-transparent'}>
|
<div ref={ref} className={'absolute left-0 top-0 h-full w-full select-none caret-transparent'}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div contentEditable={false} className={`flex w-full select-none ${url ? '' : 'rounded border'} ${alignCss}`}>
|
||||||
contentEditable={false}
|
|
||||||
className={`flex w-full select-none ${url ? '' : 'rounded border'} ${
|
|
||||||
selected ? 'border-fill-list-hover' : 'border-line-divider'
|
|
||||||
} ${alignCss}`}
|
|
||||||
>
|
|
||||||
{url ? (
|
{url ? (
|
||||||
<ImageRender selected={selected} node={node} />
|
<ImageRender selected={selected} node={node} />
|
||||||
) : (
|
) : (
|
||||||
|
@ -10,7 +10,7 @@ function ImageEmpty(_: { containerRef: React.RefObject<HTMLDivElement>; onEscape
|
|||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
'container-bg flex h-[48px] w-full cursor-pointer select-none items-center gap-[10px] bg-content-blue-50 px-4 text-text-caption'
|
'container-bg flex h-[48px] w-full cursor-pointer select-none items-center gap-[10px] bg-fill-list-active px-4 text-text-caption'
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ImageIcon />
|
<ImageIcon />
|
||||||
|
@ -23,10 +23,12 @@ export const Outline = memo(
|
|||||||
const element = document.getElementById(id);
|
const element = document.getElementById(id);
|
||||||
|
|
||||||
if (element) {
|
if (element) {
|
||||||
void smoothScrollIntoViewIfNeeded(element, {
|
void (async () => {
|
||||||
behavior: 'smooth',
|
await smoothScrollIntoViewIfNeeded(element, {
|
||||||
block: 'start',
|
behavior: 'smooth',
|
||||||
});
|
block: 'start',
|
||||||
|
});
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ export const Element = memo(
|
|||||||
const data = (node.data as BlockData) || {};
|
const data = (node.data as BlockData) || {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
backgroundColor: data.bg_color ? renderColor(data.bg_color) : undefined,
|
backgroundColor: data.bgColor ? renderColor(data.bgColor) : undefined,
|
||||||
color: data.font_color ? renderColor(data.font_color) : undefined,
|
color: data.font_color ? renderColor(data.font_color) : undefined,
|
||||||
};
|
};
|
||||||
}, [node.data]);
|
}, [node.data]);
|
||||||
|
@ -235,11 +235,11 @@ span[data-slate-placeholder="true"]:not(.inline-block-content) {
|
|||||||
@apply bg-transparent;
|
@apply bg-transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
//&:hover {
|
||||||
.container-bg {
|
// .container-bg {
|
||||||
background: var(--fill-list-hover) !important;
|
// background: var(--fill-list-hover) !important;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-block-type='heading'] {
|
[data-block-type='heading'] {
|
||||||
|
@ -45,7 +45,7 @@ export function PublishView({ namespace, publishName }: PublishViewProps) {
|
|||||||
switch (true) {
|
switch (true) {
|
||||||
case createHotkey(HOT_KEY_NAME.TOGGLE_SIDEBAR)(e):
|
case createHotkey(HOT_KEY_NAME.TOGGLE_SIDEBAR)(e):
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setOpen((prev) => !prev);
|
// setOpen((prev) => !prev);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -10,6 +10,8 @@ import { ReactComponent as Logo } from '@/assets/logo.svg';
|
|||||||
import MoreActions from './MoreActions';
|
import MoreActions from './MoreActions';
|
||||||
import { ReactComponent as SideOutlined } from '@/assets/side_outlined.svg';
|
import { ReactComponent as SideOutlined } from '@/assets/side_outlined.svg';
|
||||||
|
|
||||||
|
export const HEADER_HEIGHT = 48;
|
||||||
|
|
||||||
export function PublishViewHeader({ onOpenDrawer, openDrawer }: { onOpenDrawer: () => void; openDrawer: boolean }) {
|
export function PublishViewHeader({ onOpenDrawer, openDrawer }: { onOpenDrawer: () => void; openDrawer: boolean }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const viewMeta = usePublishContext()?.viewMeta;
|
const viewMeta = usePublishContext()?.viewMeta;
|
||||||
@ -57,8 +59,9 @@ export function PublishViewHeader({ onOpenDrawer, openDrawer }: { onOpenDrawer:
|
|||||||
style={{
|
style={{
|
||||||
backdropFilter: 'saturate(180%) blur(16px)',
|
backdropFilter: 'saturate(180%) blur(16px)',
|
||||||
background: 'var(--header)',
|
background: 'var(--header)',
|
||||||
|
height: HEADER_HEIGHT,
|
||||||
}}
|
}}
|
||||||
className={'appflowy-top-bar sticky top-0 z-10 flex h-[48px] px-5'}
|
className={'appflowy-top-bar sticky top-0 z-10 flex px-5'}
|
||||||
>
|
>
|
||||||
<div className={'flex w-full items-center justify-between gap-2 overflow-hidden'}>
|
<div className={'flex w-full items-center justify-between gap-2 overflow-hidden'}>
|
||||||
{!openDrawer && (
|
{!openDrawer && (
|
||||||
@ -69,6 +72,7 @@ export function PublishViewHeader({ onOpenDrawer, openDrawer }: { onOpenDrawer:
|
|||||||
onClose={debounceClosePopover}
|
onClose={debounceClosePopover}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
className={'hidden'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpenPopover(false);
|
setOpenPopover(false);
|
||||||
onOpenDrawer();
|
onOpenDrawer();
|
||||||
|
Loading…
Reference in New Issue
Block a user