-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from markteekman/develop
Develop
- Loading branch information
Showing
11 changed files
with
133 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
--- | ||
const currentYear = new Date().getFullYear() | ||
--- | ||
|
||
<footer> | ||
<section class="padding-16 color-neutral"> | ||
<div class="container"> | ||
<p>© Footer Copyright</p> | ||
<p>© {currentYear} - Starter Theme for <a href="https://astro.build/">Astro</a>.</p> | ||
</div> | ||
</section> | ||
</footer> | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import DefaultLayout from '../layouts/DefaultLayout.astro' | ||
--- | ||
|
||
<DefaultLayout title="About"> | ||
<section class="margin-48"> | ||
<div class="container"> | ||
<h1>404</h1><br> | ||
</div> | ||
</section> | ||
<section class="margin-48"> | ||
<div class="container space-content"> | ||
<p class="size-20">This page does not exist.</p> | ||
<a class="size-18" href="/">Go back to the homepage</a> | ||
</div> | ||
</section> | ||
</DefaultLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
import DefaultLayout from '../layouts/DefaultLayout.astro' | ||
import { Card } from 'accessible-astro-components' | ||
const response = await fetch('https://jsonplaceholder.typicode.com/posts') | ||
const data = await response.json() | ||
--- | ||
|
||
<DefaultLayout title="Blog"> | ||
<section class="margin-48"> | ||
<div class="container"> | ||
<h1>Blog</h1><br> | ||
<p class="size-18">An example of a blog with dynamic content fetched from <a href="https://jsonplaceholder.typicode.com/posts">JSONPlaceholder</a> using the title, body and userId. The <a href="https://components.accessible-astro.dev/card">Accessible Astro Card Component</a> is used here to display al the posts.</p> | ||
</div> | ||
</section> | ||
<section class="margin-48"> | ||
<div class="container"> | ||
<ul> | ||
{data.map((post) => ( | ||
<li> | ||
<Card | ||
url={'/posts/' + post.id} | ||
title={post.title} | ||
footer={'userId:' + post.userId} | ||
> | ||
{post.body} | ||
</Card> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</section> | ||
</DefaultLayout> | ||
|
||
<style lang="scss"> | ||
ul { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
grid-gap: 4rem; | ||
|
||
@media (min-width: 550px) { | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-gap: 2rem; | ||
} | ||
|
||
@media (min-width: 950px) { | ||
grid-template-columns: repeat(3, 1fr); | ||
} | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
import DefaultLayout from '../../layouts/DefaultLayout.astro' | ||
export async function getStaticPaths() { | ||
const data = await fetch('https://jsonplaceholder.typicode.com/posts').then(response => response.json()) | ||
return data.map((post) => { | ||
return { | ||
params: { id: post.id.toString() }, | ||
props: { post } | ||
} | ||
}) | ||
} | ||
const { post } = Astro.props | ||
--- | ||
|
||
<DefaultLayout title="Blog"> | ||
<section class="margin-48"> | ||
<div class="container"> | ||
<h1>{post.title}</h1><br> | ||
<p>By userId: {post.userId}</p> | ||
</div> | ||
</section> | ||
<section class="margin-48"> | ||
<div class="container"> | ||
<p class="size-20">{post.body}</p> | ||
</div> | ||
</section> | ||
</DefaultLayout> | ||
|
||
<style lang="scss"> | ||
ul { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
grid-gap: 4rem; | ||
|
||
@media (min-width: 550px) { | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-gap: 2rem; | ||
} | ||
|
||
@media (min-width: 950px) { | ||
grid-template-columns: repeat(3, 1fr); | ||
} | ||
} | ||
</style> |