From 71c1e38d22195f7f2843d3bf24e701aaa2e20e21 Mon Sep 17 00:00:00 2001 From: Guusvanmeerveld Date: Thu, 24 Mar 2022 19:07:14 +0100 Subject: [PATCH] Improved SEO, less Git hub actions runs --- .github/workflows/deploy.yml | 8 ++++++++ next.config.js | 2 +- src/next-seo.config.ts | 6 +++++- src/pages/404.tsx | 5 ++++- src/pages/index.tsx | 2 +- src/pages/trending.tsx | 5 ++++- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 581f78c..32e31c6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,14 @@ on: push: branches: - master + paths: + - src/** + - public/** + - Dockerfile + - package.json + - tsconfig.json + - next.config.js + - .github/workflows/** jobs: test: diff --git a/next.config.js b/next.config.js index 79d8f73..1c42837 100644 --- a/next.config.js +++ b/next.config.js @@ -11,5 +11,5 @@ module.exports = { NEXT_PUBLIC_GITHUB_URL: "https://github.com/Guusvanmeerveld/MaterialTube" }, basePath: process.env.BASE_PATH ?? "", - trailingSlash: true + trailingSlash: !(process.env.CI == "true") }; diff --git a/src/next-seo.config.ts b/src/next-seo.config.ts index 0c280ba..2d2a3da 100644 --- a/src/next-seo.config.ts +++ b/src/next-seo.config.ts @@ -5,7 +5,11 @@ import type { DefaultSeoProps } from "next-seo"; const SEO: DefaultSeoProps = { titleTemplate: `%s | ${packageInfo.displayName}`, defaultTitle: packageInfo.displayName, - description: packageInfo.description + description: packageInfo.description, + openGraph: { + description: packageInfo.displayName, + site_name: packageInfo.displayName + } }; export default SEO; diff --git a/src/pages/404.tsx b/src/pages/404.tsx index f2f4e50..bb8bc74 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -9,7 +9,10 @@ import Layout from "@components/Layout"; const NotFound: NextPage = () => { return ( <> - + Page not found diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 0c9941a..d5f39f2 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -14,7 +14,7 @@ import Layout from "@components/Layout"; const Index: NextPage = () => ( <> - + { return ( <> - + {isLoading && }