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: allow adding google search console property id via env var #11

Merged
merged 1 commit into from
Sep 24, 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
1 change: 1 addition & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NUXT_PUBLIC_API_BASE_URL="https://sicprod.acdh-dev.oeaw.ac.at/"
# -------------------------------------------------------------------------------------------------
# analytics
# -------------------------------------------------------------------------------------------------
# NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION=
NUXT_PUBLIC_MATOMO_BASE_URL="https://matomo.acdh.oeaw.ac.at"
# NUXT_PUBLIC_MATOMO_ID=

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"NUXT_PUBLIC_APP_BASE_URL=${{ needs.vars.outputs.public_url }}"
"NUXT_PUBLIC_API_BASE_URL=${{ vars.NUXT_PUBLIC_API_BASE_URL }}"
"NUXT_PUBLIC_APP_BASE_URL=${{ needs.vars.outputs.public_url }}"
"NUXT_PUBLIC_BOTS=${{ vars.NUXT_PUBLIC_BOTS }}"
"NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION=${{ vars.NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION }}"
"NUXT_PUBLIC_IIIF_BASE_URL=${{ vars.NUXT_PUBLIC_IIIF_BASE_URL }}"
"NUXT_PUBLIC_MATOMO_BASE_URL=${{ vars.NUXT_PUBLIC_MATOMO_BASE_URL }}"
"NUXT_PUBLIC_MATOMO_ID=${{ vars.NUXT_PUBLIC_MATOMO_ID }}"
"NUXT_PUBLIC_REDMINE_ID=${{ vars.SERVICE_ID }}"
"NUXT_PUBLIC_IIIF_BASE_URL=${{ vars.NUXT_PUBLIC_IIIF_BASE_URL }}"
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ RUN pnpm fetch
COPY --chown=node:node ./ ./
RUN sed -i "s/use-node-version/# use-node-version/" .npmrc

ARG NUXT_PUBLIC_API_BASE_URL
ARG NUXT_PUBLIC_APP_BASE_URL
ARG NUXT_PUBLIC_BOTS
ARG NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION
ARG NUXT_PUBLIC_IIIF_BASE_URL
ARG NUXT_PUBLIC_MATOMO_BASE_URL
ARG NUXT_PUBLIC_MATOMO_ID
ARG NUXT_PUBLIC_REDMINE_ID
ARG NUXT_PUBLIC_API_BASE_URL
ARG NUXT_PUBLIC_IIIF_BASE_URL

RUN pnpm install --frozen-lockfile --offline

Expand Down
11 changes: 10 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ useHead({
];
}),
meta: computed(() => {
return [
const meta = [
{ name: "description", content: t("DefaultLayout.meta.description") },
{ property: "og:type", content: "website" },
{ property: "og:title", content: t(route.meta.title) },
Expand All @@ -57,6 +57,15 @@ useHead({
{ name: "twitter:site", content: "@acdh_oeaw" },
...(i18nHead.value.meta ?? []),
];

if (isNonEmptyString(env.public.NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION)) {
meta.push({
name: "google-site-verification",
content: env.public.NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION,
});
}

return meta;
}),
script: computed(() => {
const jsonLd: WithContext<WebSite> = {
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default defineNuxtConfig({
NUXT_PUBLIC_API_BASE_URL: process.env.NUXT_PUBLIC_API_BASE_URL,
NUXT_PUBLIC_APP_BASE_URL: process.env.NUXT_PUBLIC_APP_BASE_URL,
NUXT_PUBLIC_BOTS: process.env.NUXT_PUBLIC_BOTS,
NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION: process.env.NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION,
NUXT_PUBLIC_MATOMO_BASE_URL: process.env.NUXT_PUBLIC_MATOMO_BASE_URL,
NUXT_PUBLIC_MATOMO_ID: process.env.NUXT_PUBLIC_MATOMO_ID,
NUXT_PUBLIC_REDMINE_ID: process.env.NUXT_PUBLIC_REDMINE_ID,
Expand Down
Loading