Skip to content

Commit c832e33

Browse files
committed
Style updates for posts
1 parent 45f8225 commit c832e33

3 files changed

Lines changed: 39 additions & 20 deletions

File tree

src/components/post-tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styled from 'styled-components';
44
import InlineList from './inline-list';
55

66
const PostTagsStyle = styled(InlineList)`
7-
margin-left: 0;
7+
margin: 0;
88
padding: 0;
99
1010
&:before {

src/pages/blog/bash-script-before-reading-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags: ['git', 'tools', 'bash']
77

88
I saw this awesome blog post [The Git Commands I Run Before Reading Any Code](https://piechowski.io/post/git-commands-before-reading-code/) detailing some git commands to help you navigate a new code base. Well, I decided to make a wrapper bash script around those commands.
99

10-
<h2 id="the-script">The Script <a href="#the-script">🔗</a></h2>
10+
## The Script
1111

1212
Create a file `git-investigate` (no extension), mark it as executable (`chmod +x git-investigate`), and then add `git-investigate` to your `PATH`.
1313

@@ -84,7 +84,7 @@ fi
8484

8585
```
8686

87-
<h2 id="usage">Usage <a href="#usage">🔗</a></h2>
87+
## Usage
8888

8989
```bash
9090
cd myproject

src/templates/post.js

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,43 @@ import { Helmet } from 'react-helmet';
44
import Layout from '../layouts';
55
import moment from 'moment';
66
import PostTags from '../components/post-tags';
7+
import styled from 'styled-components';
78

89
export default function Template({ data }) {
910
const { siteMetadata } = data.site;
10-
const { frontmatter, html, excerpt } = data.markdownRemark;
11+
const { frontmatter, html, excerpt, tableOfContents } = data.markdownRemark;
1112
const { title, date, tags } = frontmatter;
1213

1314
const formattedDate = moment(date).format('MMMM Do YYYY');
1415

16+
const dateAndTags = (
17+
<div
18+
style={{
19+
display: 'flex',
20+
justifyContent: 'space-between',
21+
margin: '1em 0 1em 0',
22+
}}
23+
>
24+
<p
25+
style={{
26+
fontSize: '0.9em',
27+
margin: 0,
28+
}}
29+
>
30+
<span style={{ fontWeight: 'bold' }}>Published: </span>{' '}
31+
<span
32+
style={{
33+
fontStyle: 'italic',
34+
}}
35+
>
36+
{formattedDate}
37+
</span>
38+
</p>
39+
40+
{tags && <PostTags tags={tags} />}
41+
</div>
42+
);
43+
1544
return (
1645
<Layout>
1746
<Helmet>
@@ -31,28 +60,18 @@ export default function Template({ data }) {
3160
<div className="blog-post">
3261
<h1 style={{ marginBottom: tags ? 0 : '0.5em' }}>{title}</h1>
3362

34-
{tags && <PostTags tags={tags} />}
63+
{dateAndTags}
3564

36-
<p
37-
style={{
38-
fontSize: '1.1em',
39-
marginBottom: '2em',
40-
}}
41-
>
42-
<span>📅</span>{' '}
43-
<span
44-
style={{
45-
fontStyle: 'italic',
46-
}}
47-
>
48-
{formattedDate}
49-
</span>
50-
</p>
65+
<hr style={{ margin: '2.5em 0' }} />
5166

5267
<div
5368
className="blog-post-content"
5469
dangerouslySetInnerHTML={{ __html: html }}
5570
/>
71+
72+
<hr style={{ margin: '2.5em 0' }} />
73+
74+
{dateAndTags}
5675
</div>
5776
</div>
5877
</Layout>

0 commit comments

Comments
 (0)