Skip to content

Instantly share code, notes, and snippets.

@vish448
Last active April 8, 2020 16:12
Show Gist options
  • Save vish448/9941828fff94fe8b3e3ac272dc180782 to your computer and use it in GitHub Desktop.
Save vish448/9941828fff94fe8b3e3ac272dc180782 to your computer and use it in GitHub Desktop.
Terminal Commands for reference to create a jamstack registration form
Create an empty folder -- mkdir jamstack-registration-form
set jamstack app -- yarn init -y
create a folder -- mkdir src
create a html file -- index.html
creating a nee package with yarn -- yarn init -y
To server your application in real time -- npx serve FOLDER_NAME
To deploy site on netlify -- netlify init
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JamStack Email Registration Form</title>
<style>
body {font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;}
h1 { text-align: center;}
form{margin: 2rem auto;max-width: 350px;}
label,input {display: block;width: 100%;}
label { margin-top: 0.5rem;}
input {font-size: 1rem; padding: 0.25rem;}
button { margin-top: 0.25rem;padding: 0.5rem; background-color:navy;font-weight: bold;color: white;font-size: 1.5rem;border:none;}
.hidden {display: none;}
</style>
</head>
<body>
<h1>JamStack Email Registration</h1>
<form action="" data-netlify="true" netlify-honeypot="bot-field" name="Email Registration">
<label for="firstname">First Name</label>
<input type="text" name="firstname" id="firstname" />
<label for="lastname">Last Name</label>
<input type="text" name="lastname" id="lastname" />
<label for="email">Email</label>
<input type="email" name="email" id="email" />
<button type="submit">Register</button>
<p class="hidden">
<label>Don’t fill this out if you're human: <input name="bot-field"</label>
</p>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment