Skip to content

Commit 0195cd9

Browse files
authored
Format indent with spaces consistently (#9)
1 parent 2a0f89d commit 0195cd9

File tree

4 files changed

+101
-101
lines changed

4 files changed

+101
-101
lines changed

src/content.config.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import { glob } from 'astro/loaders';
33
import { z } from 'astro/zod';
44

55
const blog = defineCollection({
6-
// Load Markdown and MDX files in the `src/content/blog/` directory.
7-
loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
8-
// Type-check frontmatter using a schema
9-
schema: ({ image }) =>
10-
z.object({
11-
title: z.string(),
12-
description: z.string(),
13-
// Transform string to Date object
14-
pubDate: z.coerce.date(),
15-
updatedDate: z.coerce.date().optional(),
16-
heroImage: z.optional(image()),
17-
}),
6+
// Load Markdown and MDX files in the `src/content/blog/` directory.
7+
loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
8+
// Type-check frontmatter using a schema
9+
schema: ({ image }) =>
10+
z.object({
11+
title: z.string(),
12+
description: z.string(),
13+
// Transform string to Date object
14+
pubDate: z.coerce.date(),
15+
updatedDate: z.coerce.date().optional(),
16+
heroImage: z.optional(image()),
17+
}),
1818
});
1919

2020
export const collections = { blog };

src/content/blog/using-mdx.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ When you open this page in the browser, you should see the clickable button belo
2121
import HeaderLink from '../../components/HeaderLink.astro';
2222

2323
<HeaderLink href="#" onclick="alert('clicked!')">
24-
Embedded component in MDX
24+
Embedded component in MDX
2525
</HeaderLink>
2626

2727
## More Links

src/pages/rss.xml.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import rss from '@astrojs/rss';
33
import { SITE_DESCRIPTION, SITE_TITLE } from '../consts';
44

55
export async function GET(context) {
6-
const posts = await getCollection('blog');
7-
return rss({
8-
title: SITE_TITLE,
9-
description: SITE_DESCRIPTION,
10-
site: context.site,
11-
items: posts.map((post) => ({
12-
...post.data,
13-
link: `/blog/${post.id}/`,
14-
})),
15-
});
6+
const posts = await getCollection('blog');
7+
return rss({
8+
title: SITE_TITLE,
9+
description: SITE_DESCRIPTION,
10+
site: context.site,
11+
items: posts.map((post) => ({
12+
...post.data,
13+
link: `/blog/${post.id}/`,
14+
})),
15+
});
1616
}

src/styles/global.css

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,37 @@
55
*/
66

77
:root {
8-
--accent: #2337ff;
9-
--accent-dark: #000d8a;
10-
--black: 15, 18, 25;
11-
--gray: 96, 115, 159;
12-
--gray-light: 229, 233, 240;
13-
--gray-dark: 34, 41, 57;
14-
--gray-gradient: rgba(var(--gray-light), 50%), #fff;
15-
--box-shadow:
16-
0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%),
17-
0 16px 32px rgba(var(--gray), 33%);
8+
--accent: #2337ff;
9+
--accent-dark: #000d8a;
10+
--black: 15, 18, 25;
11+
--gray: 96, 115, 159;
12+
--gray-light: 229, 233, 240;
13+
--gray-dark: 34, 41, 57;
14+
--gray-gradient: rgba(var(--gray-light), 50%), #fff;
15+
--box-shadow:
16+
0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%),
17+
0 16px 32px rgba(var(--gray), 33%);
1818
}
1919

2020
body {
21-
font-family: var(--font-atkinson), sans-serif;
22-
margin: 0;
23-
padding: 0;
24-
text-align: left;
25-
background: linear-gradient(var(--gray-gradient)) no-repeat;
26-
background-size: 100% 600px;
27-
word-wrap: break-word;
28-
overflow-wrap: break-word;
29-
color: rgb(var(--gray-dark));
30-
font-size: 20px;
31-
line-height: 1.7;
21+
font-family: var(--font-atkinson), sans-serif;
22+
margin: 0;
23+
padding: 0;
24+
text-align: left;
25+
background: linear-gradient(var(--gray-gradient)) no-repeat;
26+
background-size: 100% 600px;
27+
word-wrap: break-word;
28+
overflow-wrap: break-word;
29+
color: rgb(var(--gray-dark));
30+
font-size: 20px;
31+
line-height: 1.7;
3232
}
3333

3434
main {
35-
width: 720px;
36-
max-width: calc(100% - 2em);
37-
margin: auto;
38-
padding: 3em 1em;
35+
width: 720px;
36+
max-width: calc(100% - 2em);
37+
margin: auto;
38+
padding: 3em 1em;
3939
}
4040

4141
h1,
@@ -44,122 +44,122 @@ h3,
4444
h4,
4545
h5,
4646
h6 {
47-
margin: 0 0 0.5rem 0;
48-
color: rgb(var(--black));
49-
line-height: 1.2;
47+
margin: 0 0 0.5rem 0;
48+
color: rgb(var(--black));
49+
line-height: 1.2;
5050
}
5151

5252
h1 {
53-
font-size: 3.052em;
53+
font-size: 3.052em;
5454
}
5555

5656
h2 {
57-
font-size: 2.441em;
57+
font-size: 2.441em;
5858
}
5959

6060
h3 {
61-
font-size: 1.953em;
61+
font-size: 1.953em;
6262
}
6363

6464
h4 {
65-
font-size: 1.563em;
65+
font-size: 1.563em;
6666
}
6767

6868
h5 {
69-
font-size: 1.25em;
69+
font-size: 1.25em;
7070
}
7171

7272
strong,
7373
b {
74-
font-weight: 700;
74+
font-weight: 700;
7575
}
7676

7777
a {
78-
color: var(--accent);
78+
color: var(--accent);
7979
}
8080

8181
a:hover {
82-
color: var(--accent);
82+
color: var(--accent);
8383
}
8484

8585
p {
86-
margin-bottom: 1em;
86+
margin-bottom: 1em;
8787
}
8888

8989
.prose p {
90-
margin-bottom: 2em;
90+
margin-bottom: 2em;
9191
}
9292

9393
textarea {
94-
width: 100%;
95-
font-size: 16px;
94+
width: 100%;
95+
font-size: 16px;
9696
}
9797

9898
input {
99-
font-size: 16px;
99+
font-size: 16px;
100100
}
101101

102102
table {
103-
width: 100%;
103+
width: 100%;
104104
}
105105

106106
img {
107-
max-width: 100%;
108-
height: auto;
109-
border-radius: 8px;
107+
max-width: 100%;
108+
height: auto;
109+
border-radius: 8px;
110110
}
111111

112112
code {
113-
padding: 2px 5px;
114-
background-color: rgb(var(--gray-light));
115-
border-radius: 2px;
113+
padding: 2px 5px;
114+
background-color: rgb(var(--gray-light));
115+
border-radius: 2px;
116116
}
117117

118118
pre {
119-
padding: 1.5em;
120-
border-radius: 8px;
119+
padding: 1.5em;
120+
border-radius: 8px;
121121
}
122122

123123
pre>code {
124-
all: unset;
124+
all: unset;
125125
}
126126

127127
blockquote {
128-
border-left: 4px solid var(--accent);
129-
padding: 0 0 0 20px;
130-
margin: 0;
131-
font-size: 1.333em;
128+
border-left: 4px solid var(--accent);
129+
padding: 0 0 0 20px;
130+
margin: 0;
131+
font-size: 1.333em;
132132
}
133133

134134
hr {
135-
border: none;
136-
border-top: 1px solid rgb(var(--gray-light));
135+
border: none;
136+
border-top: 1px solid rgb(var(--gray-light));
137137
}
138138

139139
@media (max-width: 720px) {
140-
body {
141-
font-size: 18px;
142-
}
140+
body {
141+
font-size: 18px;
142+
}
143143

144-
main {
145-
padding: 1em;
146-
}
144+
main {
145+
padding: 1em;
146+
}
147147
}
148148

149149
.sr-only {
150-
border: 0;
151-
padding: 0;
152-
margin: 0;
153-
position: absolute !important;
154-
height: 1px;
155-
width: 1px;
156-
overflow: hidden;
157-
/* IE6, IE7 - a 0 height clip, off to the bottom right of the visible 1px box */
158-
clip: rect(1px 1px 1px 1px);
159-
/* maybe deprecated but we need to support legacy browsers */
160-
clip: rect(1px, 1px, 1px, 1px);
161-
/* modern browsers, clip-path works inwards from each corner */
162-
clip-path: inset(50%);
163-
/* added line to stop words getting smushed together (as they go onto separate lines and some screen readers do not understand line feeds as a space */
164-
white-space: nowrap;
150+
border: 0;
151+
padding: 0;
152+
margin: 0;
153+
position: absolute !important;
154+
height: 1px;
155+
width: 1px;
156+
overflow: hidden;
157+
/* IE6, IE7 - a 0 height clip, off to the bottom right of the visible 1px box */
158+
clip: rect(1px 1px 1px 1px);
159+
/* maybe deprecated but we need to support legacy browsers */
160+
clip: rect(1px, 1px, 1px, 1px);
161+
/* modern browsers, clip-path works inwards from each corner */
162+
clip-path: inset(50%);
163+
/* added line to stop words getting smushed together (as they go onto separate lines and some screen readers do not understand line feeds as a space */
164+
white-space: nowrap;
165165
}

0 commit comments

Comments
 (0)