mirror of
				https://github.com/ItsDrike/itsdrike.com.git
				synced 2025-11-04 04:06:36 +00:00 
			
		
		
		
	Support local resource images in content
This commit is contained in:
		
							parent
							
								
									fa18460df0
								
							
						
					
					
						commit
						fb21e83c33
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,12 @@
 | 
			
		|||
 | 
			
		||||
{{ if .Params.image }}
 | 
			
		||||
  <img class="mb-3 header-image" src='{{ .Params.image }}' />
 | 
			
		||||
  {{ .Scratch.Set "image" .Params.image }}
 | 
			
		||||
  {{ if hasPrefix .Params.image "resource:" }}
 | 
			
		||||
    {{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }}
 | 
			
		||||
    {{ .Scratch.Set "image" ($resource.Resize "2000x").RelPermalink }}
 | 
			
		||||
  {{ end }}
 | 
			
		||||
 | 
			
		||||
  <img class="mb-3 header-image" src='{{ .Scratch.Get "image" }}' />
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
<h1 class="display-4">{{ .Title }}</h1>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue