CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/landing/head.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import NextHead from "next/head";
7
import { join } from "path";
8
import { ReactNode } from "react";
9
10
import basePath from "lib/base-path";
11
import { useCustomize } from "lib/customize";
12
import IconLogo from "public/logo/icon.svg";
13
14
interface Props {
15
title: ReactNode;
16
}
17
18
export default function Head({ title }: Props) {
19
const { siteName, logoSquareURL } = useCustomize();
20
21
const faviconURL = logoSquareURL
22
? logoSquareURL
23
: join(basePath ?? "", IconLogo.src);
24
25
const feedTitle = `${siteName}'s News Feed`;
26
27
// This shows the title if given, otherwise the siteName.
28
// It used to always show the sitename first, but that's
29
// mostly useless, the site is clear already from the favicon,
30
// and other sites like github and amazon do NOT do that.
31
return (
32
<NextHead>
33
<title>{`${title ? title : siteName}`}</title>
34
<meta
35
name="description"
36
content="CoCalc landing pages and documentation"
37
/>
38
<link rel="icon" href={faviconURL} />
39
<link
40
rel="alternate"
41
type="application/rss+xml"
42
href={join(basePath, "/news/rss.xml")}
43
title={feedTitle}
44
/>
45
<link
46
rel="alternate"
47
type="application/feed+json"
48
href={join(basePath, "/news/feed.json")}
49
title={feedTitle}
50
/>
51
<link
52
rel="alternate"
53
type="application/atom+xml"
54
href={join(basePath, "/news/rss.xml")}
55
title={feedTitle}
56
/>
57
</NextHead>
58
);
59
}
60
61