-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
073eafa
commit 3656c8f
Showing
11 changed files
with
392 additions
and
959 deletions.
There are no files selected for viewing
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,11 @@ | ||
--- | ||
"starlight-plugin-show-latest-version": minor | ||
--- | ||
|
||
⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now version `0.32.0`. | ||
|
||
Please use the `@astrojs/upgrade` command to upgrade your project: | ||
|
||
```sh | ||
npx @astrojs/upgrade | ||
``` |
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,5 @@ | ||
--- | ||
"starlight-plugin-show-latest-version-docs": patch | ||
--- | ||
|
||
Update documenation `/components` because the notes were too large |
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 |
---|---|---|
|
@@ -26,13 +26,13 @@ | |
"start": "astro dev" | ||
}, | ||
"dependencies": { | ||
"@astrojs/node": "^9.0.2", | ||
"@astrojs/starlight": "^0.31.1", | ||
"@trueberryless-org/starlight-plugins-docs-components": "^0.3.0", | ||
"astro": "^5.1.10", | ||
"@astrojs/node": "^9.1.0", | ||
"@astrojs/starlight": "^0.32.0", | ||
"@trueberryless-org/starlight-plugins-docs-components": "^0.4.1", | ||
"astro": "^5.3.0", | ||
"sharp": "^0.33.5", | ||
"starlight-contributor-list": "^0.2.0", | ||
"starlight-links-validator": "^0.14.1", | ||
"starlight-contributor-list": "^0.2.1", | ||
"starlight-links-validator": "^0.14.3", | ||
"starlight-plugin-show-latest-version": "workspace:*" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
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
21 changes: 21 additions & 0 deletions
21
packages/starlight-plugin-show-latest-version/components/DynamicVersionBadge.astro
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,21 @@ | ||
--- | ||
import pluginConfig from 'virtual:starlight-plugin-show-latest-version-config'; | ||
import VersionBadge from '../components/VersionBadge.astro'; | ||
--- | ||
|
||
{pluginConfig.showInSiteTitle === "true" && ( | ||
<VersionBadge /> | ||
)} | ||
{pluginConfig.showInSiteTitle === "deferred" && ( | ||
<VersionBadge server:defer /> | ||
)} | ||
|
||
{(pluginConfig.showInSiteTitle === "true" || pluginConfig.showInSiteTitle === "deferred") && ( | ||
<style is:global> | ||
.title-wrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
} | ||
</style> | ||
)} |
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
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
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
68 changes: 4 additions & 64 deletions
68
packages/starlight-plugin-show-latest-version/overrides/SiteTitle.astro
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 |
---|---|---|
@@ -1,67 +1,7 @@ | ||
--- | ||
import { Badge } from '@astrojs/starlight/components'; | ||
import { logos } from 'virtual:starlight/user-images'; | ||
import config from 'virtual:starlight/user-config'; | ||
import pluginConfig from 'virtual:starlight-plugin-show-latest-version-config'; | ||
import type { Props } from '../props'; | ||
import VersionBadge from '../components/VersionBadge.astro'; | ||
const { siteTitle, siteTitleHref } = Astro.props; | ||
import Default from '@astrojs/starlight/components/SiteTitle.astro' | ||
import DynamicVersionBadge from '../components/DynamicVersionBadge.astro' | ||
--- | ||
|
||
<a href={siteTitleHref} class="site-title sl-flex"> | ||
{ | ||
config.logo && logos.dark && ( | ||
<> | ||
<img | ||
class:list={{ 'light:sl-hidden': !('src' in config.logo) }} | ||
alt={config.logo.alt} | ||
src={logos.dark.src} | ||
width={logos.dark.width} | ||
height={logos.dark.height} | ||
/> | ||
{/* Show light alternate if a user configure both light and dark logos. */} | ||
{!('src' in config.logo) && ( | ||
<img | ||
class="dark:sl-hidden" | ||
alt={config.logo.alt} | ||
src={logos.light?.src} | ||
width={logos.light?.width} | ||
height={logos.light?.height} | ||
/> | ||
)} | ||
</> | ||
) | ||
} | ||
<span class:list={{ 'sr-only': config.logo?.replacesTitle }} translate="no"> | ||
{siteTitle} | ||
</span> | ||
{pluginConfig.showInSiteTitle === "true" && ( | ||
<VersionBadge /> | ||
)} | ||
{pluginConfig.showInSiteTitle === "deferred" && ( | ||
<VersionBadge server:defer> | ||
<Badge text={" "} variant={pluginConfig.badge.variant} size={pluginConfig.badge.size} slot="fallback" /> | ||
</VersionBadge> | ||
)} | ||
</a> | ||
|
||
|
||
<style> | ||
.site-title { | ||
align-items: center; | ||
gap: var(--sl-nav-gap); | ||
font-size: var(--sl-text-h4); | ||
font-weight: 600; | ||
color: var(--sl-color-text-accent); | ||
text-decoration: none; | ||
white-space: nowrap; | ||
} | ||
img { | ||
height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y)); | ||
width: auto; | ||
max-width: 100%; | ||
object-fit: contain; | ||
object-position: 0 50%; | ||
} | ||
</style> | ||
<Default><slot /></Default> | ||
<DynamicVersionBadge /> |
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
Oops, something went wrong.