Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { devServerFileWatcher } from './config/integrations/dev-server-file-watc
import { sitemap } from './config/integrations/sitemap';
import { makeLocalesConfig } from './config/locales';
import { starlightPluginLlmsTxt } from './config/plugins/llms-txt';
import { starlightPluginAutolinkHeadings } from './config/plugins/rehype-autolink';
import { rehypeTasklistEnhancer } from './config/plugins/rehype-tasklist-enhancer';
import { remarkFallbackLang } from './config/plugins/remark-fallback-lang';

Expand All @@ -33,30 +32,29 @@ export default defineConfig({
},
components: {
EditLink: './src/components/starlight/EditLink.astro',
Head: './src/components/starlight/Head.astro',
Hero: './src/components/starlight/Hero.astro',
MarkdownContent: './src/components/starlight/MarkdownContent.astro',
MobileTableOfContents: './src/components/starlight/MobileTableOfContents.astro',
TableOfContents: './src/components/starlight/TableOfContents.astro',
PageSidebar: './src/components/starlight/PageSidebar.astro',
Pagination: './src/components/starlight/Pagination.astro',
Footer: './src/components/starlight/Footer.astro',
SiteTitle: './src/components/starlight/SiteTitle.astro',
Search: './src/components/starlight/Search.astro',
Sidebar: './src/components/starlight/Sidebar.astro',
MobileMenuFooter: './src/components/starlight/MobileMenuFooter.astro',
PageTitle: './src/components/starlight/PageTitle.astro',
},
routeMiddleware: './src/routeData.ts',
editLink: {
baseUrl: 'https://github.com/withastro/docs/edit/main',
},
defaultLocale: 'en',
locales: makeLocalesConfig(),
sidebar,
social: {
github: 'https://github.com/withastro/astro',
discord: 'https://astro.build/chat',
},
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/astro' },
{ icon: 'discord', label: 'Discord', href: 'https://astro.build/chat' },
],
pagefind: false,
head: [
// Add ICO favicon fallback for Safari.
Expand All @@ -70,7 +68,7 @@ export default defineConfig({
},
],
disable404Route: true,
plugins: [starlightPluginAutolinkHeadings(), starlightPluginLlmsTxt()],
plugins: [starlightPluginLlmsTxt()],
}),
sitemap(),
],
Expand Down
121 changes: 0 additions & 121 deletions config/plugins/rehype-autolink.ts

This file was deleted.

6 changes: 3 additions & 3 deletions config/plugins/remark-fallback-lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export function remarkFallbackLang(): Plugin<[], Root> {
};
}

export function mdFilePathToUrl(mdFilePath: string, pageSourceDir: string, baseUrl: string) {
function mdFilePathToUrl(mdFilePath: string, pageSourceDir: string, baseUrl: string) {
const pathBelowRoot = path.relative(pageSourceDir, mdFilePath);
const pathname = pathBelowRoot.replace(/\\/g, '/').replace(/\.mdx?$/i, '/');

return new URL(pathname, baseUrl);
}

export function getLanguageCodeFromPathname(pathname: string) {
function getLanguageCodeFromPathname(pathname: string) {
// Assuming that `pathname` always starts with a `/`, retrieve the first path part,
// which is usually the language code
const firstPathPart = pathname.split('/')[1];
Expand All @@ -70,7 +70,7 @@ export function getLanguageCodeFromPathname(pathname: string) {
*
* If no existing file is found, returns `undefined`.
*/
export function tryFindSourceFileForPathname(pathname: string, pageSourceDir: string) {
function tryFindSourceFileForPathname(pathname: string, pageSourceDir: string) {
const possibleSourceFilePaths = [
path.join(pageSourceDir, pathname, '.') + '.md',
path.join(pageSourceDir, pathname, 'index.md'),
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@eslint/js": "^9.17.0",
"@types/canvas-confetti": "^1.6.0",
"@types/hast": "^3.0.4",
"@types/html-escaper": "^3.0.2",
"@types/mdast": "^4.0.4",
"@types/node": "^20.17.10",
"@typescript-eslint/parser": "^8.19.1",
Expand All @@ -45,9 +44,7 @@
"fast-glob": "^3.3.3",
"globals": "^15.14.0",
"hast-util-select": "^6.0.3",
"hast-util-to-string": "^3.0.1",
"hastscript": "^9.0.0",
"html-escaper": "^3.0.3",
"htmlparser2": "^9.1.0",
"kleur": "^4.1.5",
"mdast-util-to-string": "^4.0.0",
Expand All @@ -64,12 +61,11 @@
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/sitemap": "^3.3.0",
"@astrojs/starlight": "^0.31.1",
"@expressive-code/plugin-collapsible-sections": "^0.40.2",
"@astrojs/starlight": "^0.34.4",
"@expressive-code/plugin-collapsible-sections": "^0.41.2",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@4c8b9b0",
"canvas-confetti": "^1.6.0",
"jsdoc-api": "^9.3.4",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.1",
"remark-smartypants": "^2.0.0",
Expand Down
Loading