mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 14:35:43 -06:00
commit
723c2e8421
7 changed files with 19 additions and 7 deletions
13
layouts/partials/functions/uid.html
Normal file
13
layouts/partials/functions/uid.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{ $uid := .Page.RelPermalink }}
|
||||
{{ $ctx := . }}
|
||||
|
||||
{{ range seq 16 }}
|
||||
{{ with $ctx }}
|
||||
{{ $uid = printf "%s-%d" $uid .Ordinal }}
|
||||
{{ $ctx = .Parent }}
|
||||
{{ else }}
|
||||
{{ break }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return md5 $uid }}
|
|
@ -1,4 +1,4 @@
|
|||
{{ $id := delimit (slice "carousel" .Ordinal now.UnixNano) "-" }}
|
||||
{{ $id := delimit (slice "carousel" (partial "functions/uid.html" .)) "-" }}
|
||||
{{ $aspect := default "16-9" (.Get "aspectRatio") }}
|
||||
{{ $images := .Page.Resources.Match (.Get "images") }}
|
||||
{{ $interval := default "2000" (.Get "interval") }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ $id := delimit (slice "chart" .Ordinal now.UnixNano) "-" }}
|
||||
{{ $id := delimit (slice "chart" (partial "functions/uid.html" .)) "-" }}
|
||||
<div class="chart">
|
||||
<canvas id="{{ $id }}"></canvas>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{{ $random := delimit (shuffle (seq 1 9)) "" }}
|
||||
{{ $id := delimit (slice "gallery" $random now.UnixNano) "-" }}
|
||||
{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" }}
|
||||
|
||||
<div id="{{ $id }}" class="gallery">
|
||||
{{ .Inner }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ $id := delimit (slice "github" .Ordinal now.UnixNano) "-" }}
|
||||
{{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
|
||||
{{- $githubData := getJSON ($githubURL) -}}
|
||||
{{- $githubColors := .Site.Data.githubColors -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ $id := delimit (slice "gitlab" .Ordinal now.UnixNano) "-" }}
|
||||
{{ $id := delimit (slice "gitlab" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $gitlabURL := print (default "https://gitlab.com/" (.Get "baseURL")) "api/v4/projects/" (.Get "projectID") -}}
|
||||
|
||||
{{- $gitLabData := getJSON ($gitlabURL) -}}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{- end -}}
|
||||
{{- $tag := .Get "tag" | default "div" -}}
|
||||
|
||||
{{ $id := delimit (slice "typeit" .Ordinal now.UnixNano) "-" }}
|
||||
{{ $id := delimit (slice "typeit" (partial "functions/uid.html" .)) "-" }}
|
||||
|
||||
{{- $attrs := printf `id="%v"` $id -}}
|
||||
{{- with $classList -}}
|
||||
|
|
Loading…
Reference in a new issue