Skip to content

Commit

Permalink
PR to main
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopelezz committed Aug 10, 2022
1 parent a191fb2 commit 719e13c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
Binary file removed public/assets/authors/Jacob.avif
Binary file not shown.
Binary file modified public/assets/authors/Mark.avif
Binary file not shown.
Binary file added public/assets/authors/Tim.avif
Binary file not shown.
13 changes: 5 additions & 8 deletions src/components/Aside.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
import Author from '../data/author.json';
import json from '../data/author.json';
//if key matches in author deconstruct the value and assign it to the variable
const { name, bio, photo, twitter, twitterHandle, linkedin, github, githubHandle} = Author.Mark;
// I want to take the page url and return a writer aside
const { name, bio, photo, twitter, twitterHandle, linkedin, github, githubHandle} = json.Mark; // <-- Find the writer;
---

Expand Down Expand Up @@ -30,10 +31,6 @@ const { name, bio, photo, twitter, twitterHandle, linkedin, github, githubHandle
</div>
</aside>

<script>

</script>

<style>
/*---------Aside----------*/
.aside{
Expand Down Expand Up @@ -62,7 +59,7 @@ const { name, bio, photo, twitter, twitterHandle, linkedin, github, githubHandle
/*---------Text-----------*/
.text{
padding: 0 6%;

}

.text p:nth-child(1){
Expand Down
12 changes: 7 additions & 5 deletions src/components/blog/PostPreview.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import "../../styles/root.css";
import Author from '../../data/author.json';
export interface Props {
post: {
Expand All @@ -12,9 +13,9 @@ export interface Props {
}[];
}
const { post } = Astro.props;
const { title, publishDate, name, href, description, img, alt, tags } = post.frontmatter;
// tags is an string of comma separated tags. return the first tag.
const tag = tags.split(",")[0];
const { title, publishDate, writer, href, description, img, alt, tags } = post.frontmatter;
const tag = tags.split(",")[0]; // returns the first tag
---
<!--Article-->
Expand All @@ -29,6 +30,8 @@ const tag = tags.split(",")[0];
<div class="details">
<a href={post.url}><h1>{title}</h1></a>
<span>{publishDate} | {tag}</span>
<br/>
<span>{writer}</span>

<p>{description}</p>
<a href={post.url}> Read more.</a>
Expand All @@ -47,8 +50,7 @@ article{
height: 190px;
background-color: rgb(255, 255, 255, 0.5);
border-radius: 5px;
margin-top: 25px;
margin-left: 30px;
margin: 25px;
padding: 15px;
display: flex;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
Expand Down
2 changes: 2 additions & 0 deletions src/draft/root.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500&display=swap');

/*
--c = Color
--th = theme
*/
* {
font-family: ubuntu, sans-serif;
box-sizing: border-box;
margin: 0;
}
Expand Down
5 changes: 3 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Cursor from '../components/cursorEffect/Cursor.astro';
import Navbar from '../components/Navbar.astro';
import Aside from '../components/Aside.astro';
import BlogPostPreview from '../components/blog/PostPreview.astro';
import { getBlogPosts } from '../utils/api.astro';
import { getBlogPosts, getPosts } from '../utils/api.astro';
const { allBlogPosts } = await getBlogPosts();
const { allPosts } = await getPosts();
const title = '<BLOG />';
const description = 'Hi! My name is Mark Spratt. I am a software engineer who started a blog!';
Expand All @@ -24,7 +25,7 @@ const permalink = '#';
<Cursor />
<Navbar />
<div class="container">
<Aside />
<Aside post={allPosts}/>
<main>{allBlogPosts.map((p) => <BlogPostPreview post={p} />)}</main>
</div>
</body>
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
// Enable top-level await, and other modern ESM features.
"target": "ESNext",
// "target": "ESNext",
"target": "ES6",
"module": "ESNext",
// Enable node-style module resolution, for things like npm package imports.
"moduleResolution": "node",
Expand Down

0 comments on commit 719e13c

Please sign in to comment.