Commit 2a452b41 authored by Kaushal Modi's avatar Kaushal Modi

Support string tweet ID's

This is needed as the tweet ID's like 10040216507682529280 cannot be stored as
64-bit signed integer, and would cause overflow.
parent 1016452d
......@@ -13,12 +13,18 @@
-->
{{ with .Params.syndication }}
{{ range $key, $val := . }}
{{ $val_is_string := (eq "string" (printf "%T" $val)) }}
{{ range $.Param "social" }}
{{ if (eq $key (.name | lower)) }}
{{ $.Scratch.Set "__syndication_class" "" }}
{{ if (and (eq $key "twitter") (gt $val 0)) }}
{{ $.Scratch.Set "__syndication_link" (printf "%sstatus/%d" .link $val) }}
{{ $.Scratch.Set "__syndication_class" (.name | lower) }}
{{ if (eq $key "twitter") }}
{{ if $val_is_string }}
{{ $.Scratch.Set "__syndication_link" (printf "%sstatus/%s" .link $val) }}
{{ $.Scratch.Set "__syndication_class" (.name | lower) }}
{{ else if (gt $val 0) }}
{{ $.Scratch.Set "__syndication_link" (printf "%sstatus/%d" .link $val) }}
{{ $.Scratch.Set "__syndication_class" (.name | lower) }}
{{ end }}
{{ end }}
{{ if ($.Scratch.Get "__syndication_class") }}
<a rel="syndication"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment