Skip to content

Commit

Permalink
Create archive of old projects, add Rust for HelenOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mvolfik committed Apr 29, 2024
1 parent 2748a26 commit f1a13aa
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "astro dev --experimental-integrations",
"build": "astro build --experimental-integrations",
"format": "prettier --write --plugin-search-dir . --ignore-path .gitignore"
"format": "prettier --write --plugin-search-dir . --ignore-path .gitignore ."
},
"devDependencies": {
"@astrojs/sitemap": "^0.1.2",
Expand Down
1 change: 0 additions & 1 deletion src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const props = Astro.props as Props;
<meta property="og:url" content="https://mvolfik.github.io/" />
<meta property="og:site_name" content="Matěj Volf" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content={props.title} />
<script>
import "../lib/tracker.ts";
Expand Down
135 changes: 135 additions & 0 deletions src/layouts/archive.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
import BaseLayout from "./Base.astro";
import type { Props as ProjectProps } from "./project.astro";
import { intersperse } from "../lib/utils.ts";
export interface Props {
title: string;
summary: string;
}
const projects = await Astro.glob<ProjectProps>("../pages/archive/*.md");
const props = Astro.props.content as Props;
---

<BaseLayout title={props.title} summary={props.summary}>
<div class="wrapper">
<h2>Archive</h2>
<hr />
<main>
<p><a href="/">&larr; back to homepage</a></p>
<slot />

{
projects
.sort(
(a, b) =>
b.frontmatter.ordering_value - a.frontmatter.ordering_value
)
.map(({ frontmatter, url }, i) => (
<>
<h4 class:list={[{ noprint: i >= 2 }]}>
<a target="_blank" href={frontmatter.links[0].href}>
{frontmatter.name}
</a>
<span class="tags">
{intersperse(
frontmatter.tags.map((tag) => <span>{tag}</span>),
", "
)}
</span>
<span class="timespan">{frontmatter.timespan}</span>
</h4>
{frontmatter.description.split(/\n\w*\n/).map((paragraph) => (
<p class:list={[{ noprint: i >= 2 }]}>{paragraph}</p>
))}
{frontmatter.links.length > 1 || frontmatter.read_more ? (
<p class:list={[{ noprint: i >= 2 }]}>
{intersperse(
frontmatter.links.map(({ name, href }) => (
<a target="_blank" href={href}>
{name}
</a>
)),
" | "
)}
{frontmatter.read_more ? (
<>
| <a href={url}>Read more&hellip;</a>
</>
) : (
""
)}
</p>
) : (
""
)}
</>
))
}
</main>
<footer>
<p>
<small>
<span class="noprint">
Powered by <a target="_blank" href="https://astro.build/">Astro</a>;
Hosted on GitHub Pages
</span>
<span class="printonly">
This resume was printed from <a href="https://mvolfik.github.io/"
>https://mvolfik.github.io/
</a> on {new Date().toLocaleDateString()}
</span>
</small>
</p>
</footer>
</div>
</BaseLayout>

<script>
document.querySelector("a[href^='https://mailhide.io']").href = atob(
"tFWasR3b6gWZsx2bA1mdvxmZptmLj9Wb".split("").reverse().join("")
)
.split("")
.reverse()
.join("");
</script>

<style lang="scss">
@use "../lib/tags.scss";
@use "sass:list";

main h4 {
.tags,
.timespan {
white-space: nowrap;
}

@for $i from 0 to 6 {
&:nth-of-type(6n + #{$i}) .tags {
@include tags.tags($i);
}

&:nth-of-type(6n + #{$i}) {
$permut: list.nth(tags.$colors-permutations, ($i % 6) + 1);

.job-role {
color: list.nth($permut, 1);
}

.job-company {
color: list.nth($permut, 3);
}
}
}
}

div.wrapper {
max-width: 51em;
margin: 0 auto;
}

main {
margin: 0 1em;
}
</style>
15 changes: 12 additions & 3 deletions src/layouts/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ const props = Astro.props.content as Props;
.map(({ frontmatter, url }, i) => (
<>
<h4 class:list={[{ noprint: i >= 2 }]}>
<a target="_blank" href={frontmatter.links[0].href}>
{frontmatter.name}
</a>
{frontmatter.links.length ? (
<>
<a target="_blank" href={frontmatter.links[0].href}>
{frontmatter.name}
</a>
</>
) : (
frontmatter.name
)}
<span class="tags">
{intersperse(
frontmatter.tags.map((tag) => <span>{tag}</span>),
Expand Down Expand Up @@ -177,6 +183,9 @@ const props = Astro.props.content as Props;
</>
))
}
<p style="margin-top: 2rem;">
<a href="/archive">Archive of older projects</a>
</p>
</main>
<footer>
<p>
Expand Down
11 changes: 10 additions & 1 deletion src/layouts/project.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface Props {
description: string;
}
const props = Astro.props.content as Props;
const isArchive = Astro.props.url.startsWith("/archive/");
---

<BaseLayout title={props.name} summary={props.description}>
Expand All @@ -36,7 +37,11 @@ const props = Astro.props.content as Props;
)
}
<main>
<p class="noprint"><a href="/">&larr; back to homepage</a></p>
<p class="noprint">
<a href={isArchive ? "/archive" : "/"}
>&larr; back to {isArchive ? "archive" : "homepage"}</a
>
</p>
<p class="metadata">
Tags: <span class="tags">
{
Expand Down Expand Up @@ -101,6 +106,10 @@ const props = Astro.props.content as Props;
}
}

main > :global(p > img) {
max-width: 100%;
}

.metadata {
font-size: 1.15em;
}
Expand Down
7 changes: 7 additions & 0 deletions src/pages/archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: ../layouts/archive.astro
title: Archive
summary: Very old things
---

Here's a few very old things, that I used to show in my portfolio earlier. The content here may be embarassing, uninteresting, trivial, or even embarassingly uninteresting and trivial.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions src/pages/projects/helenos-rust.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: ../../layouts/project.astro
name: Rust for HelenOS
image: https://http.cat/404
links: []
timespan: 2024 – present
ordering_value: 20240301
tags:
- Rust
- Operating System development
description: |
As my Individual Software project at Matfyz (and potentially my Bachelor's thesis), I am working on providing support for the HelenOS operating system to the Rust compiler, i.e. allow compiling Rust programs for HelenOS. I am very much in the beginning of this project and there isn't anything that I have to show yet.
---

0 comments on commit f1a13aa

Please sign in to comment.