mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
feat: works if no img specified or no img.link specified
This commit is contained in:
parent
f7b26bef73
commit
c2bc65e9c9
@ -6,7 +6,6 @@
|
||||
.home-info-container img {
|
||||
flex: 1;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-width: 600px;
|
||||
margin-right: 20px;
|
||||
@ -14,7 +13,6 @@
|
||||
}
|
||||
|
||||
.home-info-container ul {
|
||||
padding-left: 20px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
|
@ -4,10 +4,17 @@
|
||||
<h1>{{ .title | markdownify }}</h1>
|
||||
</header>
|
||||
<div class="home-info-container">
|
||||
<a href="{{ .image.link | absURL }}" target="_blank" rel="noopener">
|
||||
{{- if .image.url}}
|
||||
{{- if .image.link -}}
|
||||
<a href="{{ .image.link | absURL }}" target="_blank" rel="noopener" style="width: 100%">
|
||||
<img draggable="false" src="{{ .image.url | absURL }}" alt=" {{ .image.title | default "profile image" }}"
|
||||
title="{{ .image.title }}" height="{{ .image.height | default 150 }}" width="{{ .image.width | default 150 }}" />
|
||||
</a>
|
||||
{{- else }}
|
||||
<img draggable="false" src="{{ .image.url | absURL }}" alt=" {{ .image.title | default "profile image" }}"
|
||||
title="{{ .image.title }}" height="{{ .image.height | default 150 }}" width="{{ .image.width | default 150 }}" />
|
||||
{{- end }}
|
||||
{{- end}}
|
||||
<div class="entry-content">
|
||||
{{ .content | markdownify }}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user