Skip to content

Commit

Permalink
some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
its-miroma committed Feb 11, 2025
1 parent a4850e1 commit c3f0df3
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
config: .markdownlint-cli2.yaml
globs: |
**/*.md
!README.md
!**/node_modules
!**/.git
!**/node_modules
!README.md
!translated/**
!versions/**
4 changes: 3 additions & 1 deletion .vitepress/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ function generateTranslatedThemeConfig(localeCode: string): Fabric.ThemeConfig {
footer: {
copyright: websiteResolver("footer.copyright").replace(
"%s",
`<a href=\"https://github.com/FabricMC/fabric-docs/blob/main/LICENSE\" target=\"_blank\" rel=\"noreferrer\">${websiteResolver("footer.license")}</a>`
`<a href=\"https://github.com/FabricMC/fabric-docs/blob/main/LICENSE\" target=\"_blank\" rel=\"noreferrer\">${websiteResolver(
"footer.license"
)}</a>`
),
message: websiteResolver("footer.message"),
},
Expand Down
72 changes: 36 additions & 36 deletions .vitepress/sidebars/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default [
},
{
text: "develop.items.custom-enchantment-effects",
link: "/develop/items/custom-enchantment-effects"
link: "/develop/items/custom-enchantment-effects",
},
{
text: "develop.items.custom-data-components",
Expand Down Expand Up @@ -113,9 +113,9 @@ export default [
{
text: "develop.blocks.block-entity-renderer",
link: "/develop/blocks/block-entity-renderer",
}
]
}
},
],
},
],
},
{
Expand Down Expand Up @@ -209,38 +209,38 @@ export default [
],
},
{
text: "develop.dataGeneration",
collapsed: true,
items: [
{
text: "develop.dataGeneration.setup",
link: "/develop/data-generation/setup"
},
{
text: "develop.dataGeneration.tags",
link: "/develop/data-generation/tags"
},
{
text: "develop.dataGeneration.translations",
link: "/develop/data-generation/translations"
},
{
text: "develop.dataGeneration.advancements",
link: "/develop/data-generation/advancements"
},
{
text: "develop.dataGeneration.recipes",
link: "/develop/data-generation/recipes"
},
{
text: "develop.dataGeneration.lootTables",
link: "/develop/data-generation/loot-tables"
},
{
text: "develop.dataGeneration.blockModels",
link: "/develop/data-generation/block-models"
}
]
text: "develop.dataGeneration",
collapsed: true,
items: [
{
text: "develop.dataGeneration.setup",
link: "/develop/data-generation/setup",
},
{
text: "develop.dataGeneration.tags",
link: "/develop/data-generation/tags",
},
{
text: "develop.dataGeneration.translations",
link: "/develop/data-generation/translations",
},
{
text: "develop.dataGeneration.advancements",
link: "/develop/data-generation/advancements",
},
{
text: "develop.dataGeneration.recipes",
link: "/develop/data-generation/recipes",
},
{
text: "develop.dataGeneration.lootTables",
link: "/develop/data-generation/loot-tables",
},
{
text: "develop.dataGeneration.blockModels",
link: "/develop/data-generation/block-models",
},
],
},
{
text: "develop.misc",
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/sidebars/versioned/1.20.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
},
{
"text": "Yarn GitHub",
"processSidebarURLs": false,
"processSidebarURLs": false,
"translatable": false,
"link": "https://github.com/FabricMC/yarn"
},
{
"text": "Loom GitHub",
"processSidebarURLs": false,
"processSidebarURLs": false,
"translatable": false,
"link": "https://github.com/FabricMC/fabric-loom"
}
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/sidebars/versioned/1.21.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion .vitepress/theme/components/VersionReminder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ p.version {
gap: 8px;
}
}
</style>
</style>
19 changes: 14 additions & 5 deletions .vitepress/theme/components/VersionSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@ function buildRoutePath(
// e.g. /en/ -> /en/1.2.0/ or /en/1.2.0/ -> /en/1.3.0/
if (!isOnLatest) {
if (version === props.versioningPlugin.latestVersion) {
return currentPath.replace(`/${locale}/${currentVersion.value}/`, `/${locale}/`);
return currentPath.replace(
`/${locale}/${currentVersion.value}/`,
`/${locale}/`
);
} else {
// Replace any existing version segment with the new one
return currentPath.replace(`/${locale}/${currentVersion.value}/`, `/${locale}/${version}/`);
return currentPath.replace(
`/${locale}/${currentVersion.value}/`,
`/${locale}/${version}/`
);
}
} else {
// If currently on latest, just add the new version segment
Expand All @@ -95,12 +101,15 @@ function buildRoutePath(
// Navigate to the selected version
function visitVersion(version: string) {
const localeKeys = Object.keys(data.site.value.locales);
const isLocalized = localeKeys.some((key) => router.route.path.startsWith(`/${key}/`));
const isLocalized = localeKeys.some((key) =>
router.route.path.startsWith(`/${key}/`)
);
const locale = isLocalized
? localeKeys.find((key) => router.route.path.startsWith(`/${key}/`)) || null
: null;
const isOnLatest = currentVersion.value === props.versioningPlugin.latestVersion;
const isOnLatest =
currentVersion.value === props.versioningPlugin.latestVersion;
const route = buildRoutePath(router.route.path, locale, version, isOnLatest);
router.go(route);
Expand Down Expand Up @@ -257,4 +266,4 @@ function visitVersion(version: string) {
.group + .item {
padding-top: 4px;
}
</style>
</style>
32 changes: 17 additions & 15 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
font-family: "Flag Emoji Polyfill";
unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
src: url("./CountryFlagsPolyfill.woff2") format('woff2');
src: url("./CountryFlagsPolyfill.woff2") format("woff2");
font-display: swap;
}

Expand All @@ -24,23 +24,25 @@
--vp-c-brand-3: var(--vp-c-blue-1);
--vp-c-brand-soft: var(--vp-c-blue-soft);


/* Override Hero Text Gradient */
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg,
#3463fe 30%,
#4787ff);
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#3463fe 30%,
#4787ff
);

/* Flag Emoji Polyfill (Chrome does not render county flags on windows) */
--vp-font-family-base: 'Flag Emoji Polyfill', 'Inter', ui-sans-serif, system-ui, sans-serif,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--vp-font-family-base: "Flag Emoji Polyfill", "Inter", ui-sans-serif,
system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
}

:root:where(:lang(zh)) {
/* Flag Emoji Polyfill (Chrome does not render county flags on windows) */
--vp-font-family-base: 'Flag Emoji Polyfill', 'Punctuation SC', 'Inter', ui-sans-serif, system-ui,
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
--vp-font-family-base: "Flag Emoji Polyfill", "Punctuation SC", "Inter",
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
}

/* Sidebar Scrollbar - Styles scrollbars within the side navigation pane for improved visibility. */
Expand Down Expand Up @@ -90,12 +92,12 @@
}

/* Local Search Box Animations - Fade in backdrop and animate search box on appearance. */
.VPLocalSearchBox>.backdrop {
.VPLocalSearchBox > .backdrop {
opacity: 0;
animation: show 200ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;
}

.VPLocalSearchBox>.shell {
.VPLocalSearchBox > .shell {
animation: show 400ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;
opacity: 0;
transform: rotateX(-90deg);
Expand Down Expand Up @@ -137,8 +139,8 @@ kbd:not(.DocSearch-Button-Key) {
}

/* Center images within paragraphs. */
.vp-doc>p>img,
.vp-doc>div>p>img {
.vp-doc > p > img,
.vp-doc > div > p > img {
margin-left: auto;
margin-right: auto;
}
Expand All @@ -154,4 +156,4 @@ h1.vp-doc {
/* Custom Icons */
.vpi-versioning {
--icon: url("data:image/svg+xml;charset=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9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48cGF0aCBkPSJNMTcgN1Y4QzE3IDEwLjUgMTUgMTEgMTUgMTFMOSAxM0M5IDEzIDcgMTMuNSA3IDE2VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9yZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48L3N2Zz4=");
}
}
14 changes: 11 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{
"explorer.autoRevealExclude": {
"versions/**": true
},
"explorer.excludeGitIgnore": true,
"files.exclude": {
"translated/**": true,
"versions/**": true
},
"markdownlint.lintWorkspaceGlobs": [
"**/*.md",
"!**/node_modules",
"!versions/**",
"!node_modules/**",
"!README.md",
"!translated/**",
"!README.md"
"!versions/**"
]
}

0 comments on commit c3f0df3

Please sign in to comment.