Skip to content

Commit

Permalink
Merge pull request #57 from ai-models/main
Browse files Browse the repository at this point in the history
Set it up to automatically apply default thumbnail if image isn't set
  • Loading branch information
neural-loop authored Oct 24, 2023
2 parents 0e7b37f + 99ece24 commit fffe4d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
{{ end }}
{{ end }}

{{ $image := "https://open-neuromorphic.org/images/workshop-thumbnail-default.png" }} <!-- set default image first -->
{{ if .Params.image }}
{{ $image = printf "https://open-neuromorphic.org%s%s" .RelPermalink .Params.image }} <!-- if exists, update to new path -->
{{ end }}

<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand All @@ -23,21 +28,19 @@
"location": {
"@type": "VirtualLocation",
"url": "https://youtube.com/@openneuromorphic"
},
"image": [
"https://open-neuromorphic.org{{ .RelPermalink }}{{ .Params.image }}"
],
},
"image": [{{ $image }}],
"description": "{{ .Params.Description }}",
"offers": {
"@type": "Offer",
"price": "0"
},
"performer": [
{{ $authors := .Params.author }}
{{ $authors := .Params.author }}
{{ range $index, $author := $authors }}
{
"@type": "Person",
"name": "{{ $author }}"
"@type": "Person",
"name": "{{ $author }}"
}
{{ if ne (add $index 1) (len $authors) }},{{ end }}
{{ end }}
Expand Down
11 changes: 5 additions & 6 deletions themes/hugoplate/layouts/workshops/single.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{{ define "main" }}
{{ partial "page-header" . }}

<section class="section pt-14">
<div class="container">
<article class="row justify-center">
<div class="lg:col-8 mb-7">
<div class="mb-4">
{{ $image:= .Params.image }}
{{ if .Params.video }}
<div class="mb-4">
{{ partial "youtube-lite.html" (dict "Id" .Params.video ) }}
</div>
{{ partial "youtube-lite.html" (dict "Id" .Params.video ) }}
{{ else if $image }}
<div class="mb-4">
{{ partial "override-image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "w-full rounded") }}
</div>
{{ else }}
{{ partial "override-image" (dict "Src" "images/workshop-thumbnail-default.png" "Alt" .Title "Class" "w-full rounded") }}
{{ end }}
</div>
<ul class="mb-5">
<li class="mr-2 inline-block">
<i class="fa-regular fa-circle-user mr-2"></i>{{delimit .Params.author ", "}}
Expand Down

0 comments on commit fffe4d0

Please sign in to comment.