Skip to content

Commit fddf290

Browse files
committed
refactor: Tweak repo config to include org
1 parent 358ada0 commit fddf290

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"tr": "Turkish",
1313
"zh": "简体中文"
1414
},
15-
"repo": "preact",
15+
"repo": "preactjs/preact",
1616
"docsearch": {
1717
"apiKey": "842e1531d4af13c18b4718c456e386b2",
1818
"indexName": "preact",

src/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function prerender() {
6666

6767
// Preloading
6868
// These are all low priority, non-blocking fetches that we just want to have started early. None are critical due to prerendering.
69-
{ type: 'link', props: { rel: 'preload', href: '/.netlify/functions/release?repo=preact', as: 'fetch', fetchpriority: 'low' } },
69+
{ type: 'link', props: { rel: 'preload', href: '/.netlify/functions/release?repo=preactjs/preact', as: 'fetch', fetchpriority: 'low' } },
7070
location.pathname == '/' && { type: 'link', props: { rel: 'preload', href: '/.netlify/functions/repos?org=preactjs', as: 'fetch', fetchpriority: 'low' } },
7171
{ type: 'link', props: { rel: 'preload', href: '/contributors.json', as: 'fetch', fetchpriority: 'low' } },
7272
// Hardcoding English is intentional, first render always fetches it with user preference only being applied later

src/lambda/release.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
* @param {unknown} [_context]
44
*/
55
export default async function releaseLambda(req, _context) {
6-
const repo = req?.url ? new URL(req.url).searchParams.get('repo') : 'preact';
6+
const repo = req?.url
7+
? new URL(req.url).searchParams.get('repo')
8+
: 'preactjs/preact';
79

8-
const { version, url } = await fetchRelease(`preactjs/${repo}`);
10+
const { version, url } = await fetchRelease(repo);
911

1012
return new Response(JSON.stringify({ version, url }), {
1113
status: 200,

0 commit comments

Comments
 (0)