mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	profileMode : init
usaage, in config add
params:
    profileMode:
      title: "PaperMod" // or default will be site.title
      imageUrl: "<image_link>"
			
			
This commit is contained in:
		
							
								
								
									
										29
									
								
								assets/css/profileMode.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								assets/css/profileMode.css
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | .main { | ||||||
|  |     text-align: center; | ||||||
|  |     display: table; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .main>.profile { | ||||||
|  |     display: table-cell; | ||||||
|  |     vertical-align: middle; | ||||||
|  |  | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .main>.profile>.profile_inner { | ||||||
|  |     transform: translate(0, -20%); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | img { | ||||||
|  |     display: inline-block; | ||||||
|  |     width: 200px; | ||||||
|  |     border-radius: 50%; | ||||||
|  |     pointer-events: none; | ||||||
|  |     margin: 5px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @media screen and (max-width: 600px) { | ||||||
|  |     img { | ||||||
|  |         width: 150px; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -1,4 +1,18 @@ | |||||||
| {{ define "main" }} | {{ define "main" }} | ||||||
|  |  | ||||||
|  | {{ if .Site.Params.profileMode }} | ||||||
|  | <div class="profile"> | ||||||
|  |   <div class="profile_inner"> | ||||||
|  |     {{if .Site.Params.profileMode.imageUrl}} | ||||||
|  |     <div> | ||||||
|  |       <img src="{{ .Site.Params.profileMode.imageUrl}}" alt="{{ .Site.Params.profileMode.imageTitle}}" /> | ||||||
|  |     </div> | ||||||
|  |     {{end}} | ||||||
|  |     <h1>{{ if .Site.Params.profileMode.title }}{{.Site.Params.profileMode.title}}{{ else }}{{ .Site.Title }}{{end}}</h1> | ||||||
|  |   </div> | ||||||
|  | </div> | ||||||
|  | {{else}} {{/* if not profileMode */}} | ||||||
|  |  | ||||||
| {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} | {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} | ||||||
| {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} | {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} | ||||||
|  |  | ||||||
| @@ -52,5 +66,5 @@ | |||||||
|   </nav> |   </nav> | ||||||
| </footer> | </footer> | ||||||
| {{- end }} | {{- end }} | ||||||
|  | {{end}}{{/* end profileMode */}} | ||||||
| {{ end  }}{{/* end main */}} | {{ end  }}{{/* end main */}} | ||||||
| @@ -30,6 +30,11 @@ | |||||||
| {{ $stylesheet := slice $anoldhope $style | resources.Concat "css/stylesheet.css" | minify | fingerprint }} | {{ $stylesheet := slice $anoldhope $style | resources.Concat "css/stylesheet.css" | minify | fingerprint }} | ||||||
| <link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" | <link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" | ||||||
|     as="style"> |     as="style"> | ||||||
|  | {{ if (and (.Site.Params.profileMode) (.IsHome)) }} | ||||||
|  | {{ $profileMode := resources.Get "css/profileMode.css" | minify | fingerprint }} | ||||||
|  | <link href="{{ $profileMode.Permalink }}" integrity="{{ $profileMode.Data.Integrity }}" rel="preload stylesheet" | ||||||
|  |     as="style"> | ||||||
|  | {{end}} | ||||||
| <link href="{{ "custom.css" | absURL }}" rel="stylesheet"> | <link href="{{ "custom.css" | absURL }}" rel="stylesheet"> | ||||||
| <!-- Favicons --> | <!-- Favicons --> | ||||||
| <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> | <link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange