-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display version number that introduced schema
- Loading branch information
1 parent
87f8a89
commit 178d6f4
Showing
4 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
import options from 'src/options.json'; | ||
const { version } = Astro.props; | ||
const url = `${options.git.githubRepoUrl}/releases/tag/${version}`; | ||
--- | ||
|
||
<style> | ||
.VersionLink { | ||
display: inline-block; | ||
padding-inline: var(--space-xs); | ||
border-radius: var(--radius-full); | ||
font-size: var(--font-size-sm); | ||
background-color: var(--color-bg-elevated); | ||
border: 1px solid var(--color-border-default); | ||
color: var(--color-fg-muted); | ||
text-decoration: none; | ||
font-weight: 400; | ||
} | ||
</style> | ||
|
||
<a class="VersionLink" href={url} noreferrer noopener> | ||
Since {version} | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
import path from 'node:path'; | ||
import { getGitFirstTag } from 'astro-theme-docs'; | ||
import VersionLink from '@components/explorer/VersionLink.astro'; | ||
const { schema } = Astro.props; | ||
let firstVersion = null; | ||
const schemaPath = path.join('followthemoney', 'schema', `${schema.name}.yaml`); | ||
try { | ||
firstVersion = await getGitFirstTag(schemaPath); | ||
} catch (error) {} | ||
--- | ||
|
||
<style> | ||
.SchemaPageHeader { | ||
display: flex; | ||
flex-direction: column; | ||
row-gap: var(--space-sm); | ||
align-items: start; | ||
} | ||
|
||
.SchemaPageHeader__name { | ||
margin-block-end: 0; | ||
} | ||
</style> | ||
|
||
<header class="SchemaPageHeader"> | ||
<h1 class="SchemaPageHeader__name alpha">{schema.label}</h1> | ||
{firstVersion && <VersionLink version={firstVersion} />} | ||
|
||
{ | ||
schema.description && ( | ||
<p class="SchemaPageHeader__description lead">{schema.description}</p> | ||
) | ||
} | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters