From e84e859b0f85979a33badc43abb23877d8b5f16e Mon Sep 17 00:00:00 2001 From: Jake Ginnivan Date: Sun, 18 Aug 2024 16:19:24 +0800 Subject: [PATCH] Roughly fix layout --- website/app/lib/mdx.server.ts | 1 + website/app/routes/_layout.$.tsx | 41 ++++++++++---------------------- website/server.init.ts | 3 --- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/website/app/lib/mdx.server.ts b/website/app/lib/mdx.server.ts index d0d9d4a..79ef40d 100644 --- a/website/app/lib/mdx.server.ts +++ b/website/app/lib/mdx.server.ts @@ -53,6 +53,7 @@ const websitePagesBySlug = toPagesBySlug(websitePagesFiles, '../../../website-co export function getPage(slug: string) { const contents = websitePagesBySlug[slug] if (!contents) { + console.log('contents', websitePagesBySlug, slug) throw new Response('Not Found', { status: 404, statusText: 'Not Found' }) } diff --git a/website/app/routes/_layout.$.tsx b/website/app/routes/_layout.$.tsx index 9ba8b86..1806be3 100644 --- a/website/app/routes/_layout.$.tsx +++ b/website/app/routes/_layout.$.tsx @@ -9,7 +9,7 @@ import getConferenceActions from '~/lib/conference-actions' import { ConferenceState } from '~/lib/config-types' import { CACHE_CONTROL } from '~/lib/http.server' import { css } from '../../styled-system/css' -import { Box, styled } from '../../styled-system/jsx' +import { Box, Grid, styled } from '../../styled-system/jsx' import { conferenceConfig } from '../config/conference-config' import { socials } from '../config/socials' import { renderMdx } from '../lib/mdx-render.server' @@ -20,7 +20,12 @@ export async function loader({ params, request, context }: LoaderFunctionArgs) { if (!contentSlug) { throw new Error('Expected contentSlug param') } + const requestUrl = new URL(request.url) + if (requestUrl.pathname.startsWith('/static')) { + throw new Response('Not Found', { status: 404, statusText: 'Not Found' }) + } + const siteUrl = requestUrl.protocol + '//' + requestUrl.host const post = getPage(contentSlug) @@ -108,42 +113,22 @@ export default function WebsiteContentPage() { ) } -export const styledSidebarContainer = css({ - display: 'table', - tableLayout: 'fixed', - marginTop: 'xl', - marginBottom: 'xl', - - ['@supports(display: grid)']: { - display: 'grid', - gridGap: 'md', - - md: { - gridTemplateColumns: 'minmax(1rem, 1fr) minmax(0, 90ch) minmax(0, 30ch) minmax(1rem, 1fr)', - - '&main': { - gridColumn: 2, - }, - - '&aside': { - gridColumn: 3, - }, - }, - }, -}) +export const styledSidebarContainer = css({}) function ContentPageWithSidebar({ frontmatter, post, currentPath, conferenceState }: SerializeFrom) { return ( -
- {frontmatter.title} -
+ +
+ {frontmatter.title} + +
-
+ ) } diff --git a/website/server.init.ts b/website/server.init.ts index 857fcb6..c8ed153 100644 --- a/website/server.init.ts +++ b/website/server.init.ts @@ -2,7 +2,6 @@ import { SpanStatusCode, trace } from '@opentelemetry/api' import { createRequestHandler } from '@remix-run/express' import type { ServerBuild } from '@remix-run/node' -import { installGlobals } from '@remix-run/node' import closeWithGrace from 'close-with-grace' import compression from 'compression' import express from 'express' @@ -13,8 +12,6 @@ const tracer = trace.getTracerProvider().getTracer('server') export function init() { return tracer.startActiveSpan('start', async (span) => { - installGlobals() - console.log('Starting') try { process.on('uncaughtException', (err: Error) => {