]> _ Git - pmi.git/commitdiff
Implement schema data using JSON-LD for cleaner output and easier customisation of...
authorStephen Cameron <stephen@cubedesigners.com>
Thu, 19 Sep 2019 08:10:52 +0000 (10:10 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Thu, 19 Sep 2019 08:10:52 +0000 (10:10 +0200)
resources/views/pages/aboutus.blade.php

index ac8df0d8610ae8fcb6d0369daf0a72ac8f0182e8..3d2bcce3fb3b6b66c62d77875154a3066166682b 100644 (file)
                             </h4>
                             <p>{{ $staff['role'] }}</p>
                         </div>
+                        {{--
+                            Note: Using JSON-LD format here because it is cleaner and we can customise data
+                            (eg. background image would not have worked as an image property). Google also
+                            prefers this format. Ref: https://softwareengineering.stackexchange.com/a/328711
+                        --}}
+                        <script type="application/ld+json">
+                            {
+                              "@context": "https://schema.org",
+                              "@type": "Person",
+                              "name": "{{ $staff['name'] }}",
+                              "jobTitle": "{{ $staff['role'] }}",
+                              "image": "{{ url('/') . $page->getImageURLByCollection($staff['photo']) }}",
+                            }
+                        </script>
                     @endforeach
                 </grid>
             </content>