index_profile.html (4486B)
1 <div class="profile" style="flex-direction: column;"> 2 {{- with site.Params.profileMode }} 3 <div class="profile_inner"> 4 {{- if .imageUrl -}} 5 {{- $img := "" }} 6 {{- if not (urls.Parse .imageUrl).IsAbs }} 7 {{- $img = resources.Get .imageUrl }} 8 {{- end }} 9 {{- if $img }} 10 {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} 11 {{- if hugo.IsExtended -}} 12 {{- $processableFormats = $processableFormats | append "webp" -}} 13 {{- end -}} 14 {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} 15 {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} 16 {{- if (not (and (not .imageHeight) (not .imageWidth))) }} 17 {{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }} 18 {{- else if .imageHeight }} 19 {{- $img = $img.Resize (printf "x%d" .imageHeight) }} 20 {{ else if .imageWidth }} 21 {{- $img = $img.Resize (printf "%dx" .imageWidth) }} 22 {{ else }} 23 {{- $img = $img.Resize "150x150" }} 24 {{- end }} 25 {{- end }} 26 <img draggable="false" src="{{ $img.Permalink }}" alt="{{ .imageTitle | default "profile image" }}" title="{{ .imageTitle }}" 27 height="{{ .imageHeight | default 150 }}" width="{{ .imageWidth | default 150 }}" /> 28 {{- else }} 29 <img draggable="false" src="{{ .imageUrl | absURL }}" alt="{{ .imageTitle | default "profile image" }}" title="{{ .imageTitle }}" 30 height="{{ .imageHeight | default 150 }}" width="{{ .imageWidth | default 150 }}" /> 31 {{- end }} 32 {{- end }} 33 <h1>{{ .title | default site.Title | markdownify }}</h1> 34 <span>{{ .subtitle | markdownify }}</span> 35 {{- partial "social_icons.html" (dict "align" "center") -}} 36 37 {{- with .buttons }} 38 <div class="buttons"> 39 {{- range . }} 40 <a class="button" href="{{ trim .url " " }}" rel="noopener" title="{{ .name }}"> 41 <span class="button-inner"> 42 {{ .name }} 43 {{- if (findRE "://" .url) }} 44 <svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round" 45 stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="14" width="14"> 46 <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path> 47 <path d="M15 3h6v6"></path> 48 <path d="M10 14L21 3"></path> 49 </svg> 50 {{- end }} 51 </span> 52 </a> 53 {{- end }} 54 </div> 55 {{- end }} 56 </div> 57 {{- end }} 58 {{- with site.Params.homePostListTitle }} 59 <a href="{{ .url | absURL }}" style="text-align: left; width: 100%;"><h2 style="margin: 32px auto 24px;">{{ .title }}</h2></a> 60 {{- end }} 61 {{- $pages := union .RegularPages .Sections }} 62 {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} 63 {{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} 64 {{- $pages = first 3 $pages }} 65 66 {{- $term := .Data.Term }} 67 {{- range $index, $page := $pages }} 68 69 {{- $class := "post-entry" }} 70 {{- if $term }} 71 {{- $class = "post-entry tag-entry" }} 72 {{- end }} 73 74 <article class="post-entry" style="text-align: left; width: 100%; background-"> 75 {{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }} 76 {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} 77 <header class="entry-header"> 78 <h2> 79 {{- .Title }} 80 {{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }} 81 </h2> 82 </header> 83 {{- if (ne (.Param "hideSummary") true) }} 84 <div class="entry-content"> 85 <p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p> 86 </div> 87 {{- end }} 88 {{- if not (.Param "hideMeta") }} 89 <footer class="entry-footer"> 90 {{- partial "post_meta.html" . -}} 91 </footer> 92 {{- end }} 93 <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> 94 </article> 95 {{- end }} 96 </div>