diff --git a/CHANGELOG.md b/CHANGELOG.md
index 60dd52304..721281c05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added error handling for the _Redis_ connections to keep the app running if the connection fails
+### Changed
+
+- Set the `lastmod` dates of `sitemap.xml` dynamically
+
### Fixed
- Fixed the missing values in the holdings table
diff --git a/apps/api/src/app/frontend.middleware.ts b/apps/api/src/app/frontend.middleware.ts
index baf1953b0..8e867c371 100644
--- a/apps/api/src/app/frontend.middleware.ts
+++ b/apps/api/src/app/frontend.middleware.ts
@@ -4,7 +4,7 @@ import * as path from 'path';
import { environment } from '@ghostfolio/api/environments/environment';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config';
-import { DATE_FORMAT } from '@ghostfolio/common/helper';
+import { DATE_FORMAT, getYesterday } from '@ghostfolio/common/helper';
import { Injectable, NestMiddleware } from '@nestjs/common';
import { format } from 'date-fns';
import { NextFunction, Request, Response } from 'express';
@@ -18,6 +18,7 @@ export class FrontendMiddleware implements NestMiddleware {
public indexHtmlIt = '';
public indexHtmlNl = '';
public indexHtmlPt = '';
+ public sitemapXml = '';
private static readonly DEFAULT_DESCRIPTION =
'Ghostfolio is a personal finance dashboard to keep track of your assets like stocks, ETFs or cryptocurrencies across multiple platforms.';
@@ -54,6 +55,10 @@ export class FrontendMiddleware implements NestMiddleware {
this.getPathOfIndexHtmlFile('pt'),
'utf8'
);
+ this.sitemapXml = fs.readFileSync(
+ path.join(__dirname, 'assets', 'sitemap.xml'),
+ 'utf8'
+ );
} catch {}
}
@@ -118,6 +123,13 @@ export class FrontendMiddleware implements NestMiddleware {
) {
// Skip
next();
+ } else if (request.path === '/sitemap.xml') {
+ response.setHeader('content-type', 'application/xml');
+ response.send(
+ this.interpolate(this.sitemapXml, {
+ currentDate: format(getYesterday(), DATE_FORMAT)
+ })
+ );
} else if (request.path === '/de' || request.path.startsWith('/de/')) {
response.send(
this.interpolate(this.indexHtmlDe, {
@@ -228,7 +240,7 @@ export class FrontendMiddleware implements NestMiddleware {
private isFileRequest(filename: string) {
if (filename === '/assets/LICENSE') {
return true;
- } else if (filename.includes('auth/ey')) {
+ } else if (filename === '/sitemap.xml' || filename.includes('auth/ey')) {
return false;
}
diff --git a/apps/client/src/assets/sitemap.xml b/apps/api/src/assets/sitemap.xml
similarity index 60%
rename from apps/client/src/assets/sitemap.xml
rename to apps/api/src/assets/sitemap.xml
index cfc44a814..cd4c9f3fb 100644
--- a/apps/client/src/assets/sitemap.xml
+++ b/apps/api/src/assets/sitemap.xml
@@ -6,514 +6,514 @@
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
https://ghostfol.io/de
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/blog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/blog/2021/07/hallo-ghostfolio
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/blog/2023/01/ghostfolio-auf-sackgeld-vorgestellt
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/features
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/haeufig-gestellte-fragen
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/maerkte
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/open
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/preise
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/registrierung
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/ressourcen
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/ueber-uns
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/ueber-uns/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/ueber-uns/datenschutzbestimmungen
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/de/ueber-uns/lizenz
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/about
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/about/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/about/license
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2021/07/hello-ghostfolio
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/01/ghostfolio-first-months-in-open-source
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/07/ghostfolio-meets-internet-identity
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/07/how-do-i-get-my-finances-in-order
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/08/500-stars-on-github
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/10/hacktoberfest-2022
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/11/black-friday-2022
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2022/12/the-importance-of-tracking-your-personal-finances
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2023/02/ghostfolio-meets-umbrel
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2023/03/ghostfolio-reaches-1000-stars-on-github
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2023/05/unlock-your-financial-potential-with-ghostfolio
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/blog/2023/07/exploring-the-path-to-fire
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/faq
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/features
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/markets
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/open
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/pricing
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/register
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-altoo
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-copilot-money
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-delta
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-divvydiary
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-exirio
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-folishare
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-getquin
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-gospatz
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-justetf
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-kubera
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-markets.sh
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-maybe-finance
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-monse
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-parqet
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-plannix
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-portfolio-dividend-tracker
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-portseido
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-projectionlab
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-seeking-alpha
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-sharesight
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-simple-portfolio
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-snowball-analytics
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-sumio
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-utluna
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/en/resources/personal-finance-tools/open-source-alternative-to-yeekatee
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/funcionalidades
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/mercados
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/open
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/precios
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/preguntas-mas-frecuentes
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/recursos
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/registro
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/sobre
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/sobre/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/sobre/licencia
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/es/sobre/politica-de-privacidad
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/a-propos
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/a-propos/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/a-propos/licence
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/a-propos/politique-de-confidentialite
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/enregistrement
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/fonctionnalites
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/foire-aux-questions
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/marches
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/open
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/prix
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/fr/ressources
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/domande-piu-frequenti
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/funzionalita
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/informazioni-su
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/informazioni-su/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/informazioni-su/licenza
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/informazioni-su/informativa-sulla-privacy
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/iscrizione
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/mercati
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/open
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/prezzi
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/it/risorse
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/bronnen
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/kenmerken
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/markten
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/open
daily
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/over
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/over/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/over/licentie
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/over/privacybeleid
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/prijzen
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/registratie
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/nl/vaak-gestelde-vragen
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/blog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/funcionalidades
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/mercados
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/open
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/perguntas-mais-frequentes
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/precos
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/recursos
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/registo
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/sobre
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/sobre/changelog
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/sobre/licenca
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00
https://ghostfol.io/pt/sobre/politica-de-privacidade
- 2023-07-10T00:00:00+00:00
+ ${currentDate}T00:00:00+00:00