-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Tina fields setting the SEO for both docs and blogs (#2433)
* added seo for both docs and blogs * re-adding openGraph stuff * removing linting ignore decorators * tina lock file
- Loading branch information
1 parent
a0e5664
commit 91c586b
Showing
9 changed files
with
150 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { TextInputWithCount } from "../../customTinaFormFields/textInputWithCount"; | ||
|
||
|
||
export const seoInformation = { | ||
type: "object", | ||
label: "SEO Values", | ||
name: "seo", | ||
fields: [ | ||
{ | ||
type: "string", | ||
label: "Title", | ||
description: "Recommended limit of 70 characters", | ||
name: "title", | ||
ui: { | ||
validate: (value) => { | ||
if (value && value.length > 70) { | ||
return "Title should be 70 characters or less"; | ||
} | ||
}, | ||
component: TextInputWithCount(70), | ||
}, | ||
}, | ||
{ | ||
type: "string", | ||
label: "Description", | ||
description: "Recommended limit of 150 characters", | ||
name: "description", | ||
component: "textarea", | ||
ui: { | ||
component: TextInputWithCount(150, true), | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//ripped out from SSW's Website 😳 | ||
|
||
import React from "react"; | ||
import { wrapFieldsWithMeta } from "tinacms"; | ||
|
||
export const TextInputWithCount = (max: number, isTextArea: boolean = false) => | ||
wrapFieldsWithMeta(({ input }) => ( | ||
<div className="flex flex-col gap-2"> | ||
{isTextArea ? ( | ||
<textarea | ||
className="focus:shadow-outline block min-h-40 w-full resize-y rounded-md border border-gray-200 px-3 py-2 text-base text-gray-600 shadow-inner focus:border-blue-500 focus:text-gray-900" | ||
{...input} | ||
/> | ||
) : ( | ||
<input | ||
className="focus:shadow-outline block w-full rounded-md border border-gray-200 bg-white px-3 py-2 text-base text-gray-600 shadow-inner transition-all duration-150 ease-out placeholder:text-gray-300 focus:border-blue-500 focus:text-gray-900 focus:outline-none" | ||
{...input} | ||
/> | ||
)} | ||
<p | ||
className={input.value.length > max ? "text-red-500": "text-gray-500"} | ||
> | ||
{input.value.length}/{max} | ||
</p> | ||
</div> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.