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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "qwik-monorepo",
"version": "0.0.20-5",
"scripts": {
"build": "yarn node scripts --tsc --build --platform-binding-wasm-copy",
"build": "yarn node scripts --tsc --build --api --platform-binding-wasm-copy",
"build.full": "yarn node scripts --tsc --build --api --eslint --platform-binding --wasm",
"build.platform": "yarn node scripts --platform-binding",
"build.platform.copy": "yarn node scripts --platform-binding-wasm-copy",
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"devDependencies": {
"@builder.io/partytown": "^0.5.4",
"@builder.io/qwik": "workspace:*",
"@builder.io/qwik-city": "0.0.4",
"@builder.io/qwik": "0.0.20-5",
"@builder.io/qwik-city": "0.0.5",
"@cloudflare/kv-asset-handler": "0.2.0",
"@cloudflare/workers-types": "^3.10.0",
"autoprefixer": "10.4.7",
Expand Down
13 changes: 3 additions & 10 deletions packages/docs/src/components/on-this-page/on-this-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export const OnThisPage = component$(
() => {
useScopedStyles$(styles);
const page = usePage();
if (!page) {
return null;
}

const headings = page.headings.filter((h) => h.level === 2 || h.level === 3);

Expand All @@ -18,15 +21,6 @@ export const OnThisPage = component$(
'https://github.com/BuilderIO/qwik/edit/main/packages/docs/pages/'
);

const onScroll = $(() => {
// const ev = useEvent();
// console.log('scroll', ev);
});

const onClick = $(() => {
// const ev = useEvent();
// console.log('onClick', ev);
});
return (
<Host class="on-this-page fixed text-sm z-20 bottom-0 right-[max(0px,calc(50%-45rem))] overflow-y-auto hidden xl:block xl:w-[18rem] xl:top-[5rem]">
{headings.length > 0 ? (
Expand All @@ -41,7 +35,6 @@ export const OnThisPage = component$(
block: true,
indent: h.level > 2,
}}
onClickQrl={onClick}
>
{h.text}
</a>
Expand Down
4 changes: 4 additions & 0 deletions packages/docs/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const SideBar = component$(
const navIndex = usePageIndex();
const globalStore = useContext(GlobalStore);

if (!page) {
return null;
}

return (
<Host class="sidebar">
<nav class="breadcrumbs">
Expand Down
4 changes: 2 additions & 2 deletions packages/qwik-city/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik-city",
"version": "0.0.4",
"version": "0.0.5",
"description": "Static Site Generator for Qwik",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand All @@ -15,7 +15,7 @@
"@types/mdx": "2.0.2"
},
"devDependencies": {
"@builder.io/qwik": "workspace:*",
"@builder.io/qwik": "0.0.20-5",
"@microsoft/api-extractor": "7.24.0",
"@types/github-slugger": "^1.3.0",
"@types/marked": "^4.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/qwik-city/src/runtime/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const setHeadMeta: (elm: any, meta: MetaOptions) => void;
export const setHeadStyles: (elm: any, styles: HeadStyles) => void;

// @public (undocumented)
export const usePage: () => PageHandler;
export const usePage: () => PageHandler | undefined;

// @public (undocumented)
export const usePageIndex: () => PageIndex | null;
Expand Down
4 changes: 2 additions & 2 deletions packages/qwik-city/src/runtime/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export const useQwikCity = () => {
/**
* @public
*/
export const usePage = (): PageHandler => {
export const usePage = (): PageHandler | undefined => {
const page = useContext(QwikCityContext);
return page;
return page.content ? page : undefined;
};

const loadPage = async (href: string): Promise<PageHandler | null> => {
Expand Down
Loading