add tags and categories

This commit is contained in:
geekifan
2025-04-23 09:21:54 +08:00
parent 4648863457
commit 370180de16
11 changed files with 270 additions and 26 deletions

View File

@ -17,28 +17,7 @@
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
>
{{ template "_internal/opengraph.html" }}
{{ template "_internal/twitter_cards.html" }}
{{ template "_internal/schema.html" }}
<!-- Setup Open Graph image -->
{{ if .Params.image }}
{{ $src := .Params.image }}
{{ $imgUrl := "" }}
{{ if not (findRE "://" $src) }}
{{ $imgUrl = absURL $src }}
{{ $oldUrl := $src | absURL }}
{{ $newUrl := $imgUrl }}
<!-- Hugo doesn't have direct string replacement in templates,
so we'd need to handle this differently or use a custom function -->
{{ end }}
{{ else if site.Params.social_preview_image }}
{{ $imgUrl := site.Params.social_preview_image | absURL }}
<meta property="og:image" content="{{ $imgUrl }}" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:image" content="{{ $imgUrl }}" />
{{ end }}
<title>
{{ if ne .Kind "home" }}