Skip to content

Commit

Permalink
Run prettier on docs files
Browse files Browse the repository at this point in the history
  • Loading branch information
huijing committed Sep 20, 2023
1 parent 9206cbd commit 475120e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
10 changes: 5 additions & 5 deletions docs/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
import { defineCollection } from 'astro:content'
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
};
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() })
}
16 changes: 8 additions & 8 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ hero:
variant: primary
---

import { Card, CardGrid } from "@astrojs/starlight/components";
import { Card, CardGrid } from '@astrojs/starlight/components'

<CardGrid>
<a class="card-link" href="/apis/resource-server/">
<Card title="View the API reference" icon="document">
<a class='card-link' href='/apis/resource-server/'>
<Card title='View the API reference' icon='document'>
Consult the OpenAPI specifications
</Card>
</a>
<a
class="card-link"
href="https://github.com/interledger/open-payments"
target="_blank"
rel="noopener noreferrer"
class='card-link'
href='https://github.com/interledger/open-payments'
target='_blank'
rel='noopener noreferrer'
>
<Card title="Contribute on Github" icon="external">
<Card title='Contribute on Github' icon='external'>
Join the community
</Card>
</a>
Expand Down
44 changes: 22 additions & 22 deletions docs/src/overrideIntegration.mjs
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
import fs from "fs";
import path from "path";
import fs from 'fs'
import path from 'path'

const LOCAL_COMPONENT_DIR = "src/overrides";
const LOCAL_COMPONENT_DIR = 'src/overrides'

export default function overrideIntegration() {
return {
name: "overrides",
name: 'overrides',
hooks: {
"astro:config:setup"({ updateConfig, config }) {
'astro:config:setup'({ updateConfig, config }) {
const components = fs
.readdirSync("./" + LOCAL_COMPONENT_DIR)
.filter((x) => x.endsWith(".astro"));
.readdirSync('./' + LOCAL_COMPONENT_DIR)
.filter((x) => x.endsWith('.astro'))

updateConfig({
vite: {
plugins: [
{
enforce: "pre",
name: "override",
enforce: 'pre',
name: 'override',
async resolveId(source, importer) {
for (const component of components) {
if (
source.endsWith(component) &&
!source.includes(LOCAL_COMPONENT_DIR) &&
!source.includes("node_modules")
!source.includes('node_modules')
) {
if (importer.includes(LOCAL_COMPONENT_DIR)) {
return path.resolve(
"./node_modules/@astrojs/starlight/components/" +
'./node_modules/@astrojs/starlight/components/' +
component
);
)
} else {
return path.resolve(
"./" + LOCAL_COMPONENT_DIR + "/" + component
);
'./' + LOCAL_COMPONENT_DIR + '/' + component
)
}
}
}
},
},
],
},
});
},
},
};
}
}
]
}
})
}
}
}
}

0 comments on commit 475120e

Please sign in to comment.