Skip to content

Commit 6f12b7f

Browse files
Refactor author JSON-LD structure in jsonld.njk
Add in author resolution to prevent stubs and also added in additional details about the org.
1 parent db24763 commit 6f12b7f

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/_includes/jsonld.njk

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,28 @@
9494
{% endif %}
9595
"datePublished": "{{ date | dateToRfc3339 }}",
9696
"dateModified": "{{ (lastUpdated or date) | dateToRfc3339 }}",
97+
{% if author %}
9798
"author": {
9899
"@type": "Person",
99-
"name": "{{ authors }}",
100-
"url": "https://flowfuse.com/about/#{{ authors }}"
100+
"@id": "https://flowfuse.com/about/#{{ authorSlug }}",
101+
"name": "{{ author.name }}",
102+
{% if author.title %}"jobTitle": "{{ author.title }}",{% endif %}
103+
"url": "https://flowfuse.com/about/#{{ authorSlug }}",
104+
{% if author.headshot %}"image": "https://flowfuse.com/images/team/headshot-{{ author.headshot | replace('.png','') | replace('.jpg','') | replace('.jpeg','') }}.png",{% endif %}
105+
{% if author.bio %}"description": {{ author.bio | dump | safe }},{% endif %}
106+
{% if author.knowsAbout %}"knowsAbout": {{ author.knowsAbout | dump | safe }},{% endif %}
107+
"worksFor": { "@id": "https://flowfuse.com/#organization" },
108+
"sameAs": [
109+
{% set socials = [] %}
110+
{% if author.linkedin %}{% set socials = (socials.push("https://www.linkedin.com/in/" + author.linkedin), socials) %}{% endif %}
111+
{% if author.github %}{% set socials = (socials.push("https://github.com/" + author.github), socials) %}{% endif %}
112+
{% if author.twitter %}{% set socials = (socials.push("https://twitter.com/" + author.twitter), socials) %}{% endif %}
113+
{% for url in socials %}"{{ url }}"{% if not loop.last %},{% endif %}{% endfor %}
114+
]
101115
},
116+
{% else %}
117+
"author": { "@id": "https://flowfuse.com/#organization" },
118+
{% endif %}
102119
"publisher": {
103120
"@id": "https://flowfuse.com/#organization"
104121
}

0 commit comments

Comments
 (0)