Skip to content

Instantly share code, notes, and snippets.

View shansmith01's full-sized avatar
💭
Getting my head around Gatsby Themes

Shannon Smith shansmith01

💭
Getting my head around Gatsby Themes
View GitHub Profile
const Form = ({ onSubmit, formSchema, defaultValues, children }) => {
const methods = useForm({ defaultValues, resolver: zodResolver(formSchema) });
const { handleSubmit } = methods;
return (
<form onSubmit={handleSubmit(onSubmit)}>
{children}
<input type="submit" />
</form>
@shansmith01
shansmith01 / Sample script in head
Created October 2, 2019 20:24
Example JS in head of gastby
<Helmet>
<script>
{`(function(m,e,w,s){c=m.createElement(e);c.onload=function(){
Mews.D.apply(null,s)};c.async=1;c.src=w;t=m.getElementsByTagName(e)[0];t.parentNode.insertBefore(c,t);})
(document,'script','https://www.mews.li/distributor/distributor.min.js',[['${
data.datoCmsHostel.mewsId
}']]);`}
</script>
<script type="application/ld+json">
{JSON.stringify(schemaOrgJSONLD)}
@shansmith01
shansmith01 / custom-gallery-format-for-wordpress.md
Last active October 13, 2019 14:42 — forked from TMMC/custom-gallery-format-for-wordpress.md
Custom gallery format for WordPress (using Bootstrap v4 grid).
@shansmith01
shansmith01 / test.php
Created August 13, 2017 07:07
Test Gist
A file