Skip to content

Commit

Permalink
Merge branch 'develop' into chore/spell-checker-file-normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
nlc616 authored Jun 10, 2024
2 parents 4c7946a + 4d84c25 commit feaf6cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
7 changes: 5 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import sitemap from "@astrojs/sitemap";
import settings from "./src/settings.json";
import { imagetools } from 'vite-imagetools';
import mdx from "@astrojs/mdx";

const configRemarkCalloutDirectives = {
callouts: {
note: {
Expand All @@ -32,8 +33,10 @@ const configRemarkCalloutDirectives = {
}
};

// Environment mode
const env = import.meta.env.MODE || 'staging';
// Environment
const env = import.meta.env.PROD
? 'production'
: 'staging';

// https://astro.build/config
export default defineConfig({
Expand Down
14 changes: 11 additions & 3 deletions src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export async function getStaticPaths() {
}));
}
const back = () => {};
const { entry } = Astro.props;
const { Content } = await entry.render();
const { collection, id, slug } = entry;
Expand All @@ -33,7 +31,7 @@ const githubEditUrlPathname = generateGitHubEditLink({
slug={slug}
>
<article class="blog">
<div class="mb-10 w-fit" onclick="history.back()">
<div class="mb-10 w-fit" id="goBackButton">
<ButtonGray className="flex items-center justify-center gap-12 px-5">
<div>Go Back</div>
</ButtonGray>
Expand All @@ -50,3 +48,13 @@ const githubEditUrlPathname = generateGitHubEditLink({
<GithubEditLink pathname={githubEditUrlPathname} />
</article>
</BlogPageLayout>

<script>
document.getElementById('goBackButton')?.addEventListener('click', () => {
if (history.length > 2) {
history.back();
} else {
window.location.href = '/blog';
}
});
</script>

0 comments on commit feaf6cd

Please sign in to comment.