begin writing meta tags
This commit is contained in:
5
index.js
5
index.js
@@ -40,7 +40,10 @@ function cleanWebsite(str) {
|
||||
.replace(/\/$/g, "");
|
||||
}
|
||||
|
||||
function metaDescription({meta, description}) {
|
||||
function metaDescription({ name, meta, description }) {
|
||||
if (meta.length > 155) {
|
||||
console.log(`warning: meta tag for ${name} is too long: ${meta.length}`)
|
||||
}
|
||||
return meta || description.length > 155 ? description.slice(0, 153) + "..." : description || "A guide to and map of every independent bookstore in New York City. We have a complete list of community bookstores in NYC with locations and descriptions."
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user