Skip to content

Commit

Permalink
Make this site embeddable into another
Browse files Browse the repository at this point in the history
Because of the way fresh works it uses "clean" urls, relative paths
don't really work.

This gets rid of all "basing" elements and uses absolute urls which
are relative to the root of this site. Since we're rebasing on the
consuming edge, this is fine.

In the future, we'll use directory urls for everything.
  • Loading branch information
cowboyd committed Dec 17, 2024
1 parent da5f9ec commit 7552e8b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions www/components/DocsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function SidebarCategory(props: {

return (
<li class="my-2 block">
<a href={href} class={outerLink}>{title}</a>
<a href={`/${href}`} class={outerLink}>{title}</a>
{entries.length > 0 && (
<ol class="pl-4 list-decimal nested">
{entries.map((entry) => (
Expand All @@ -49,7 +49,7 @@ export function SidebarEntry(props: {

return (
<li class="my-0.5">
<a href={href} class={innerLink}>{title}</a>
<a href={`/${href}`} class={innerLink}>{title}</a>
</li>
);
}
2 changes: 1 addition & 1 deletion www/components/DocsTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function DocsTitle(props: { title: string }) {
return (
<>
<a
href="."
href="/"
class="text(2xl gray-900) block flex items-center"
>
GraphGen
Expand Down
4 changes: 2 additions & 2 deletions www/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default function Header(props: { title: string; active: string }) {

function Logo() {
return (
<a href="." class="flex mr-3 items-center">
<a href="/" class="flex mr-3 items-center">
<img
src="logo.svg"
src="/logo.svg"
alt="GraphGen logo"
width={40}
height={46}
Expand Down
4 changes: 2 additions & 2 deletions www/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function NavigationBar(
const items = [
{
name: "Docs",
href: "docs/introduction",
href: "/docs/introduction",
},
{
name: "Discord",
Expand All @@ -15,7 +15,7 @@ export default function NavigationBar(
];
const isHome = props.active == "/";
return (
<nav class={"flex " + props.class ?? ""}>
<nav class={"flex " + (props.class ?? "")}>
<ul class="flex justify-center items-center gap-4 mx-4 my-6 flex-wrap">
{items.map((item) => (
<li>
Expand Down
3 changes: 1 addition & 2 deletions www/routes/docs/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export default function DocsPage(props: PageProps<Data>) {
<>
<Head>
<title>{props.data.page?.title ?? "Not Found"} | graphgen docs</title>
<base href={props.data.base ?? "/"} />
<link rel="stylesheet" href={`gfm.css?build=${__FRSH_BUILD_ID}`} />
<link rel="stylesheet" href={`/gfm.css?build=${BUILD_ID}`} />
{description && <meta name="description" content={description} />}
</Head>
<div class="flex flex-col min-h-screen">
Expand Down

0 comments on commit 7552e8b

Please sign in to comment.