Skip to content

Commit a99158f

Browse files
committed
article page
1 parent 6065601 commit a99158f

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

data/articles.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"title": "Local Programming Program Goes Global",
4+
"summary": "Local Blogger Dan Woog writes about the FPA in his blog \"06880\"",
5+
"link": "https://06880danwoog.com/2023/07/28/gfa-programming-program-goes-global/",
6+
"photo": "https://i0.wp.com/06880danwoog.com/wp-content/uploads/2023/07/Fairfield-Programming-Association-1.jpg?resize=1024%2C785&ssl=1"
7+
}
8+
]

src/components/article.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as React from "react"
2+
import { GatsbyImage } from "gatsby-plugin-image"
3+
import { Link } from "gatsby"
4+
5+
function Article({title, summary, link, photo}){
6+
7+
let slug = title.toLowerCase()
8+
let description = summary.split(" ").slice(0, 40).join(" ")
9+
10+
return (
11+
<Link className="block w-full h-full" to={`/team/${slug}`}>
12+
<div className="rounded shadow p-4 h-full">
13+
<img src={photo} class="rounded-full w-1/2 mb-4" />
14+
<h3 className="text-lg font-bold">
15+
{title}
16+
</h3>
17+
<p className="text-md">{description || ""}</p>
18+
</div>
19+
<a href={link} class="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
20+
Read more
21+
<svg class="w-3.5 h-3.5 ml-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
22+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
23+
</svg>
24+
</a>
25+
</Link>
26+
)
27+
}
28+
export default Article

src/pages/press.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { Link } from "gatsby"
33
import Layout from "../components/layout"
44
import Seo from "../components/seo"
55

6-
function PressPage({location}) {
7-
const releases = require('../../data/general.json').press
6+
import Article from "../components/article"
87

8+
function PressPage({location}) {
9+
//const releases = require('../../data/general.json').press
10+
const releases = require('../../data/articles.json')
911
return (
1012
<Layout location={location} crumbLabel="Press">
1113
<section>
@@ -26,13 +28,19 @@ function PressPage({location}) {
2628
</section>
2729
<section>
2830
<div className="max-w-6xl mx-auto pb-16 px-4 flex">
31+
{/*
2932
<div class="space-y-4 w-full">
3033
<ul>
3134
{
3235
releases.map(item => <li class="list-disc mb-4"><Link class="text-sky-400 hover:text-sky-500 hover:underline" to={item.path}>{item.name}</Link></li>)
3336
}
3437
</ul>
3538
</div>
39+
*/}
40+
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2 md:grid-cols-4 mt-6">
41+
{releases
42+
.map(item => Article(item))}
43+
</div>
3644
</div>
3745
</section>
3846
</Layout>

0 commit comments

Comments
 (0)