{{- /* twitter-cards.html (partial): Generates Twitter Card metadata for social sharing, embedding it in the page `
`. Features: - Card Type (`twitter:card`): Dynamically set to `summary_large_image` if a suitable image is found, otherwise defaults to `summary`. - Image (`twitter:image` and `twitter:image:alt`): - Prioritizes page resources matching "*-social.*". - Falls back to the first page resource matching common image extensions. - Alt text is sourced from corresponding page parameters (`socialImgDesc` or `imgDesc`). - Title (`twitter:title`): From the page's `.Title`. - Description (`twitter:description`): From `page.Params.socialDesc` or `.Description`. - Twitter Handles (`twitter:site`, `twitter:creator`): From `site.Params. twitterSite` and `page.Params.twitterUsername`. Note: - Image paths are resolved to permalinks. - Text content is plainified for compatibility. Repo: https://github.com/oxypteros/alpha */ -}} {{- $seo_img := .Resources.GetMatch "*-social.*" }}{{- /*1200 x 675*/}} {{- $img := .Resources.GetMatch "*.{png,jpg,jpeg,webp,gif}" }} {{- if $seo_img }} {{- with $seo_img }} {{- end }} {{- with .Page.Params.socialImgDesc }} {{- end }} {{- else if $img }} {{- with $img }} {{- end }} {{- with .Page.Params.imgDesc }} {{- end }} {{- else }} {{- end }} {{- with .Title }} {{- end }} {{- with or .Page.Params.socialDesc .Description | plainify | htmlUnescape}} {{- end }} {{- $site := .Site.Params.twitterSite -}} {{- $creator := .Page.Params.twitterUsername -}} {{- if and $site $creator }} {{- else if $site }} {{- else if $creator }} {{- end }}