Skip to content

Commit

Permalink
remove prefix for dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
“BogdanDanilescu” committed Nov 29, 2024
1 parent 6069bf9 commit cb2d4f7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
8 changes: 0 additions & 8 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import { withContentlayer } from 'next-contentlayer';

const isGitHubPages = Boolean(process.env.GITHUB_PAGES);
const isNextExport = Boolean(process.env.NEXT_EXPORT);

const prefix = isGitHubPages ? '/govie-ds' : undefined;

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
trailingSlash: true,
basePath: prefix,
assetPrefix: prefix,
output: isNextExport ? 'export' : 'standalone',
images: {
unoptimized: true, // TODO: review image optimisation
},
publicRuntimeConfig: {
basePath: prefix,
},
};

export default withContentlayer(nextConfig);
3 changes: 1 addition & 2 deletions apps/docs/public/templates/search-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<title>Home</title>
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="/static/css/ogcio-ds-0.4.4.min.css" />
<script src="https://cdn.tailwindcss.com"></script>
<style>
*,
Expand Down Expand Up @@ -2057,7 +2056,7 @@ <h2 class="gi-heading-lg">Filters</h2>
</div>
</footer>

<script src="/static/js/govie-frontend.umd.js"></script>
<script src="/govie-frontend.umd.js"></script>
<div class="notyf"></div>
<div
class="notyf-announcer"
Expand Down
5 changes: 1 addition & 4 deletions apps/docs/src/components/document/common/image.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import NextImage, { ImageProps } from 'next/image';
import { config } from '@/lib/config';

export function Image(props: ImageProps) {
const imageSource = config.isGitHubPages()
? `/govie-ds${props.src}`
: props.src;
const imageSource = props.src;

return <NextImage {...props} src={imageSource} />;
}
2 changes: 0 additions & 2 deletions apps/docs/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ function isProduction() {
}

export type DocumentSiteConfiguration = {
isGitHubPages: () => boolean;
showDrafts: () => boolean;
buildingBlocksHomeUrl: string;
feedbackFormUrl: string;
Expand All @@ -23,7 +22,6 @@ function getConfiguration(
environment: DocumentSiteEnvironment,
): DocumentSiteConfiguration {
const defaultConfiguration: DocumentSiteConfiguration = {
isGitHubPages: () => process.env.GITHUB_PAGES === 'true',
showDrafts: () => {
// Show drafts setting takes precedence
if (process.env.NEXT_PUBLIC_SHOW_DRAFTS) {
Expand Down

0 comments on commit cb2d4f7

Please sign in to comment.