Skip to content

Commit

Permalink
🐛 Exports may not be defined in article theme (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Aug 1, 2023
1 parent ffa30b5 commit 6df3c3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-icons-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@myst-theme/article': patch
---

Exports may not be defined
4 changes: 2 additions & 2 deletions themes/article/app/routes/$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export function ArticlePage({ article }: { article: PageLoader }) {

const isIndex = article.slug === project?.index;

const downloads = [...(project?.exports ?? []), ...(project?.pages?.[0].exports ?? [])];
const downloads = [...(project?.exports ?? []), ...(project?.pages?.[0]?.exports ?? [])];
return (
<ReferencesProvider
references={{ ...article.references, article: article.mdast }}
Expand Down Expand Up @@ -300,7 +300,7 @@ export function ArticlePage({ article }: { article: PageLoader }) {
</Link>
<div className="flex-grow text-center">{article.frontmatter.title}</div>
<a
href={article.frontmatter.exports?.[0].url}
href={article.frontmatter?.exports?.[0]?.url}
className="flex gap-1 px-2 py-1 font-normal no-underline border rounded bg-slate-200 border-slate-600 hover:bg-slate-800 hover:text-white hover:border-transparent"
>
<DocumentArrowDownIcon className="self-center w-4 h-4 transition-transform group-hover:-translate-x-1 shrink-0" />
Expand Down

0 comments on commit 6df3c3d

Please sign in to comment.