Skip to content

Commit

Permalink
feat: home page and metadata additions
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed May 1, 2024
1 parent 20d327d commit d82a759
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FXHU

Daily foreign exchange rates as published by the National Bank of Hungary (Magyar Nemzeti Bank, MNB).
Exchange rates API sourced from the National Bank of Hungary (Magyar Nemzeti Bank, MNB).

## Rate-setting methodology

Expand Down
49 changes: 49 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@ import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";
import starlightOpenAPI, { openAPISidebarGroups } from "starlight-openapi";

import { buildId } from "./src/utils/buildId";
import { socialImageHeight, socialImageWidth } from "./src/utils/socialImage";

export default defineConfig({
site: "https://fxhu.kripod.dev",
trailingSlash:
// TODO: Use 'always', see: https://github.com/withastro/astro/issues/10149
import.meta.env.PROD ? "always" : "ignore",
integrations: [
starlight({
title: "FXHU",
description:
"Exchange rates API sourced from the National Bank of Hungary (Magyar Nemzeti Bank, MNB).",
social: {
github: "https://github.com/kripod/fxhu",
},
editLink: {
baseUrl: "https://github.com/kripod/fxhu/edit/main/",
},
plugins: [
starlightOpenAPI([
{
Expand All @@ -21,6 +32,44 @@ export default defineConfig({
]),
],
sidebar: [...openAPISidebarGroups],
head: [
{
tag: "link",
attrs: {
rel: "icon",
href: "/favicon.ico",
sizes: "48x48",
},
},
{
tag: "meta",
attrs: {
property: "og:image",
content: "/assets/social-image.png?v=" + buildId,
},
},
{
tag: "meta",
attrs: {
property: "og:image:width",
content: socialImageWidth.toString(),
},
},
{
tag: "meta",
attrs: {
property: "og:image:height",
content: socialImageHeight.toString(),
},
},
{
tag: "meta",
attrs: {
name: "twitter:card",
content: "summary_large_image",
},
},
],
}),
],
});
Binary file added public/favicon.ico
Binary file not shown.
File renamed without changes
23 changes: 20 additions & 3 deletions src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
---
title: TODO
title: FXHU
editUrl: false
head:
- tag: title
content: FXHU
template: splash
hero:
tagline: Exchange rates API sourced from the National Bank of Hungary (Magyar Nemzeti Bank, MNB).
image:
file: ../../../public/favicon.svg
actions:
- text: Get started
link: /docs/v1/
variant: primary
icon: right-arrow
- text: View on GitHub
link: https://github.com/kripod/fxhu
icon: external
attrs:
rel: me
---

TODO
3 changes: 3 additions & 0 deletions src/utils/buildId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const buildId = import.meta.env.CF_PAGES_COMMIT_SHA
? import.meta.env.CF_PAGES_COMMIT_SHA.slice(0, 7)
: Date.now().toString();
2 changes: 2 additions & 0 deletions src/utils/socialImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const socialImageWidth = 1200;
export const socialImageHeight = 628;

0 comments on commit d82a759

Please sign in to comment.