-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Lines 225 to 238 in 88026c8
| # Check if LD+JSON is enabled and add structured data to the <head> | |
| if self.config["add_json_ld"]: | |
| ld_json_script = soup.new_tag("script", type="application/ld+json") | |
| ld_json_content = { | |
| "@context": "https://schema.org", | |
| "@type": "Article", | |
| "headline": page.title, | |
| "image": [page.meta["image"]] if "image" in page.meta else [], | |
| "datePublished": git_info["creation_date"], | |
| "dateModified": git_info["last_modified_date"], | |
| "author": [{"@type": "Organization", "name": "Ultralytics", "url": "https://ultralytics.com/"}], | |
| } | |
| ld_json_script.string = json.dumps(ld_json_content) | |
| soup.head.append(ld_json_script) |
Include additional JSON-LD types:
- Dataset (reference)
- FAQ
- etc.
Base the type on the file location, as an example, if the file has dataset in the filename or filepath, it should be a Dataset type.
Metadata
Metadata
Assignees
Labels
No labels