Skip to content

Commit

Permalink
refactor: re-allocated favicon files, removed description from index …
Browse files Browse the repository at this point in the history
…files, feat: added head props
  • Loading branch information
Firgrep committed Oct 10, 2023
1 parent 1a0e3d2 commit 6bcdb37
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added public/og-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/pages/hegel/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Hegel index description
searchable: false
---

Index landing page for Hegel
Expand Down
4 changes: 0 additions & 4 deletions src/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
description: "sPhil is open-source philosophy."
---

import LandingPage from "../components/pages/landing";

<LandingPage />
2 changes: 1 addition & 1 deletion src/pages/kant/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Kant index description
searchable: false
---

Index landing page for **Kant**
Expand Down
1 change: 0 additions & 1 deletion src/pages/privacy.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
description: See our privacy policy and how it relates to you.
hidden: true
headeronly: true
container: true
Expand Down
2 changes: 1 addition & 1 deletion src/pages/spinoza/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Spinoza index description
searchable: false
---

Index landing page for **SPINOZA**
Expand Down
1 change: 0 additions & 1 deletion src/pages/terms.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
description: See our terms of our service and how they relate to you.
hidden: true
headeronly: true
container: true
Expand Down
59 changes: 59 additions & 0 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Footer from "@/components/Footer";
import { useRouter } from "next/router";
import { type DocsThemeConfig, useConfig } from "nextra-theme-docs";

const SITE_ROOT = "https://sphil-test.ey.r.appspot.com/";

const config: DocsThemeConfig = {
docsRepositoryBase: "https://github.com/Firgrep/sphil/tree/main", // root for every edit link
editLink: {
Expand All @@ -12,6 +14,63 @@ const config: DocsThemeConfig = {
footer: {
component: Footer,
},
head: function Head() {
const router = useRouter();
const { frontMatter } = useConfig();
const systemTheme = "light";
const fullUrl =
router.asPath === "/" ? SITE_ROOT : `${SITE_ROOT}${router.asPath}`;

return (
<>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="apple-touch-icon"
sizes="180x180"
href={`/images/favicon-${systemTheme}/apple-touch-icon.png`}
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href={`/images/favicon-${systemTheme}/favicon-32x32.png`}
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href={`/images/favicon-${systemTheme}/favicon-16x16.png`}
/>
<link
rel="mask-icon"
href={`/images/favicon-${systemTheme}/safari-pinned-tab.svg`}
color="#FFFFFF"
/>
<link
rel="shortcut icon"
href={`/images/favicon-${systemTheme}/favicon.ico`}
/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="theme-color" content="#FFF" />
<meta property="og:type" content="website" />
<meta property="og:url" content={fullUrl} />
<link rel="canonical" href={fullUrl} />
<meta name="image" property="og:image" content={`${SITE_ROOT}/og-image.png`} />
<meta property="og:locale" content="en_IE" />
<meta property="og:site_name" content="sPhil" />
<meta
name="description"
property="og:description"
content={frontMatter.description || 'Where Philosophy Meets Open Collaboration'}
/>
<meta
name="title"
property="og:title"
content={frontMatter.overrideTitle || frontMatter.title || "sPhil"}
/>
</>
);
},
logo: NavbarHeader,
logoLink: false,
navbar: {
Expand Down

0 comments on commit 6bcdb37

Please sign in to comment.