When creating a new post with new post -all, users should be asked to choose page type.
These should be based on the types available at schema.org
The default should be post if using new post, or page if using new page.
The list of valid options should be:
post (blogPosting)
page (webPage)
article
book
howTo
review
event
product (individualProduct)
softwareSourceCode
Depending on the 'type' chosen, the user should be asked for extra info,
and the page generated should contain the extra JSON-LD meta info.
The extra info could be something like:
location (lat long)
exact date and time of an event (use a <datetime>)
price (if product)
rating (if review)
... etc
Depending on the page type, extra content could be included on the page, for example:
a map on the page (if type has a location)
the extra meta info in post header/footer
buy now button (if product with price)
.. other stuff
example implementation
To use it:
$ new post -all
and you will be asked to give extra info, such as:
Choose a page type (post,page,howTo,event,product,review): product
Enter a price: £12.99
...
the code to generate the template vars that are specific to the page type:
case "$page_type" in
post) ;;
page) ;;
product)
# set any type specific vars
item_price="${post_price}"
# if these custom vars need to appear inside a loop (in the templates):
list="$(ls some/dir | whatever)"
for item in $list
# define any vars used in the templates ITEMS array
item_price="${post_price}"
# add the vars to the ITEMS array
eval $(add_hash_to_array)
done
# then generate any type specific HTML from the relvant templates
ld_product="$(render _product json-ld)"
;;
*)
esac
When creating a new post with
new post -all
, users should be asked to choose page type.These should be based on the types available at schema.org
The default should be
post
if usingnew post
, orpage
if usingnew page
.The list of valid options should be:
Depending on the 'type' chosen, the user should be asked for extra info, and the page generated should contain the extra JSON-LD meta info.
The extra info could be something like:
<datetime>
)Depending on the page type, extra content could be included on the page, for example:
buy now button (if product with price) .. other stuff
example implementation
To use it:
and you will be asked to give extra info, such as:
the code to generate the template vars that are specific to the page type: