Skip to content

Commit

Permalink
Fix issues with website deploy (#6151)
Browse files Browse the repository at this point in the history
* fixes

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
aliabd and gradio-pr-bot committed Oct 30, 2023
1 parent 9c3bf31 commit e67e3f8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/quick-beds-tell.md
@@ -0,0 +1,5 @@
---
"website": minor
---

feat:Fix issues with website deploy
3 changes: 2 additions & 1 deletion js/_website/generate_jsons/src/docs/__init__.py
Expand Up @@ -268,6 +268,7 @@ def organize_docs(d):
organized["py-client"][cls]["prev_obj"] = organized["py-client"][
c_keys[len(c_keys) - 2]
]["name"]
organized["py-client"][cls]["next_obj"] = "JS-Client"
else:
organized["py-client"][cls]["prev_obj"] = organized["py-client"][
c_keys[i - 1]
Expand Down Expand Up @@ -321,7 +322,7 @@ def organize_docs(d):
js_pages.sort()


return {"docs": organized, "pages": pages, "js": js, "js_pages": js_pages}
return {"docs": organized, "pages": pages, "js": js, "js_pages": js_pages, "js_client": readme_content}


docs = organize_docs(docs)
Expand Down
6 changes: 6 additions & 0 deletions js/_website/src/lib/components/DocsNav.svelte
Expand Up @@ -235,4 +235,10 @@
href="./{name}/">{obj.name}</a
>
{/each}

<a
class:current_nav_link={current_nav_link == "js-client"}
class="link px-4 my-2 block"
href="./js-client/">JavaScript Client</a
>
</div>
4 changes: 3 additions & 1 deletion js/_website/src/routes/[[version]]/docs/+layout.server.ts
Expand Up @@ -35,6 +35,7 @@ export async function load({ params, url }) {
let py_client = docs_json.docs["py-client"];
let js = docs_json.js || {};
let js_pages = docs_json.js_pages || [];
let js_client = docs_json.js_client;
let on_main = params.version === "main";
let wheel: string = WHEEL;
let pages: string[] = docs_json.pages;
Expand All @@ -50,6 +51,7 @@ export async function load({ params, url }) {
js_pages,
on_main,
wheel,
pages
pages,
js_client
};
}
5 changes: 4 additions & 1 deletion js/_website/src/routes/[[version]]/docs/js/+page.server.ts
Expand Up @@ -3,5 +3,8 @@ import { redirect } from "@sveltejs/kit";
export const prerender = true;

export function load({ params }) {
throw redirect(302, `./js/accordion`);
if (params?.version)
throw redirect(302, `/${params?.version}/docs/js/accordion`);

throw redirect(302, `/docs/js/accordion`);
}

0 comments on commit e67e3f8

Please sign in to comment.