Skip to content
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
24 changes: 23 additions & 1 deletion website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export default defineConfig({
!page.includes("/tags/") &&
!page.includes("/account/") &&
!page.includes("/oauth/") &&
!page.includes("/invite/")
!page.includes("/invite/") &&
!page.includes("/en-US")
);
},
serialize: (item) => {
Expand All @@ -86,6 +87,27 @@ export default defineConfig({
item.url = item.url.replace(/^https?:\/\/[^/]+/, baseUrl);
}

if (item.links?.length) {
item.links = item.links.map((link) => ({
...link,
url: link.url.replace(/^https?:\/\/[^/]+/, baseUrl),
}));

// Point x-default at the English (root) alternate
const defaultLink = item.links.find(
(link) => link.lang === LOCALES_MAP[DEFAULT_LOCALE],
);
if (
defaultLink &&
!item.links.some((link) => link.lang === "x-default")
) {
item.links.push({
url: defaultLink.url,
lang: "x-default",
});
}
}

// Check if this is a homepage link using the current base URL
const homepageLinks = SUPPORTED_LOCALES.map((locale) => {
if (locale === DEFAULT_LOCALE) return `${baseUrl}/`;
Expand Down
5 changes: 4 additions & 1 deletion website/public/_redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/quantum-security-checker /quantum-risk-checker 301
/quantum-security-checker/ /quantum-risk-checker 301
/quests /quests/shill 301
/quests/ /quests/shill 301
/quests/ /quests/shill 301
/en-US / 301
/en-US/ / 301
/en-US/* /:splat 301
2 changes: 2 additions & 0 deletions website/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=yes

Allow: /

Sitemap: https://www.quantus.com/sitemap-index.xml
4 changes: 4 additions & 0 deletions website/src/components/features/about/ContactSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ const t = await createTranslator(locale);
href="mailto:hello@quantus.com"
class="contact-email about-animate"
data-delay="0.45"
data-track="contact_email_click"
data-track-cta-location="about_contact"
>
{t("about.contact.email")}
</a>
<a
href="mailto:hello@quantus.com?subject=Enquiry%20from%20Quantus%20Website"
class="contact-cta about-animate"
data-delay="0.6"
data-track="contact_email_click"
data-track-cta-location="about_contact"
>
{t("about.contact.cta")}
</a>
Expand Down
5 changes: 4 additions & 1 deletion website/src/components/features/community/EventSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const t = await createTranslator(locale);
href="https://tally.so/r/D4502E"
target="_blank"
rel="noopener"
class="event-cta">{t("community.events.card.cta")}</a
class="event-cta"
data-track="qday_notify_click"
data-track-cta-location="community_events"
>{t("community.events.card.cta")}</a
>
</div>
<div class="event-card-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const t = await createTranslator(locale);
rel="noopener"
class="social-box comm-animate"
data-delay="0"
data-track="community_click"
data-track-channel="x"
data-track-cta-location="community_socials"
>
<span class="social-platform">
{t("community.socials.platforms.x")}
Expand All @@ -32,6 +35,9 @@ const t = await createTranslator(locale);
rel="noopener"
class="social-box comm-animate"
data-delay="0.08"
data-track="community_click"
data-track-channel="instagram"
data-track-cta-location="community_socials"
>
<span class="social-platform">
{t("community.socials.platforms.instagram")}
Expand All @@ -56,6 +62,9 @@ const t = await createTranslator(locale);
rel="noopener"
class="social-box comm-animate"
data-delay="0.24"
data-track="community_click"
data-track-channel="youtube"
data-track-cta-location="community_socials"
>
<span class="social-platform">
{t("community.socials.platforms.youtube")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ const t = await createTranslator(locale);
target="_blank"
rel="noopener"
class="telegram-btn comm-animate"
data-delay="0.45">{t("community.telegram.cta")}</a
data-delay="0.45"
data-track="community_click"
data-track-channel="telegram"
data-track-cta-location="community_telegram"
>{t("community.telegram.cta")}</a
>
</div>
</section>
Expand Down
12 changes: 12 additions & 0 deletions website/src/components/features/home/CommunitySection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const t = await createTranslator(locale);
href="https://t.me/quantusnetwork"
target="_blank"
class="community-panel-cta"
data-track="community_click"
data-track-channel="telegram"
data-track-cta-location="home_community"
>
{t("home.community.cards.telegram.cta")}
</a>
Expand Down Expand Up @@ -73,6 +76,9 @@ const t = await createTranslator(locale);
href="https://x.com/QuantusNetwork"
target="_blank"
class="community-panel-cta"
data-track="community_click"
data-track-channel="x"
data-track-cta-location="home_community"
>
{t("home.community.cards.x.cta")}
</a>
Expand Down Expand Up @@ -118,6 +124,9 @@ const t = await createTranslator(locale);
href="https://www.instagram.com/quantusnetwork/"
target="_blank"
class="community-panel-cta"
data-track="community_click"
data-track-channel="instagram"
data-track-cta-location="home_community"
>
{t("home.community.cards.instagram.cta")}
</a>
Expand Down Expand Up @@ -148,6 +157,9 @@ const t = await createTranslator(locale);
href="https://www.youtube.com/@QuantusNetwork"
target="_blank"
class="community-panel-cta"
data-track="community_click"
data-track-channel="youtube"
data-track-cta-location="home_community"
>
{t("home.community.cards.youtube.cta")}
</a>
Expand Down
15 changes: 14 additions & 1 deletion website/src/components/features/home/EcosystemSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ const t = await createTranslator(locale);
target="_blank"
rel="noopener"
class="eco-dl-tag"
data-track="wallet_store_click"
data-track-store="ios"
data-track-cta-location="home_ecosystem"
>
{t("home.ecosystem.cards.wallet.app_store")}
</a>
Expand All @@ -136,6 +139,9 @@ const t = await createTranslator(locale);
target="_blank"
rel="noopener"
class="eco-dl-tag"
data-track="wallet_store_click"
data-track-store="android"
data-track-cta-location="home_ecosystem"
>
{t("home.ecosystem.cards.wallet.google_play")}
</a>
Expand Down Expand Up @@ -340,7 +346,14 @@ const t = await createTranslator(locale);
{t("home.ecosystem.cards.network.validators")}
</div>
<div class="eco-dl-tags">
<a href="#" class="eco-dl-tag">
<a
href="https://explorer.quantus.com/"
target="_blank"
rel="noopener"
class="eco-dl-tag"
data-track="explorer_click"
data-track-cta-location="home_ecosystem"
>
{t("home.ecosystem.cards.network.explorer_cta")}
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions website/src/components/features/home/HeroBanner.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const t = await createTranslator(locale);
class="wallet-cta-link"
target="_blank"
rel="noopener"
data-track="wallet_store_click"
data-track-cta-location="home_hero"
>
{t("home.hero_banner.cta_download_wallet")}
</Button>
Expand Down
12 changes: 10 additions & 2 deletions website/src/components/features/home/NewsletterSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ const t = await createTranslator(locale);

<script>
import apiClient from "@/api/client";
import { trackEvent } from "@/scripts/shared/analytics";

const submitBtn = document.getElementById("nl-submit") as HTMLButtonElement;
const firstInput = document.getElementById(
Expand Down Expand Up @@ -374,12 +375,19 @@ const t = await createTranslator(locale);
);
const data = await resp.json();

if (resp.status !== 201 && data.error) {
window.toast.error(data.error);
if (resp.status !== 201) {
if (data.error) {
window.toast.error(data.error);
}
setLoading(false);
return;
}

trackEvent("generate_lead", {
lead_type: "newsletter",
form_id: "homepage_newsletter",
});

formWrap.style.transition = "opacity 0.4s ease";
formWrap.style.opacity = "0";
setTimeout(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const t = await createTranslator(locale);
class="qrc-cta-btn qrc-animate wallet-cta-link"
data-delay="0.45"
target="_blank"
rel="noopener">{t("quantum_risk_checker.advice.cta")}</a
rel="noopener"
data-track="wallet_store_click"
data-track-cta-location="risk_checker_advice"
>{t("quantum_risk_checker.advice.cta")}</a
>
<span class="qrc-footer-note qrc-animate" data-delay="0.6">
{t("quantum_risk_checker.advice.footer_note")}
Expand Down
6 changes: 6 additions & 0 deletions website/src/components/features/qday-checker/HeroBanner.astro
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ const checkerI18n = {
type RiskLevelKey,
type RecommendationKey,
} from "@/scripts/risk-checker/quantum-security-scorer";
import { trackEvent } from "@/scripts/shared/analytics";

type CheckerI18nShape = {
errors: { empty: string; invalid: string; ensFailed: string };
Expand Down Expand Up @@ -676,6 +677,11 @@ const checkerI18n = {
return;
}

trackEvent("risk_check_complete", {
checker_version: "v1",
completion_status: "success",
});

const {
address,
addressData: { ensName },
Expand Down
2 changes: 2 additions & 0 deletions website/src/components/features/technology/CtaSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const t = await createTranslator(locale);
class="tech-cta-secondary"
target="_blank"
rel="noopener"
data-track="explorer_click"
data-track-cta-location="technology_cta"
>
{t("technology.cta.secondary_cta")}
</a>
Expand Down
6 changes: 6 additions & 0 deletions website/src/components/features/wallet/CtaSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const t = await createTranslator(locale);
class="wallet-btn-primary"
target="_blank"
rel="noopener"
data-track="wallet_store_click"
data-track-store="ios"
data-track-cta-location="wallet_cta"
>
{t("wallet.cta.primary_cta")}
</a>
Expand All @@ -27,6 +30,9 @@ const t = await createTranslator(locale);
class="wallet-btn-secondary"
target="_blank"
rel="noopener"
data-track="wallet_store_click"
data-track-store="android"
data-track-cta-location="wallet_cta"
>
{t("wallet.cta.secondary_cta")}
</a>
Expand Down
6 changes: 6 additions & 0 deletions website/src/components/features/wallet/HeroBanner.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const t = await createTranslator(locale);
class="wallet-btn-primary"
target="_blank"
rel="noopener"
data-track="wallet_store_click"
data-track-store="ios"
data-track-cta-location="wallet_hero"
>
{t("wallet.hero_banner.cta_app_store")}
</a>
Expand All @@ -31,6 +34,9 @@ const t = await createTranslator(locale);
class="wallet-btn-secondary"
target="_blank"
rel="noopener"
data-track="wallet_store_click"
data-track-store="android"
data-track-cta-location="wallet_hero"
>
{t("wallet.hero_banner.cta_google_play")}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const { href, label, class: className = "" } = Astro.props;
"inline-flex items-center gap-2 rounded-lg border border-white/15 bg-white/5 px-4 py-2 text-sm font-medium text-white/80 transition-colors hover:border-white/25 hover:bg-white/10 print:hidden",
className,
]}
data-track="whitepaper_pdf_download"
data-track-cta-location="whitepaper_header"
>
<svg
class="h-4 w-4"
Expand Down
19 changes: 12 additions & 7 deletions website/src/components/layout/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
getLocaleFromUrl,
getTextDirection,
getAlternateUrls,
removeLocaleFromUrl,
createTranslator,
} from "@/utils/i18n";
import { generateBreadcrumbs } from "@/utils/build-json-ld";
Expand All @@ -46,23 +47,27 @@ const currentLocale = getLocaleFromUrl(Astro.url.pathname);
const t = await createTranslator(currentLocale);
const textDirection = getTextDirection(currentLocale);

// Fix canonical for default locale duplicate content
// Fix canonical for default locale duplicate content (e.g. /en-US/about → /about)
let canonical = metadata.canonical;
const currentPath = Astro.url.pathname;

if (
currentLocale === DEFAULT_LOCALE &&
currentPath.startsWith(`/${DEFAULT_LOCALE}`)
) {
const rootPath = currentPath.replace(`/${DEFAULT_LOCALE}`, "") || "/";
canonical = `${env.SITE_BASE_URL}${rootPath}`;
canonical = `${env.SITE_BASE_URL}${removeLocaleFromUrl(currentPath)}`;
}

const alternates = getAlternateUrls(currentPath);
const languageAlternates = Object.entries(alternates).map(([lang, path]) => ({
href: `${env.SITE_BASE_URL}${path}`,
hrefLang: lang,
}));
const defaultHref = `${env.SITE_BASE_URL}${alternates[DEFAULT_LOCALE]}`;
const languageAlternates = [
...Object.entries(alternates).map(([lang, path]) => ({
href: `${env.SITE_BASE_URL}${path}`,
hrefLang: lang,
})),
// Fallback language for unmatched locales (Google hreflang requirement)
{ href: defaultHref, hrefLang: "x-default" },
];

const breadcrumbs = generateBreadcrumbs({
pathname: currentPath,
Expand Down
2 changes: 2 additions & 0 deletions website/src/components/layout/footer/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
getLocalizedPath,
} from "@/utils/i18n";
import LanguageSwitcher from "@/components/ui/LanguageSwitcher.astro";
import { trackAttrs } from "@/scripts/shared/analytics";

const locale = getLocaleFromUrl(Astro.url.pathname);
const t = await createTranslator(locale);
Expand Down Expand Up @@ -79,6 +80,7 @@ const isCurrentPage = (href: string) =>
"text-content-55 hover:text-content-90 mb-3.5 block text-[13px] no-underline transition-colors duration-200",
isCurrentPage(link.href) && "text-content-90",
)}
{...trackAttrs(link.track, link.trackParams)}
>
{t(link.label)}
</a>
Expand Down
Loading