Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(seo): add schema org #976

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/deploy-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ jobs:
- tag: prod-fr
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "https://api.werewolves-assistant.com"
NUXT_PUBLIC_DEFAULT_LOCALE: "fr"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "https://werewolves-assistant.com"
NUXT_SITE_NAME: "Assistant Loups-Garous"
NUXT_SITE_ENV: "production"
NUXT_SITE_DESCRIPTION: "L'outil parfait pour les Maîtres du jeu des Loups-Garous de Thiercelieux™"
- tag: prod-en
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "https://api.werewolves-assistant.com"
NUXT_PUBLIC_DEFAULT_LOCALE: "en"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "https://werewolves-assistant.com"
NUXT_SITE_NAME: "Werewolves Assistant"
NUXT_SITE_ENV: "production"
NUXT_SITE_DESCRIPTION: "The perfect tool for game masters of the Werewolves of Miller's Hollow™"
- tag: local-prod-fr
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "http://localhost:9191"
NUXT_PUBLIC_DEFAULT_LOCALE: "fr"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "http://localhost:3000"
NUXT_SITE_NAME: "Assistant Loups-Garous"
NUXT_SITE_ENV: "production"
NUXT_SITE_DESCRIPTION: "L'outil parfait pour les Maîtres du jeu des Loups-Garous de Thiercelieux™"
- tag: local-prod-en
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "http://localhost:9191"
NUXT_PUBLIC_DEFAULT_LOCALE: "en"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "http://localhost:3000"
NUXT_SITE_NAME: "Werewolves Assistant"
NUXT_SITE_ENV: "production"
Expand Down Expand Up @@ -65,6 +69,7 @@ jobs:
build-args: |
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL=${{ matrix.NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL }}
NUXT_PUBLIC_DEFAULT_LOCALE=${{ matrix.NUXT_PUBLIC_DEFAULT_LOCALE }}
NUXT_PUBLIC_CONTACT_EMAIL=${{ matrix.NUXT_PUBLIC_CONTACT_EMAIL }}
NUXT_SITE_URL=${{ matrix.NUXT_SITE_URL }}
NUXT_SITE_NAME=${{ matrix.NUXT_SITE_NAME }}
NUXT_SITE_ENV=${{ matrix.NUXT_SITE_ENV }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push-on-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,31 @@ jobs:
- tag: preprod-fr
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "https://preprod.api.werewolves-assistant.com"
NUXT_PUBLIC_DEFAULT_LOCALE: "fr"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "https://preprod.werewolves-assistant.com"
NUXT_SITE_NAME: "Preprod Assistant Loups-Garous"
NUXT_SITE_ENV: "development"
NUXT_SITE_DESCRIPTION: "[Preprod] - L'outil parfait pour les Maîtres du jeu des Loups-Garous de Thiercelieux™"
- tag: preprod-en
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "https://preprod.api.werewolves-assistant.com"
NUXT_PUBLIC_DEFAULT_LOCALE: "en"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "https://preprod.werewolves-assistant.com"
NUXT_SITE_NAME: "Preprod Werewolves Assistant"
NUXT_SITE_ENV: "development"
NUXT_SITE_DESCRIPTION: "[Preprod] - The perfect tool for game masters of the Werewolves of Miller's Hollow™"
- tag: local-preprod-fr
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "http://localhost:9292"
NUXT_PUBLIC_DEFAULT_LOCALE: "fr"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "http://localhost:3001"
NUXT_SITE_NAME: "Preprod Assistant Loups-Garous"
NUXT_SITE_ENV: "development"
NUXT_SITE_DESCRIPTION: "[Preprod] - L'outil parfait pour les Maîtres du jeu des Loups-Garous de Thiercelieux™"
- tag: local-preprod-en
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL: "http://localhost:9292"
NUXT_PUBLIC_DEFAULT_LOCALE: "en"
NUXT_PUBLIC_CONTACT_EMAIL: "antoine.zanardi@epitech.eu"
NUXT_SITE_URL: "http://localhost:3001"
NUXT_SITE_NAME: "Preprod Werewolves Assistant"
NUXT_SITE_ENV: "development"
Expand All @@ -64,6 +68,7 @@ jobs:
build-args: |
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL=${{ matrix.NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL }}
NUXT_PUBLIC_DEFAULT_LOCALE=${{ matrix.NUXT_PUBLIC_DEFAULT_LOCALE }}
NUXT_PUBLIC_CONTACT_EMAIL=${{ matrix.NUXT_PUBLIC_CONTACT_EMAIL }}
NUXT_SITE_URL=${{ matrix.NUXT_SITE_URL }}
NUXT_SITE_NAME=${{ matrix.NUXT_SITE_NAME }}
NUXT_SITE_ENV=${{ matrix.NUXT_SITE_ENV }}
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ENV CI="true"

ARG NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL
ARG NUXT_PUBLIC_DEFAULT_LOCALE
ARG NUXT_PUBLIC_CONTACT_EMAIL
ARG NUXT_SITE_URL
ARG NUXT_SITE_NAME
ARG NUXT_SITE_ENV
Expand Down Expand Up @@ -41,6 +42,7 @@ ENV CI="true"

ARG NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL
ARG NUXT_PUBLIC_DEFAULT_LOCALE
ARG NUXT_PUBLIC_CONTACT_EMAIL
ARG NUXT_SITE_URL
ARG NUXT_SITE_NAME
ARG NUXT_SITE_ENV
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ Environment variables are :
|:-----------------------------------------------:|:----------------------------------------------------------------------:|:--------:|:-------------:|:----------------------------------------------:|
| `NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL` | URL of the Werewolves Assistant API ||| Must be a valid URL |
| `NUXT_PUBLIC_DEFAULT_LOCALE` | Locale used when starting the app || `en` | Must be either `en` or `fr` |
| `NUXT_PUBLIC_CONTACT_EMAIL` | Contact email for the app ||| Must be a valid email address |
| `SKIP_SCREENSHOTS_COMPARISON_TESTS` | In E2E tests, skip all screenshots comparisons, not used in production || `false` | Must be either `true` or `false` |
| `NUXT_SITE_URL` | Used for SEO, base URL for the site ||| Must be a valid URL |
| `NUXT_SITE_NAME` | Used for SEO, name of the site (Used in titles) ||| Must be a valid string |
Expand Down
6 changes: 5 additions & 1 deletion app/components/pages/index/IndexFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a
id="contact-button"
class="p-button p-button-secondary"
href="mailto: antoine.zanardi@epitech.eu"
:href="contactButtonHref"
>
<FontAwesomeIcon
icon="envelope"
Expand All @@ -29,4 +29,8 @@
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";

import GitHubRepositoryButton from "~/components/shared/external/GitHubRepositoryButton/GitHubRepositoryButton.vue";

const runtimeConfig = useRuntimeConfig();

const contactButtonHref = computed<string>(() => `mailto:${runtimeConfig.public.contactEmail}`);
</script>
15 changes: 14 additions & 1 deletion config/vitest/vitest.unit-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ export default defineVitestConfig({
pool: "threads",
root: fileURLToPath(new URL("../../", import.meta.url)),
environment: "nuxt",
environmentOptions: { nuxt: { rootDir: fileURLToPath(new URL("../../", import.meta.url)) } },
environmentOptions: {
nuxt: {
rootDir: fileURLToPath(new URL("../../", import.meta.url)),
overrides: {
runtimeConfig: {
public: {
defaultLocale: "en",
werewolvesAssistantApi: { baseUrl: "http://127.0.0.1" },
contactEmail: "john@doe.com",
},
},
},
},
},
setupFiles: ["./tests/unit/unit-setup.ts"],
watch: false,
include: ["./tests/unit/**/*.spec.ts"],
Expand Down
1 change: 1 addition & 0 deletions env/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL="http://127.0.0.1:8080"
NUXT_PUBLIC_DEFAULT_LOCALE="en"
NUXT_PUBLIC_CONTACT_EMAIL="john@doe.com"
antoinezanardi marked this conversation as resolved.
Show resolved Hide resolved
NUXT_SITE_URL="http://127.0.0.1:3000"
NUXT_SITE_NAME="Werewolves Assistant"
NUXT_SITE_ENV="development"
Expand Down
31 changes: 28 additions & 3 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const modules = [
"@nuxtjs/sitemap",
"@nuxtjs/robots",
"nuxt-og-image",
"nuxt-schema-org",
"@vite-pwa/nuxt",
"@nuxt/devtools",
];
Expand Down Expand Up @@ -220,21 +221,45 @@ export default defineNuxtConfig({
],
},
},
robots: {
disallow: ["/game/"],
},
antoinezanardi marked this conversation as resolved.
Show resolved Hide resolved
routeRules: {
"/": { prerender: true },
"/about": { swr: true },
"/game-lobby": { swr: true },
"/game": { ssr: false },
"/game/**": { ssr: false },
"/game": {
ssr: false,
robots: false,
},
"/game/**": {
ssr: false,
robots: false,
},
},
runtimeConfig: {
public: {
defaultLocale: "en",
werewolvesAssistantApi: { baseUrl: "" },
contactEmail: "",
antoinezanardi marked this conversation as resolved.
Show resolved Hide resolved
},
},
schemaOrg: {
enabled: false,
identity: {
type: "Organization",
name: process.env.NUXT_SITE_NAME ?? "Werewolves Assistant",
url: process.env.NUXT_SITE_URL,
logo: `${process.env.NUXT_SITE_URL}/_ipx/w_400/img/logo/square/werewolves-logo.webp`,
antoinezanardi marked this conversation as resolved.
Show resolved Hide resolved
sameAs: [
"https://github.com/antoinezanardi/werewolves-assistant-api-next",
"https://github.com/antoinezanardi/werewolves-assistant-web-next",
],
contactPoint: {
type: "ContactPoint",
email: process.env.NUXT_PUBLIC_CONTACT_EMAIL,
contactType: "Creator",
},
},
},
seo: {
fallbackTitle: false,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"msw": "^2.4.11",
"nuxt": "^3.13.1",
"nuxt-og-image": "^3.0.4",
"nuxt-schema-org": "^3.4.0",
"ofetch": "^1.4.1",
"pinia": "^2.2.4",
"pixelmatch": "^6.0.0",
Expand Down
Loading
Loading