chore: migrate appflowy.io to appflowy.com (#29)

This commit is contained in:
Kilu.He
2025-02-05 12:34:39 +08:00
committed by GitHub
parent 7b13cf7d77
commit 34607bf863
15 changed files with 66 additions and 47 deletions

View File

@@ -9,7 +9,7 @@ import { fetch } from 'bun';
const distDir = path.join(__dirname, 'dist');
const indexPath = path.join(distDir, 'index.html');
const baseURL = process.env.AF_BASE_URL as string;
const defaultSite = 'https://appflowy.io';
const defaultSite = 'https://appflowy.com';
const setOrUpdateMetaTag = ($: CheerioAPI, selector: string, attribute: string, content: string) => {
if ($(selector).length === 0) {

View File

@@ -2991,7 +2991,7 @@
"second": "Unlimited pages & blocks",
"three": "5 GB storage",
"four": "Intelligent search",
"five": "20 AI responses",
"five": "10 AI responses",
"six": "Mobile app",
"seven": "Real-time collaboration"
},

View File

@@ -45,6 +45,13 @@ export function afterAuth() {
if(redirectTo) {
clearRedirectTo();
window.location.href = decodeURIComponent(redirectTo);
const url = new URL(decodeURIComponent(redirectTo));
const pathname = url.pathname;
if(pathname === '/' || !pathname) {
url.pathname = '/app';
}
window.location.href = url.toString();
}
}

View File

@@ -20,7 +20,7 @@ function AppFlowyPower ({
<div
onClick={() => {
window.open('https://appflowy.io', '_blank');
window.open('https://appflowy.com', '_blank');
}}
style={{
width,

View File

@@ -72,7 +72,7 @@ export default function Help () {
<Button
component={'a'}
target="_blank"
href={'https://www.appflowy.io/what-is-new'}
href={'https://www.appflowy.com/what-is-new'}
className={'justify-start'}
color={'inherit'}
startIcon={<WhatsNewIcon />}

View File

@@ -23,7 +23,7 @@ function MobileMore ({
label: t('template.label'),
icon: <TemplateIcon />,
onClick: () => {
window.open('https://appflowy.io/templates', '_blank');
window.open('https://appflowy.com/templates', '_blank');
},
},
{

View File

@@ -22,7 +22,7 @@ function SideBarBottom () {
<IconButton
size={'small'}
onClick={() => {
window.open('https://appflowy.io/templates', '_blank');
window.open(`${window.location.origin}/templates`, '_blank');
}}
>
<TemplateIcon />

View File

@@ -38,9 +38,9 @@ function TemplatePanel ({ viewId }: { viewId: string }) {
} = useLoadPublishInfo(viewId);
const url = useMemo(() => {
const origin = import.meta.env.AF_BASE_URL?.includes('test') ? 'https://test.appflowy.io' : 'https://appflowy.io';
const templateUrl = `${window.location.origin}/templates`;
return template ? `${origin}/templates/${slugify(template.categories[0].name)}/${template.view_id}` : '';
return template ? `${templateUrl}/${slugify(template.categories[0].name)}/${template.view_id}` : '';
}, [template]);
useEffect(() => {

View File

@@ -104,10 +104,11 @@ function AsTemplate ({
startIcon={<WebsiteIcon />}
variant={'text'}
onClick={() => {
const origin = import.meta.env.AF_BASE_URL?.includes('test') ? 'https://test.appflowy.io' : 'https://appflowy.io';
const templateUrl = `${window.location.origin}/templates`;
window.open(`${origin}/templates/${slugify(template.categories[0].name)}/${template.view_id}`);
}} color={'primary'}
window.open(`${templateUrl}/${slugify(template.categories[0].name)}/${template.view_id}`);
}}
color={'primary'}
>{t('template.viewTemplate')}</Button>}
<div className={'flex items-center gap-2'}>
{template && <Button
@@ -124,7 +125,9 @@ function AsTemplate ({
<Button
onClick={() => {
submitRef.current?.click();
}} variant={'contained'} color={'primary'}
}}
variant={'contained'}
color={'primary'}
>
{t('button.save')}
</Button>
@@ -133,11 +136,15 @@ function AsTemplate ({
</div>
<div className={'flex-1 flex gap-20 overflow-hidden'}>
<Paper className={'w-full h-full flex-1 flex justify-center overflow-hidden'}>
<AFScroller className={'w-full h-full flex justify-center'} overflowXHidden>
<AFScroller
className={'w-full h-full flex justify-center'}
overflowXHidden
>
{loading ?
<CircularProgress /> :
<AsTemplateForm
defaultValues={defaultValue} viewUrl={viewUrl}
defaultValues={defaultValue}
viewUrl={viewUrl}
onSubmit={handleSubmit}
ref={submitRef}
defaultRelatedTemplates={template?.related_templates}
@@ -146,8 +153,14 @@ function AsTemplate ({
</AFScroller>
</Paper>
<div className={'w-[25%] flex flex-col gap-4'}>
<Categories value={selectedCategoryIds} onChange={setSelectedCategoryIds} />
<Creator value={selectedCreatorId} onChange={setSelectedCreatorId} />
<Categories
value={selectedCategoryIds}
onChange={setSelectedCategoryIds}
/>
<Creator
value={selectedCreatorId}
onChange={setSelectedCreatorId}
/>
<div className={'flex gap-2 items-center'}>
<InputLabel>{t('template.isNewTemplate')}</InputLabel>
<Switch

View File

@@ -37,10 +37,9 @@ export const withPasted = (editor: ReactEditor) => {
if (isUrl) {
const isAppFlowyLinkUrl = isURL(text, {
host_whitelist: ['localhost', 'appflowy.com', 'test.appflowy.com', 'beta.appflowy.com'],
host_whitelist: [window.location.hostname],
});
console.log('isAppFlowyLinkUrl', isAppFlowyLinkUrl);
if (isAppFlowyLinkUrl) {
const url = new URL(text);
const blockId = url.searchParams.get('blockId');

View File

@@ -35,7 +35,7 @@ const NotFound = () => {
<div className={'flex items-center px-2 max-sm:flex-col mt-4 w-full gap-4 justify-between'}>
<Button
component={Link}
to="https://appflowy.io/download"
to="https://appflowy.com/download"
variant="contained"
color="primary"
className={'flex-1 py-3 px-4 max-sm:w-full rounded-[8px] max-md:text-base text-[20px] font-medium'}

View File

@@ -28,7 +28,7 @@ export function Login ({ redirectTo }: { redirectTo: string }) {
>
<span>{t('web.signInAgreement')} </span>
<a
href={'https://appflowy.io/terms'}
href={'https://appflowy.com/terms'}
target={'_blank'}
className={'text-fill-default underline'}
>
@@ -36,7 +36,7 @@ export function Login ({ redirectTo }: { redirectTo: string }) {
</a>{' '}
{t('web.and')}{' '}
<a
href={'https://appflowy.io/privacy'}
href={'https://appflowy.com/privacy'}
target={'_blank'}
className={'text-fill-default underline'}
>

View File

@@ -51,7 +51,7 @@ function LoginAuth () {
closable={false}
cancelText={t('button.backToHome')}
onOk={() => {
openLoginModal?.(getRedirectTo() || window.location.origin);
openLoginModal?.(getRedirectTo() || `${window.location.origin}/app`);
}}
okText={t('button.tryAgain')}
title={<div className={'text-left font-bold flex gap-2 items-center'}>

View File

@@ -112,8 +112,8 @@ export function openOrDownload (schema?: string) {
const os = getOS();
if (os === 'ios' || os === 'android') {
const universalLink = 'https://appflowy.io/download';
const intentUrl = `intent://appflowy.io/download#Intent;` +
const universalLink = 'https://appflowy.com/download';
const intentUrl = `intent://appflowy.com/download#Intent;` +
'scheme=https;' +
'package=io.appflowy.app;' +
`S.browser_fallback_url=${encodeURIComponent(androidDownloadLink)};` +

View File

@@ -2,14 +2,14 @@ import isURL from 'validator/lib/isURL';
import isIP from 'validator/lib/isIP';
import isFQDN from 'validator/lib/isFQDN';
export const downloadPage = 'https://appflowy.io/download';
export const downloadPage = 'https://appflowy.com/download';
export const openAppFlowySchema = 'appflowy-flutter://';
export const iosDownloadLink = 'https://apps.apple.com/app/appflowy/id6457261352';
export const androidDownloadLink = 'https://play.google.com/store/apps/details?id=io.appflowy.appflowy';
export const desktopDownloadLink = 'https://appflowy.io/download/#pop';
export const desktopDownloadLink = 'https://appflowy.com/download/#pop';
export function isValidUrl(input: string) {
return isURL(input, { require_protocol: true, require_host: false });