Skip to content

Commit

Permalink
Roughly fix layout
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeGinnivan committed Aug 18, 2024
1 parent 4949d07 commit e84e859
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
1 change: 1 addition & 0 deletions website/app/lib/mdx.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
}

Expand Down
41 changes: 13 additions & 28 deletions website/app/routes/_layout.$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
Expand Down Expand Up @@ -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<typeof loader>) {
return (
<div className={styledSidebarContainer}>
<styled.h1 fontSize="3xl">{frontmatter.title}</styled.h1>
<main id="content" dangerouslySetInnerHTML={{ __html: post }} />
<Grid gridTemplateColumns="1fr auto">
<main id="content">
<styled.h1 fontSize="3xl">{frontmatter.title}</styled.h1>
<Box dangerouslySetInnerHTML={{ __html: post }} />
</main>
<aside>
<EventDetailsSummary conferenceState={conferenceState} currentPath={currentPath} />
<h2>Important Dates</h2>
{/* TODO Important date list */}
{/* <ImportantDatesList layout="inline" conference={conference} currentDate={currentDate} /> */}
</aside>
</div>
</Grid>
)
}

Expand Down
3 changes: 0 additions & 3 deletions website/server.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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) => {
Expand Down

0 comments on commit e84e859

Please sign in to comment.