Skip to content

Commit

Permalink
reword matbench discovery banner
Browse files Browse the repository at this point in the history
update deps
clean up import.meta.glob() calls
  • Loading branch information
janosh committed May 4, 2023
1 parent 228c121 commit 002dffb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 38 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,35 @@
"check": "svelte-check"
},
"devDependencies": {
"@iconify/svelte": "^3.1.1",
"@iconify/svelte": "^3.1.3",
"@rollup/plugin-yaml": "^4.0.1",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.15.5",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@sveltejs/kit": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"devalue": "^4.3.0",
"eslint": "^8.38.0",
"eslint": "^8.39.0",
"eslint-plugin-svelte3": "^4.0.0",
"hast-util-from-string": "^2.0.0",
"hast-util-select": "^5.0.5",
"hastscript": "^7.2.0",
"js-yaml": "^4.1.0",
"katex": "^0.16.4",
"katex": "^0.16.7",
"mdsvex": "^0.10.6",
"prettier": "^2.8.7",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-katex-svelte": "^1.1.2",
"rehype-slug": "^5.1.0",
"remark-math": "3.0.0",
"svelte": "^3.58.0",
"svelte-check": "^3.2.0",
"svelte-multiselect": "^8.6.0",
"svelte-check": "^3.3.0",
"svelte-multiselect": "^8.6.1",
"svelte-preprocess": "^5.0.3",
"svelte-preprocess-import-assets": "^1.0.0",
"svelte-zoo": "^0.4.3",
"svelte2tsx": "^0.6.11",
"svelte-zoo": "^0.4.5",
"svelte2tsx": "^0.6.12",
"typescript": "^5.0.4",
"vite": "^4.2.1"
"vite": "^4.3.4"
}
}
10 changes: 7 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
</p>

<strong>
Check out my latest work at <a href="https://matbench-discovery.materialsproject.org">
matbench-discovery.materialsproject.org</a
>
Check out <a href="https://matbench-discovery.materialsproject.org">
matbench-discovery.materialsproject.org
</a>
<br />
A new framework to evaluate ML energy models on materials stability prediction from unrelaxed
crystals
</strong>

<address>
Expand Down Expand Up @@ -68,6 +71,7 @@
background-color: darkcyan;
padding: 2pt 9pt;
border-radius: 9pt;
max-width: 500px;
}
strong a {
color: #191960;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/cv/cv-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ publications:
authors: Janosh Riebesell, Rhys Goodall, Anubhav Jain, Kristin Persson, Alpha Lee
date: 10 Feb 2023
journal: ICLR ML4Materials
url: https://matbench-discovery.janosh.dev/paper/iclr-ml4mat
url: https://matbench-discovery.materialsproject.org/preprint
- name: Crystal Toolkit
title: Crystal Toolkit - A Web App Framework to Improve Usability and Accessibility of Materials Science Research Algorithms
arxiv: https://arxiv.org/abs/2302.06147
Expand All @@ -46,7 +46,7 @@ publications:

projects:
- name: Matbench Discovery
url: https://matbench-discovery.janosh.dev
url: https://matbench-discovery.materialsproject.org
img_style: 'filter: invert(1);'
github: https://github.com/janosh/matbench-discovery
description: Benchmark for machine learning energy models simulating a real-world materials discovery campaign. Interactive leader board and Python package make new model submissions easy.
Expand Down
25 changes: 10 additions & 15 deletions src/routes/physics/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import type { FrontMatter } from '$lib/types'
import { error } from '@sveltejs/kit'
import type { LayoutServerLoad } from './$types'

export const load: LayoutServerLoad = async ({ url }) => {
const modules = import.meta.glob(`./*/+page.{md,svx,svelte}`)
const slug = url.pathname.split(`/`).at(-1)

const [path, resolver] = Object.entries(modules).find(([path]) => {
const route = path.split(`/`)[1]
return route == slug
})

const page = await resolver?.()
const modules = import.meta.glob(`./*/+page.md`, { eager: true })

if (!page?.metadata) {
const slug = url.pathname.split(`/`).at(-1)
const path = `./${slug}/+page.md`
if (!slug || !(path in modules)) {
throw error(404, `couldn't resolve ${slug} from ${Object.keys(modules)}`)
}

page.metadata.path = path
page.metadata.slug = slug
const frontmatter = modules[path]?.metadata as FrontMatter

return {
frontmatter: page.metadata,
}
frontmatter.path = path
frontmatter.slug = slug

return { frontmatter }
}
7 changes: 1 addition & 6 deletions src/routes/physics/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<script lang="ts">
import { repository } from '$root/package.json'
import type { LayoutServerData } from './$types'
export let data: LayoutServerData
const routes = Object.keys(import.meta.glob('./*/+page*.{svx,md,svelte}')).map(
(filename) => filename.split(`/`)[1]
)
export let data
$: ({ cover, slug } = data.frontmatter)
</script>
Expand Down

0 comments on commit 002dffb

Please sign in to comment.