Skip to content

Commit

Permalink
Set Astro SITE and BASE_URL, don't add slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Jan 28, 2024
1 parent 42aef1f commit 7847d1d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion web/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ import lit from "@astrojs/lit";
// https://astro.build/config
export default defineConfig({
integrations: [lit()],
base: process.env.BASE_URL || '/',
site: process.env.SITE,
base: process.env.BASE_URL,
});
1 change: 0 additions & 1 deletion web/src/components/Intro.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<section>
<h2>About</h2>
<p>
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/Nav.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
import './Icon';
const baseUrl = import.meta.env.BASE_URL;
---

<nav>
<a class="site-name" href="/">
<a class="site-name" href={baseUrl}>
<icon-component iconName="email" iconWidth="2rem" iconHeight="1.8rem" />
<span class="site-name">Email Comparison</span>
</a>
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/ProviderLinks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { TransformedMailProvider } from '../types/MailServices';
import { transformMailProviders } from '../utils/transform-data';
const { mailProviders, title } = Astro.props;
const baseUrl = import.meta.env.BASE_URL;
const getPositives = (service: TransformedMailProvider) => {
return service.attributes.filter((attribute) => attribute.level === 1).map((attribute) => attribute.title);
}
Expand All @@ -29,7 +31,7 @@ const services = sortServicesByPositives(transformMailProviders(mailProviders));
<h2>{title || 'Reports'}</h2>
<div class="links">
{services.map((service: TransformedMailProvider) => (
<a href={`/email/${service.key}`}>
<a href={`${baseUrl}email/${service.key}`}>
<article title={makeSellingPointsString(service)}>
<div class="top">
<img width="64" src={service.icon} alt={service.name} />
Expand Down

0 comments on commit 7847d1d

Please sign in to comment.