Skip to content

Commit f7cda44

Browse files
Merge pull request #151 from netlify-templates/fix-code-formatting
updated prettierrc.mjs, netlify.toml and formatted code
2 parents 61227f8 + 51db133 commit f7cda44

File tree

9 files changed

+115
-100
lines changed

9 files changed

+115
-100
lines changed

.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierrc.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import("prettier").Config} */
2+
3+
export default {
4+
tabWidth: 2,
5+
singleQuote: true,
6+
plugins: ['prettier-plugin-astro'],
7+
};

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[plugins.inputs.postBuild]
1414
enable = true
1515

16-
[plugin.inputs]
16+
[plugins.inputs]
1717
enable = false
1818

1919
[[redirects]]

package-lock.json

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@example/basics",
2+
"name": "astro-toolbox",
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
@@ -14,11 +14,11 @@
1414
"devDependencies": {
1515
"eslint": "^8.18.0",
1616
"prettier": "^3.2.5",
17-
"prettier-plugin-astro": "^0.13.0"
17+
"prettier-plugin-astro": "^0.13.0",
18+
"typescript": "^5.4.4"
1819
},
1920
"dependencies": {
2021
"astro": "^4.5.18",
21-
"cypress": "^13.7.2",
22-
"typescript": "^5.4.4"
22+
"cypress": "^13.7.2"
2323
}
2424
}

src/components/FeedbackForm.astro

Lines changed: 61 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,68 @@
11
---
2+
23
---
34

4-
<p>Here's an example of a Netlify Form! When you fill this out, the submissions can be found in the Netlify Admin site.</p>
5-
<div class="feedback-form">
6-
<form
7-
data-netlify="true"
8-
netlify-honeypot
9-
name="feedback"
10-
method="POST"
11-
action="/success"
12-
>
13-
<p class="hidden">
14-
<label>
15-
Don’t fill this out if you’re human: <input name="bot-field" />
16-
</label>
17-
</p>
18-
<input type="hidden" name="form-name" value="feedback" />
19-
<label for="name">Name</label>
20-
<input id="name" type="text" name="name" />
21-
<label for="email">Email</label>
22-
<input id="email" type="email" name="email" required />
23-
<label for="feedback">What is your feedback?</label>
24-
<textarea id="feedback" wrap="soft" name="feedback" required></textarea>
25-
<button type="submit">Submit</button>
26-
</form>
27-
</div>
5+
<p>
6+
Here's an example of a Netlify Form! When you fill this out, the submissions
7+
can be found in the Netlify Admin site.
8+
</p>
9+
<div class="feedback-form">
10+
<form
11+
data-netlify="true"
12+
netlify-honeypot
13+
name="feedback"
14+
method="POST"
15+
action="/success"
16+
>
17+
<p class="hidden">
18+
<label>
19+
Don’t fill this out if you’re human: <input name="bot-field" />
20+
</label>
21+
</p>
22+
<input type="hidden" name="form-name" value="feedback" />
23+
<label for="name">Name</label>
24+
<input id="name" type="text" name="name" />
25+
<label for="email">Email</label>
26+
<input id="email" type="email" name="email" required />
27+
<label for="feedback">What is your feedback?</label>
28+
<textarea id="feedback" wrap="soft" name="feedback" required></textarea>
29+
<button type="submit">Submit</button>
30+
</form>
31+
</div>
2832

2933
<style>
3034
.feedback-form {
31-
margin: 40px 40px;
32-
min-width: 250px;
33-
width: 45%;
34-
}
35-
label {
36-
font-size: 16px;
37-
}
38-
input,
39-
textarea,
40-
button {
41-
border-radius: 5px;
42-
border: 1px solid #cbd5e1;
43-
font-size: inherit;
44-
margin: 15px 0;
45-
padding: 12px 20px;
46-
width: 100%;
47-
}
48-
button {
49-
background-color: #2bdcd2;
50-
border: 1px solid #2bdcd2;
51-
color: #1e293b;
52-
font-size: 16px;
53-
width: 50%;
54-
}
55-
.hidden {
56-
clip: rect(0 0 0 0);
57-
clip-path: inset(50%);
58-
height: 1px;
59-
overflow: hidden;
60-
position: absolute;
61-
white-space: nowrap;
62-
width: 1px;
63-
}
35+
margin: 40px 40px;
36+
min-width: 250px;
37+
width: 45%;
38+
}
39+
label {
40+
font-size: 16px;
41+
}
42+
input,
43+
textarea,
44+
button {
45+
border-radius: 5px;
46+
border: 1px solid #cbd5e1;
47+
font-size: inherit;
48+
margin: 15px 0;
49+
padding: 12px 20px;
50+
width: 100%;
51+
}
52+
button {
53+
background-color: #2bdcd2;
54+
border: 1px solid #2bdcd2;
55+
color: #1e293b;
56+
font-size: 16px;
57+
width: 50%;
58+
}
59+
.hidden {
60+
clip: rect(0 0 0 0);
61+
clip-path: inset(50%);
62+
height: 1px;
63+
overflow: hidden;
64+
position: absolute;
65+
white-space: nowrap;
66+
width: 1px;
67+
}
6468
</style>
65-

src/components/Layout.astro

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface Props {
66
const { title } = Astro.props as Props;
77
---
88

9-
<!DOCTYPE html>
9+
<!doctype html>
1010
<html lang="en">
1111
<head>
1212
<meta charset="UTF-8" />
@@ -49,8 +49,15 @@ const { title } = Astro.props as Props;
4949
}
5050

5151
:global(code) {
52-
font-family: Menlo, Monaco, Lucida Console, Liberation Mono,
53-
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
52+
font-family:
53+
Menlo,
54+
Monaco,
55+
Lucida Console,
56+
Liberation Mono,
57+
DejaVu Sans Mono,
58+
Bitstream Vera Sans Mono,
59+
Courier New,
60+
monospace;
5461
}
5562
:global(p) {
5663
line-height: 1.6;

src/pages/index.astro

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,24 @@ import FeedbackForm from '../components/FeedbackForm.astro';
1717
<p>
1818
Hi 👋! This template gives you an
1919
<a href="https://astro.build/">Astro</a> app with the scaffolding for
20-
<a href="https://ntl.fyi/3upc4Qo"
21-
>Netlify Functions</a
22-
>, <a href="https://ntl.fyi/3bICRk6">Forms</a>, and
23-
<a href="https://ntl.fyi/3PcY8RH">Redirects</a>. Our
24-
aim was to give you the code you would need to hit the ground running
25-
with a few fun features.
26-
</p>
20+
<a href="https://ntl.fyi/3upc4Qo">Netlify Functions</a>, <a
21+
href="https://ntl.fyi/3bICRk6">Forms</a
22+
>, and
23+
<a href="https://ntl.fyi/3PcY8RH">Redirects</a>. Our aim was to give you
24+
the code you would need to hit the ground running with a few fun
25+
features.
26+
</p>
2727

28-
<p>
29-
You can find the code for this project on GitHub at
30-
<a href="https://github.com/netlify-templates/astro-toolbox"
31-
>https://github.com/netlify-templates/astro-toolbox</a
32-
>! Happy coding!
33-
</p>
28+
<p>
29+
You can find the code for this project on GitHub at
30+
<a href="https://github.com/netlify-templates/astro-toolbox"
31+
>https://github.com/netlify-templates/astro-toolbox</a
32+
>! Happy coding!
33+
</p>
3434
</div>
3535
<FeedbackForm />
3636
<a class="jokes-link" href="/api/joke">
37-
<h3>
38-
Click here for function-loaded jokes!
39-
</h3>
37+
<h3>Click here for function-loaded jokes!</h3>
4038
</a>
4139
</main>
4240
</Layout>
@@ -55,7 +53,7 @@ import FeedbackForm from '../components/FeedbackForm.astro';
5553
margin: 0 auto;
5654
max-width: 60ch;
5755
align-items: center;
58-
}
56+
}
5957

6058
footer {
6159
width: 100%;

src/pages/success.astro

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import Layout from '../components/Layout.astro';
33
---
44

55
<Layout title="Astro Toolbox">
6-
<div class="container">
7-
<main>
8-
<h1>Submission Received!</h1>
9-
<p>Thank you for your feedback! Head back to the <a href="/">home page</a>.</p>
10-
</main>
11-
</div>
6+
<div class="container">
7+
<main>
8+
<h1>Submission Received!</h1>
9+
<p>
10+
Thank you for your feedback! Head back to the <a href="/">home page</a>.
11+
</p>
12+
</main>
13+
</div>
1214
</Layout>
1315
<style>
1416
html {
1517
margin: 0 30px;
1618
}
17-
</style>
19+
</style>

0 commit comments

Comments
 (0)