Merge pull request #515 from outline/jori/metatags
Added more metatags + screenshot
This commit is contained in:
@@ -10,7 +10,7 @@ SECRET_KEY=F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634B
|
||||
PORT=3000
|
||||
REDIS_URL=redis://redis:6379
|
||||
URL=http://localhost:3000
|
||||
DEPLOYMENT=hosted
|
||||
DEPLOYMENT=self
|
||||
ENABLE_UPDATES=true
|
||||
DEBUG=sql,cache,presenters,events
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ import Analytics from '../../../shared/components/Analytics';
|
||||
import globalStyles from '../../../shared/styles/globals';
|
||||
import { color } from '../../../shared/styles/constants';
|
||||
|
||||
export const title = 'Outline';
|
||||
export const description =
|
||||
'Your team’s knowledge base - Team wiki, documentation, playbooks, onboarding & more…';
|
||||
export const screenshotUrl = `${process.env.URL}/screenshot.png`;
|
||||
|
||||
type Props = {
|
||||
children?: React$Element<*>,
|
||||
};
|
||||
@@ -17,16 +22,25 @@ export default function Layout({ children }: Props) {
|
||||
<html lang="en">
|
||||
<head>
|
||||
<Helmet>
|
||||
<title>Outline</title>
|
||||
<title>{title}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="referrer" content="origin" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Your team’s knowledge base - Team wiki, documentation, playbooks, onboarding & more…"
|
||||
/>
|
||||
<meta name="og:site_name" content="Outline" />
|
||||
<meta name="description" content={description} />
|
||||
|
||||
<meta name="og:site_name" content={title} />
|
||||
<meta name="og:type" content="website" />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image" content={screenshotUrl} />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:domain" value="getoutline.com" />
|
||||
<meta name="twitter:title" value={title} />
|
||||
<meta name="twitter:description" value={description} />
|
||||
<meta name="twitter:image" content={screenshotUrl} />
|
||||
<meta name="twitter:url" value={process.env.URL} />
|
||||
|
||||
<meta name="theme-color" content={color.primary} />
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
|
||||
@@ -10,6 +10,7 @@ import serve from 'koa-static';
|
||||
import subdomainRedirect from './middlewares/subdomainRedirect';
|
||||
import renderpage from './utils/renderpage';
|
||||
import { slackAuth } from '../shared/utils/routeHelpers';
|
||||
import { robotsResponse } from './utils/robots';
|
||||
|
||||
import Home from './pages/Home';
|
||||
import About from './pages/About';
|
||||
@@ -81,6 +82,9 @@ router.get('/', async ctx => {
|
||||
}
|
||||
});
|
||||
|
||||
// Other
|
||||
router.get('/robots.txt', ctx => (ctx.body = robotsResponse(ctx)));
|
||||
|
||||
// catch all for react app
|
||||
router.get('*', async ctx => {
|
||||
await renderapp(ctx);
|
||||
|
||||
9
server/utils/robots.js
Normal file
9
server/utils/robots.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// @flow
|
||||
import { type Context } from 'koa';
|
||||
|
||||
const DISALLOW_ROBOTS = `User-agent: *
|
||||
Disallow: /`;
|
||||
|
||||
export const robotsResponse = (ctx: Context): ?string => {
|
||||
if (ctx.headers.host.indexOf('getoutline.com') < 0) return DISALLOW_ROBOTS;
|
||||
};
|
||||
Reference in New Issue
Block a user