mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 11:25:26 +01:00 
			
		
		
		
	post-cover-image : add support for cover image for post
usage with post params =>
    cover = "<absolute image url>"
			
			
This commit is contained in:
		| @@ -90,6 +90,13 @@ | |||||||
|     font-size: 14px; |     font-size: 14px; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | .entry-cover img { | ||||||
|  |     border-radius: var(--radius); | ||||||
|  |     margin-bottom: var(--gap); | ||||||
|  |     pointer-events: none; | ||||||
|  |     width: 100%; | ||||||
|  | } | ||||||
|  |  | ||||||
| .social-icons a { | .social-icons a { | ||||||
|     margin: 2px; |     margin: 2px; | ||||||
|     padding: 6px; |     padding: 6px; | ||||||
|   | |||||||
| @@ -32,6 +32,11 @@ | |||||||
| {{- $class = "post-entry tag-entry" }} | {{- $class = "post-entry tag-entry" }} | ||||||
| {{- end }} | {{- end }} | ||||||
| <article class="{{ $class }}"> | <article class="{{ $class }}"> | ||||||
|  |   {{ if .Params.cover }} | ||||||
|  |   <figure class="entry-cover"> | ||||||
|  |     <img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title }}"> | ||||||
|  |   </figure> | ||||||
|  |   {{ end }} | ||||||
|   <header class="entry-header"> |   <header class="entry-header"> | ||||||
|     <h2> |     <h2> | ||||||
|       {{ .Title }} |       {{ .Title }} | ||||||
|   | |||||||
| @@ -14,6 +14,11 @@ | |||||||
|     </div> |     </div> | ||||||
|     {{end}} |     {{end}} | ||||||
|   </header> |   </header> | ||||||
|  |   {{ if .Params.cover }} | ||||||
|  |   <figure class="entry-cover"> | ||||||
|  |     <img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title | plainify }}"> | ||||||
|  |   </figure> | ||||||
|  |   {{ end }} | ||||||
|   {{ if .Params.ShowToc }} |   {{ if .Params.ShowToc }} | ||||||
|   <div class="toc"> |   <div class="toc"> | ||||||
|     <details> |     <details> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange