Skip to content

Commit

Permalink
🐥 Support twitter as site option (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch authored Jan 23, 2024
1 parent a62438c commit 89d5489
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/healthy-dragons-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@myst-theme/common': patch
'@myst-theme/article': patch
'@myst-theme/book': patch
---

Support twitter as site option
4 changes: 4 additions & 0 deletions packages/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export function updateSiteManifestStaticLinksInplace(
data.options.logo_text = (data as any).logo_text;
delete (data as any).logo_text;
}
if ((data as any).twitter) {
data.options.twitter = (data as any).twitter;
delete (data as any).twitter;
}
if ((data as any).analytics_google) {
data.options.analytics_google = (data as any).analytics_google;
delete (data as any).analytics_google;
Expand Down
2 changes: 1 addition & 1 deletion themes/article/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { AppCatchBoundary as CatchBoundary } from '@myst-theme/site';
export const meta: MetaFunction = ({ data }) => {
return getMetaTagsForSite({
title: data?.config?.title,
twitter: data?.config?.twitter,
twitter: data?.config?.options?.twitter,
});
};

Expand Down
2 changes: 1 addition & 1 deletion themes/book/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { AppCatchBoundary as CatchBoundary } from '@myst-theme/site';
export const meta: MetaFunction = ({ data }) => {
return getMetaTagsForSite({
title: data?.config?.title,
twitter: data?.config?.twitter,
twitter: data?.config?.options?.twitter,
});
};

Expand Down

0 comments on commit 89d5489

Please sign in to comment.