-
-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: refactor social links configuration reference #869
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
76fbf54
docs: refactor social links configuration reference
HiDeoo 0057d1b
Merge branch 'main' into hd-docs-social-links
HiDeoo 7f25f55
docs: update supported link icons wording
HiDeoo 236c48f
Merge branch 'main' into hd-docs-social-links
HiDeoo b701399
chore: add changes from #881
HiDeoo b5d5843
chore: fix eof newline
HiDeoo 0201469
Merge branch 'main' into hd-docs-social-links
delucis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,7 @@ | ||
--- | ||
import { socialLinks } from '../../../packages/starlight/schemas/social'; | ||
|
||
const socials = [...socialLinks].sort((a, b) => a.localeCompare(b, 'en')); | ||
--- | ||
|
||
<code>{`Partial<Record<${socials.map((social) => `'${social}'`).join(' | ')}, string>>`}</code> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This component is very creative! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,7 +208,7 @@ interface BadgeConfig { | |
|
||
### `locales` | ||
|
||
**type:** <code>{ \[dir: string\]: [LocaleConfig](#localeconfig) }</code> | ||
**type:** <code>\{ \[dir: string\]: [LocaleConfig](#localeconfig) \}</code> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change required due to the MDX conversion to avoid interpreting this as an expression. |
||
|
||
[Configure internationalization (i18n)](/guides/i18n/) for your site by setting which `locales` are supported. | ||
|
||
|
@@ -308,7 +308,9 @@ The default locale will be used to provide fallback content where translations a | |
|
||
### `social` | ||
|
||
**type:** `Partial<Record<'bitbucket' | 'codeberg' | 'codePen' | 'discord' | 'email' | 'facebook' | 'github' | 'gitlab' | 'gitter' | 'instagram' | 'linkedin' | 'mastodon' | 'microsoftTeams' | 'rss' | 'stackOverflow' | 'telegram' | 'threads' | 'twitch' | 'twitter' | 'x.com' | 'youtube', string>>` | ||
import SocialLinksType from '../../../components/social-links-type.astro'; | ||
|
||
**type:** <SocialLinksType /> | ||
|
||
Optional details about the social media accounts for this site. Adding any of these will display them as icon links in the site 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relying on
localeCompare()
in the compare function instead of a basicsort()
to ensure a case-insensitive sort so thatcodeberg
appears beforecodePen
in the list for example.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Initially, I wondered if we should sort with the current page’s locale instead of always
en
, but on second thoughts, given this list’s contents, this makes sense 👍