adds site meta, SEO, and Open Graph data
This commit is contained in:
		
							
								
								
									
										10
									
								
								config.toml
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								config.toml
									
									
									
									
									
								
							| @@ -10,3 +10,13 @@ theme = "hugo-starter-tailwind-basic" | ||||
|  | ||||
| [minify] | ||||
|   minifyOutput = true | ||||
|  | ||||
| [params] | ||||
|   description = "The Protocol Oral History Project chronicles the development of internet protocols and standards through interviews with key contributors." | ||||
|   images = ["/images/default-og.jpg"] # Will be replaced by wompum generation | ||||
|   twitterSite = "" | ||||
|   facebookAppID = "" | ||||
|  | ||||
| [params.author] | ||||
|   name = "Media Economies Design Lab" | ||||
|   twitter = "" | ||||
| @@ -1,17 +1,85 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <html lang="{{ .Site.LanguageCode | default "en" }}"> | ||||
|   <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <title> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
|      | ||||
|     {{/* Generate consistent title */}} | ||||
|     {{ $title := "" }} | ||||
|     {{ if .Params.narrator }} | ||||
|         {{ printf "%s: %s" .Params.narrator .Params.subject }} | ||||
|       {{ $title = printf "%s: %s" .Params.narrator .Params.subject }} | ||||
|     {{ else if .IsHome }} | ||||
|         {{ .Title }} | ||||
|       {{ $title = .Title }} | ||||
|     {{ else }} | ||||
|         {{ .Title }} - {{ site.Title }} | ||||
|       {{ $title = printf "%s - %s" .Title .Site.Title }} | ||||
|     {{ end }} | ||||
|     </title> | ||||
|     <meta name="description" content="{{ .Description }}" /> | ||||
|      | ||||
|     <!-- Basic SEO --> | ||||
|     <title>{{ $title }}</title> | ||||
|      | ||||
|     {{/* Generate description from summary, description, or default site description */}} | ||||
|     {{ $description := "" }} | ||||
|     {{ with .Description }} | ||||
|       {{ $description = . }} | ||||
|     {{ else }} | ||||
|       {{ with .Summary }} | ||||
|         {{ $description = . | plainify | truncate 160 }} | ||||
|       {{ else }} | ||||
|         {{ $description = .Site.Params.description }} | ||||
|       {{ end }} | ||||
|     {{ end }} | ||||
|     <meta name="description" content="{{ $description }}" /> | ||||
|      | ||||
|     {{/* Generate keywords from tags */}} | ||||
|     {{ with .Params.tags }} | ||||
|     <meta name="keywords" content="{{ delimit . ", " }}" /> | ||||
|     {{ end }} | ||||
|      | ||||
|     <!-- Open Graph / Facebook --> | ||||
|     <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> | ||||
|     <meta property="og:url" content="{{ .Permalink }}" /> | ||||
|     <meta property="og:title" content="{{ $title }}" /> | ||||
|     <meta property="og:description" content="{{ $description }}" /> | ||||
|     {{ with .Params.images | default .Site.Params.images }} | ||||
|     <meta property="og:image" content="{{ index . 0 | absURL }}" /> | ||||
|     {{ end }} | ||||
|     {{ with .Site.Params.facebookAppID }} | ||||
|     <meta property="fb:app_id" content="{{ . }}" /> | ||||
|     {{ end }} | ||||
|      | ||||
|     <!-- Twitter --> | ||||
|     <meta name="twitter:card" content="summary_large_image" /> | ||||
|     <meta name="twitter:title" content="{{ $title }}" /> | ||||
|     <meta name="twitter:description" content="{{ $description }}" /> | ||||
|     {{ with .Params.images }} | ||||
|     <meta name="twitter:image" content="{{ index . 0 | absURL }}" /> | ||||
|     {{ end }} | ||||
|      | ||||
|     <!-- Article Specific --> | ||||
|     {{ if and .IsPage (eq .Type "articles") }} | ||||
|     <meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" /> | ||||
|     <meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}" /> | ||||
|     <meta property="article:section" content="Oral History" /> | ||||
|     {{ with .Params.tags }} | ||||
|     {{ range . }} | ||||
|     <meta property="article:tag" content="{{ . }}" /> | ||||
|     {{ end }} | ||||
|      | ||||
|     {{ end }} | ||||
|      | ||||
|     {{/* Author information using standard meta tags instead of article:author */}} | ||||
|     {{ with .Params.narrator }} | ||||
|     <meta name="author" content="{{ . }}" /> | ||||
|     {{ end }} | ||||
|     {{ with .Params.facilitator }} | ||||
|     <meta name="interviewer" content="{{ . }}" /> | ||||
|     {{ end }} | ||||
|     {{ end }} | ||||
|      | ||||
|     <!-- Canonical URL --> | ||||
|     <link rel="canonical" href="{{ .Permalink }}" /> | ||||
|      | ||||
|     <!-- CSS Variables and Styles --> | ||||
|     {{ partial "css-variables.html" . }} | ||||
|      | ||||
|     {{/* Main Styles */}} | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								static/images/default-og.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								static/images/default-og.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 66 KiB | 
		Reference in New Issue
	
	Block a user