Skip to content

Commit e90d317

Browse files
committed
Add tags to projects page
1 parent cc4ea30 commit e90d317

2 files changed

Lines changed: 120 additions & 20 deletions

File tree

src/components/tags.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
4+
import InlineList from './inline-list';
5+
6+
const TagsStyle = styled(InlineList)`
7+
margin-left: 0;
8+
padding: 0;
9+
margin: 1em 0 2em 0;
10+
11+
&:before {
12+
content: 'Tags:';
13+
font-weight: bold;
14+
font-size: 0.9em;
15+
margin-right: 0em;
16+
}
17+
18+
li {
19+
font-size: 0.9em;
20+
margin-right: 0;
21+
cursor: default;
22+
}
23+
24+
li:before {
25+
content: '#';
26+
}
27+
28+
li:after {
29+
content: ', ';
30+
}
31+
32+
li:last-child:after {
33+
content: '';
34+
}
35+
`;
36+
37+
function Tag({ children }) {
38+
return <>{children}</>;
39+
}
40+
41+
export default function Tags({ children }) {
42+
return (
43+
<TagsStyle>
44+
{children.map((child, i) => (
45+
<li key={i}>{child}</li>
46+
))}
47+
</TagsStyle>
48+
);
49+
}
50+
51+
Tags.Tag = Tag;

src/pages/projects.js

Lines changed: 69 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import React from 'react';
22
import Layout from '../layouts';
33
import { OutboundLink } from 'gatsby-plugin-google-analytics';
44
import { Helmet } from 'react-helmet';
5+
import Tags from '../components/tags';
6+
import styled from 'styled-components';
7+
8+
const Project = styled.section`
9+
margin-bottom: 3em;
10+
`;
511

612
export default function Projects({ data }) {
713
const { siteMetadata } = data.site;
@@ -19,14 +25,26 @@ export default function Projects({ data }) {
1925
/>
2026
</Helmet>
2127

22-
<h2 style={{ fontSize: '2em' }}>Projects</h2>
28+
<h2 style={{ fontSize: '2em', marginBottom: '1.5em' }}>Projects</h2>
2329

24-
<section style={{ marginBottom: '2em' }}>
30+
<Project>
2531
<h3>
2632
<OutboundLink href="https://github.com/testingrequired/reqlang">
2733
📄 Request Language (reqlang)
2834
</OutboundLink>
2935
</h3>
36+
37+
<Tags>
38+
<Tags.Tag>rust</Tags.Tag>
39+
<Tags.Tag>dsl</Tags.Tag>
40+
<Tags.Tag>file-specification</Tags.Tag>
41+
<Tags.Tag>http-messages</Tags.Tag>
42+
<Tags.Tag>language-servers</Tags.Tag>
43+
<Tags.Tag>vs-code-extensions</Tags.Tag>
44+
<Tags.Tag>developer-tools</Tags.Tag>
45+
<Tags.Tag>testing-tools</Tags.Tag>
46+
</Tags>
47+
3048
<p>
3149
A file format specification for defining HTTP requests, response
3250
assertions, and associated data/configuration in "request files".
@@ -83,28 +101,46 @@ export default function Projects({ data }) {
83101
A toy transpiler for reqlang-expr to typescript.
84102
</li>
85103
</ul>
86-
</section>
104+
</Project>
87105

88-
<section>
106+
<Project>
89107
<h3>
90108
<OutboundLink href="https://github.com/egonlang/egonlang">
91109
👻 Egon
92110
</OutboundLink>
93111
</h3>
94112

113+
<Tags>
114+
<Tags.Tag>rust</Tags.Tag>
115+
<Tags.Tag>programming-languages</Tags.Tag>
116+
<Tags.Tag>type-systems</Tags.Tag>
117+
<Tags.Tag>language-server</Tags.Tag>
118+
<Tags.Tag>vs-code-extension</Tags.Tag>
119+
</Tags>
120+
95121
<p>
96122
A (toy) statically typed interpreted language for learning
97123
type-checking and type inference.
98124
</p>
99-
</section>
125+
</Project>
100126

101-
<section>
127+
<Project>
102128
<h3>
103129
<OutboundLink href="https://github.com/kyleect/locks">
104130
🔓 Locks
105131
</OutboundLink>
106132
</h3>
107133

134+
<Tags>
135+
<Tags.Tag>rust</Tags.Tag>
136+
<Tags.Tag>typescript</Tags.Tag>
137+
<Tags.Tag>programming-languages</Tags.Tag>
138+
<Tags.Tag>compilers</Tags.Tag>
139+
<Tags.Tag>language-server</Tags.Tag>
140+
<Tags.Tag>vs-code-extension</Tags.Tag>
141+
<Tags.Tag>wasm</Tags.Tag>
142+
</Tags>
143+
108144
<p>
109145
A toy bytecode VM language branched from{' '}
110146
<a href="https://craftinginterpreters.com/the-lox-language.html">
@@ -169,37 +205,50 @@ export default function Projects({ data }) {
169205
Include several changes to syntax from the original project.
170206
</li>
171207
</ul>
172-
</section>
208+
</Project>
173209

174-
<section>
210+
<Project>
175211
<h3>
176212
<OutboundLink href="https://github.com/testingrequired/attempted">
177-
Attempted
213+
🧯 Attempted
178214
</OutboundLink>
179215
</h3>
180216

217+
<Tags>
218+
<Tags.Tag>typescript</Tags.Tag>
219+
<Tags.Tag>library</Tags.Tag>
220+
<Tags.Tag>error-handling</Tags.Tag>
221+
</Tags>
222+
181223
<p>Typed error handling for function calls in Typescript.</p>
182-
</section>
224+
</Project>
183225

184-
<section>
226+
<Project>
185227
<h3>
186-
<OutboundLink href="https://github.com/testingrequired/the-testing-book">
187-
📕 The Testing Book
228+
<OutboundLink href="https://github.com/testingrequired/bespin">
229+
🌌 Bespin
188230
</OutboundLink>
189231
</h3>
190232

191-
<p>A (work in progress) software engineering guide to testing.</p>
192-
</section>
233+
<Tags>
234+
<Tags.Tag>typescript</Tags.Tag>
235+
<Tags.Tag>framework</Tags.Tag>
236+
<Tags.Tag>testing-tools</Tags.Tag>
237+
<Tags.Tag>test-frameworks</Tags.Tag>
238+
</Tags>
239+
240+
<p>A framework for implementing test frameworks.</p>
241+
</Project>
193242

194-
<section>
243+
<Project>
195244
<h3>
196-
<OutboundLink href="https://github.com/testingrequired/bespin">
197-
🌌 bespin
245+
<OutboundLink href="https://github.com/testingrequired/the-testing-book">
246+
📕 The Testing Book
198247
</OutboundLink>
199248
</h3>
200249

201-
<p>A framework for test frameworks writting in Typescript.</p>
202-
</section>
250+
<p>A (work in progress) software engineering guide to testing.</p>
251+
</Project>
203252
</Layout>
204253
);
205254
}

0 commit comments

Comments
 (0)