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

fix: seo service config #2517

Merged
merged 2 commits into from
Nov 11, 2024
Merged
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
12 changes: 9 additions & 3 deletions src/app/shared/services/seo/seo.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from "@angular/core";
import { SyncServiceBase } from "../syncService.base";
import { DeploymentService } from "../deployment/deployment.service";
import { AppConfigService } from "../app-config/app-config.service";

interface ISEOMeta {
title: string;
Expand All @@ -21,7 +22,10 @@ type IMetaName =
providedIn: "root",
})
export class SeoService extends SyncServiceBase {
constructor(private deploymentService: DeploymentService) {
constructor(
private deploymentService: DeploymentService,
private appConfigService: AppConfigService
) {
super("SEO Service");
// call after init to apply defaults
this.updateMeta({});
Expand Down Expand Up @@ -65,12 +69,14 @@ export class SeoService extends SyncServiceBase {
private getDefaultSEOTags(): ISEOMeta {
const PUBLIC_URL = location.origin;
let faviconUrl = `${PUBLIC_URL}/assets/icon/favicon.svg`;
const { web, app_config } = this.deploymentService.config;
const { web } = this.deploymentService.config;
const { title } = this.appConfigService.appConfig().APP_HEADER_DEFAULTS;

if (web?.favicon_asset) {
faviconUrl = `${PUBLIC_URL}/assets/app_data/assets/${web.favicon_asset}`;
}
return {
title: app_config.APP_HEADER_DEFAULTS.title,
title,
description: "",
faviconUrl,
imageUrl: ``,
Expand Down
Loading