update theme
This commit is contained in:
parent
fc43dba964
commit
93fea0ed81
183 changed files with 6015 additions and 6241 deletions
|
@ -12,18 +12,16 @@
|
|||
{{ if not ($.Scratch.Get "cardColor") }}
|
||||
class="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900"
|
||||
{{ else }}
|
||||
class="flex px-4 py-3 rounded-md"
|
||||
style="background-color: {{ $.Scratch.Get "cardColor" }}"
|
||||
{{ end }}>
|
||||
|
||||
class="flex px-4 py-3 rounded-md" style="background-color: {{ $.Scratch.Get "cardColor" }}"
|
||||
{{ end }}
|
||||
>
|
||||
<span
|
||||
{{ if not ($.Scratch.Get "iconColor") }}
|
||||
class="text-primary-400 ltr:pr-3 rtl:pl-3 flex items-center"
|
||||
{{ else }}
|
||||
class="ltr:pr-3 rtl:pl-3 flex items-center"
|
||||
style="color: {{ $.Scratch.Get "iconColor" }}"
|
||||
{{ end }}>
|
||||
|
||||
class="ltr:pr-3 rtl:pl-3 flex items-center" style="color: {{ $.Scratch.Get "iconColor" }}"
|
||||
{{ end }}
|
||||
>
|
||||
{{ partial "icon.html" ($.Scratch.Get "icon") }}
|
||||
</span>
|
||||
|
||||
|
@ -32,8 +30,8 @@
|
|||
class="dark:text-neutral-300"
|
||||
{{ else }}
|
||||
style="color: {{ $.Scratch.Get "textColor" }}"
|
||||
{{ end }}>
|
||||
|
||||
{{ end }}
|
||||
>
|
||||
{{- .Inner | markdownify -}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{{ $parent := .Page.RelPermalink }}
|
||||
<section class="space-y-10 w-full">
|
||||
{{ $RelPermalink := .Get "link" }}
|
||||
{{ range ( where .Site.RegularPages "RelPermalink" $RelPermalink | first 1 ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
</section>
|
||||
{{ $link := .Get "link" }}
|
||||
{{ $target := .Page }}
|
||||
{{ if ne $link .Page.RelPermalink }}
|
||||
{{ $target = index (first 1 (where .Site.AllPages "RelPermalink" $link)) 0 }}
|
||||
{{ end }}
|
||||
{{ if $target }}
|
||||
<section class="space-y-10 w-full">
|
||||
{{ partial "article-link/simple.html" $target }}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
{{ with .Get "href" }}href="{{ . }}"{{ end }}
|
||||
{{ with .Get "target" }}target="{{ . }}"{{ end }}
|
||||
{{ with .Get "rel" }}rel="{{ . }}"{{ end }}
|
||||
role="button"
|
||||
>
|
||||
role="button">
|
||||
{{ .Inner }}
|
||||
</a>
|
||||
|
|
|
@ -4,71 +4,98 @@
|
|||
|
||||
{{ $page := .Page.Resources }}
|
||||
{{ $imagesTemp := .Get "images" }}
|
||||
{{ $imagesTemp = strings.TrimPrefix "{" $imagesTemp }}
|
||||
{{ $imagesTemp = strings.TrimSuffix "}" $imagesTemp }}
|
||||
{{ $imagesTemp = strings.TrimPrefix "{" $imagesTemp }}
|
||||
{{ $imagesTemp = strings.TrimSuffix "}" $imagesTemp }}
|
||||
{{ $imagesTemp := strings.Split $imagesTemp "," }}
|
||||
{{ $images := slice}}
|
||||
{{ $images := slice }}
|
||||
{{ range $imagesTemp }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ $images = $images | append (resources.GetRemote .) }}
|
||||
{{ else }}
|
||||
{{ $images = $images | append ($page.Match .) }}
|
||||
{{ end }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ $images = $images | append (resources.GetRemote .) }}
|
||||
{{ else }}
|
||||
{{ $images = $images | append ($page.Match .) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div id="{{ $id }}" class="relative" data-twe-carousel-init data-twe-ride="carousel">
|
||||
<div class="absolute right-0 bottom-0 left-0 z-[2] mx-[15%] mb-10 flex list-none justify-center p-0"
|
||||
data-twe-carousel-indicators>
|
||||
|
||||
{{ $num := 0 }}
|
||||
{{ range $images }}
|
||||
|
||||
<button type="button" data-twe-target="#{{ $id }}" data-twe-slide-to="{{ $num }}" {{ if eq $num 0 }} data-twe-carousel-active aria-current="true" {{ end }}
|
||||
<div
|
||||
class="absolute right-0 bottom-0 left-0 z-2 mx-[15%] mb-10 flex list-none justify-center p-0"
|
||||
data-twe-carousel-indicators>
|
||||
{{ $num := 0 }}
|
||||
{{ range $images }}
|
||||
<button
|
||||
type="button"
|
||||
data-twe-target="#{{ $id }}"
|
||||
data-twe-slide-to="{{ $num }}"
|
||||
{{ if eq $num 0 }}data-twe-carousel-active aria-current="true"{{ end }}
|
||||
class="mx-[3px] box-content h-[3px] w-[30px] flex-initial cursor-pointer border-0 border-y-[10px] border-solid border-transparent bg-neutral bg-clip-padding p-0 -indent-[999px] opacity-50 transition-opacity duration-[600ms] ease-[cubic-bezier(0.25,0.1,0.25,1.0)] motion-reduce:transition-none"
|
||||
aria-label="Slide {{ $num }}"></button>
|
||||
|
||||
{{ $num = add $num 1 }}
|
||||
{{ end }}
|
||||
{{ $num = add $num 1 }}
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
<div class="relative w-full overflow-hidden after:clear-both after:block after:content-['']">
|
||||
|
||||
{{ $num := 0 }}
|
||||
{{ range $images }}
|
||||
|
||||
<div class="relative float-left -mr-[100%] {{ if not (eq $num 0) }} hidden {{ end }} w-full transition-transform duration-[{{ $interval }}ms] ease-in-out motion-reduce:transition-none"
|
||||
data-twe-carousel-item {{ if eq $num 0 }} data-twe-carousel-active {{ end }}>
|
||||
<div class="ratio-{{ $aspect }} single_hero_background">
|
||||
<img src="{{ .RelPermalink }}" class="block absolute top-0 object-cover w-full h-full nozoom" alt="carousel image {{$num}}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative w-full overflow-hidden after:clear-both after:block after:content-['']">
|
||||
{{ $num := 0 }}
|
||||
{{ range $images }}
|
||||
<div
|
||||
class="relative float-left -mr-[100%] {{ if not (eq $num 0) }}
|
||||
hidden
|
||||
{{ end }} w-full transition-transform duration-[{{ $interval }}ms] ease-in-out motion-reduce:transition-none"
|
||||
data-twe-carousel-item
|
||||
{{ if eq $num 0 }}data-twe-carousel-active{{ end }}>
|
||||
<div class="ratio-{{ $aspect }} single_hero_background">
|
||||
<img
|
||||
src="{{ .RelPermalink }}"
|
||||
class="block absolute top-0 object-cover w-full h-full nozoom"
|
||||
alt="carousel image {{ $num }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ $num = add $num 1 }}
|
||||
{{ end }}
|
||||
{{ $num = add $num 1 }}
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
<button
|
||||
class="absolute top-0 bottom-0 left-0 z-[2] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
|
||||
type="button" data-twe-target="#{{ $id }}" data-twe-slide="prev">
|
||||
<span class="inline-block h-8 w-8">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4.5"
|
||||
stroke="currentColor" class="h-6 w-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" />
|
||||
</svg>
|
||||
</span>
|
||||
<span
|
||||
class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]">Previous</span>
|
||||
</button>
|
||||
<button
|
||||
class="absolute top-0 bottom-0 right-0 z-[1] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
|
||||
type="button" data-twe-target="#{{ $id }}" data-twe-slide="next">
|
||||
<span class="inline-block h-8 w-8">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4.5"
|
||||
stroke="currentColor" class="h-6 w-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
|
||||
</svg>
|
||||
</span>
|
||||
<span
|
||||
class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]">Nextsads</span>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="absolute top-0 bottom-0 left-0 z-2 flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
|
||||
type="button"
|
||||
data-twe-target="#{{ $id }}"
|
||||
data-twe-slide="prev">
|
||||
<span class="inline-block h-8 w-8">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="4.5"
|
||||
stroke="currentColor"
|
||||
class="h-6 w-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" />
|
||||
</svg>
|
||||
</span>
|
||||
<span
|
||||
class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]"
|
||||
>Previous</span
|
||||
>
|
||||
</button>
|
||||
<button
|
||||
class="absolute top-0 bottom-0 right-0 z-[1] flex w-[15%] items-center justify-center border-0 bg-none p-0 text-center text-white opacity-50 transition-opacity duration-150 ease-[cubic-bezier(0.25,0.1,0.25,1.0)] hover:text-white hover:no-underline hover:opacity-90 hover:outline-none focus:text-white focus:no-underline focus:opacity-90 focus:outline-none motion-reduce:transition-none"
|
||||
type="button"
|
||||
data-twe-target="#{{ $id }}"
|
||||
data-twe-slide="next">
|
||||
<span class="inline-block h-8 w-8">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="4.5"
|
||||
stroke="currentColor"
|
||||
class="h-6 w-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
|
||||
</svg>
|
||||
</span>
|
||||
<span
|
||||
class="!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]"
|
||||
>Nextsads</span
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -1,67 +1,59 @@
|
|||
{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}}
|
||||
{{- $codebergData := resources.GetRemote $codebergURL | transform.Unmarshal -}}
|
||||
{{- $codebergColors := .Site.Data.codebergColors -}}
|
||||
{{- with $codebergData -}}
|
||||
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
|
||||
{{ partial "icon.html" "codeberg" }}
|
||||
</span>
|
||||
<div class="codeberg-card-wrapper">
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral mr-[10px]">
|
||||
{{ partial "icon.html" "codeberg" }}
|
||||
</span>
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
{{ $language := .language | default "fallback" }}
|
||||
{{ $className := printf "background-color-%s" (md5 $language) }}
|
||||
<span
|
||||
class="mr-1 inline-block h-3 w-3 rounded-full {{ $className }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
||||
<span class="mr-1 inline-block h-3 w-3 rounded-full"
|
||||
style="background-color: {{ if .language }} {{- index $codebergColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ $fetchRepo := resources.Get "js/fetch-repo.js" }}
|
||||
{{ $fetchRepo = $fetchRepo | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
|
||||
<script
|
||||
async
|
||||
type="text/javascript"
|
||||
src="{{ $fetchRepo.RelPermalink }}"
|
||||
integrity="{{ $fetchRepo.Data.Integrity }}"
|
||||
data-repo-url="{{ $codebergURL }}"
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
fetch({{ $codebergURL }}, {
|
||||
headers: new Headers({
|
||||
'User-agent': 'Mozilla/4.0 Custom User Agent'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
|
||||
document.getElementById('{{ $id }}-description').innerHTML = data.description;
|
||||
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
|
||||
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{ else }}
|
||||
{{ $endLine = $totalLine }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if gt $startLine $endLine }}
|
||||
{{ errorf "Code Importer Shortcode - startLine is greater than endLine" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
|
||||
{{ if .Get "default" }}
|
||||
{{ partial "shortcodes/figure.html" . }}
|
||||
{{ partial "hugo-embedded/shortcodes/figure-default.html" . }}
|
||||
{{ else }}
|
||||
{{- $url := urls.Parse (.Get "src") }}
|
||||
{{- $altText := .Get "alt" }}
|
||||
|
|
|
@ -1,67 +1,59 @@
|
|||
{{ $id := delimit (slice "forgejo" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $forgejoURL := print (.Get "server" | default .Site.Params.forgejoDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
|
||||
{{- $forgejoData := resources.GetRemote $forgejoURL | transform.Unmarshal -}}
|
||||
{{- $forgejoColors := .Site.Data.forgejoColors -}}
|
||||
{{- with $forgejoData -}}
|
||||
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
|
||||
{{ partial "icon.html" "forgejo" }}
|
||||
</span>
|
||||
<div class="forgejo-card-wrapper">
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral mr-[10px]">
|
||||
{{ partial "icon.html" "forgejo" }}
|
||||
</span>
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
{{ $language := .language | default "fallback" }}
|
||||
{{ $className := printf "background-color-%s" (md5 $language) }}
|
||||
<span
|
||||
class="mr-1 inline-block h-3 w-3 rounded-full {{ $className }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
||||
<span class="mr-1 inline-block h-3 w-3 rounded-full"
|
||||
style="background-color: {{ if .language }} {{- index $forgejoColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ $fetchRepo := resources.Get "js/fetch-repo.js" }}
|
||||
{{ $fetchRepo = $fetchRepo | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
|
||||
<script
|
||||
async
|
||||
type="text/javascript"
|
||||
src="{{ $fetchRepo.RelPermalink }}"
|
||||
integrity="{{ $fetchRepo.Data.Integrity }}"
|
||||
data-repo-url="{{ $forgejoURL }}"
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
fetch({{ $forgejoURL }}, {
|
||||
headers: new Headers({
|
||||
'User-agent': 'Mozilla/4.0 Custom User Agent'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
|
||||
document.getElementById('{{ $id }}-description').innerHTML = data.description;
|
||||
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
|
||||
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" }}
|
||||
{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" -}}
|
||||
{{ $content := .Inner -}}
|
||||
|
||||
<div id="{{ $id }}" class="gallery">
|
||||
{{ $page := .Page }}
|
||||
|
||||
{{/* find all img tags */}}
|
||||
{{ $imgTagRegex := `<img\s+[^>]*>` }}
|
||||
{{ $imgTags := findRE $imgTagRegex .Inner }}
|
||||
{{ $newContent := .Inner }}
|
||||
|
||||
{{ range $imgTags }}
|
||||
{{ $imgTag := . }}
|
||||
{{/* extract src attribute */}}
|
||||
{{ $srcRegex := `src=['"]([^'"]+)['"]` }}
|
||||
{{ $srcMatches := findRESubmatch $srcRegex $imgTag }}
|
||||
|
||||
{{ if $srcMatches }}
|
||||
{{ $srcFull := index (index $srcMatches 0) 0 }}
|
||||
{{ $src := index (index $srcMatches 0) 1 }}
|
||||
|
||||
{{ $resource := $page.Resources.GetMatch $src }}
|
||||
{{ if $resource }}
|
||||
{{ $newSrc := printf `src="%s"` $resource.RelPermalink }}
|
||||
{{ $newImg := replace $imgTag $srcFull $newSrc }}
|
||||
{{ $newContent = replace $newContent $imgTag $newImg }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $newContent | safeHTML }}
|
||||
{{/* find all img tags */}}
|
||||
{{ range findRE `<img\s+[^>]*>` $content -}}
|
||||
{{ $imgTag := . -}}
|
||||
{{/* extract src attribute */}}
|
||||
{{ with findRESubmatch `src=['"]([^'"]+)['"]` $imgTag -}}
|
||||
{{ $srcAttr := index (index . 0) 0 -}}
|
||||
{{ $srcValue := index (index . 0) 1 -}}
|
||||
{{ $srcValueFinal := $srcValue -}}
|
||||
|
||||
{{ if or (hasPrefix $srcValue "http://") (hasPrefix $srcValue "https://") -}}
|
||||
{{ with resources.GetRemote $srcValue -}}{{ $srcValueFinal = .RelPermalink -}}{{ end -}}
|
||||
{{ else -}}
|
||||
{{ with $.Page.Resources.GetMatch $srcValue -}}
|
||||
{{ $srcValueFinal = .RelPermalink -}}
|
||||
{{ else -}}
|
||||
{{ with resources.GetMatch $srcValue -}}{{ $srcValueFinal = .RelPermalink -}}{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $newTag := replace $imgTag $srcAttr (printf `src="%s"` $srcValueFinal) -}}
|
||||
{{ $content = replace $content $imgTag $newTag -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
|
||||
<div id="{{- $id -}}" class="gallery">
|
||||
{{ $content | safeHTML -}}
|
||||
</div>
|
||||
|
|
3
themes/blowfish/layouts/shortcodes/gist.html
Normal file
3
themes/blowfish/layouts/shortcodes/gist.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<script src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{ if len .Params | eq 3 }}
|
||||
?file={{ index .Params 2 }}
|
||||
{{ end }}"></script>
|
|
@ -1,67 +1,59 @@
|
|||
{{ $id := delimit (slice "gitea" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $giteaURL := print (.Get "server" | default .Site.Params.giteaDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
|
||||
{{- $giteaData := resources.GetRemote $giteaURL | transform.Unmarshal -}}
|
||||
{{- $giteaColors := .Site.Data.giteaColors -}}
|
||||
{{- with $giteaData -}}
|
||||
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
|
||||
{{ partial "icon.html" "gitea" }}
|
||||
</span>
|
||||
<div class="gitea-card-wrapper">
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral mr-[10px]">
|
||||
{{ partial "icon.html" "gitea" }}
|
||||
</span>
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
{{ $language := .language | default "fallback" }}
|
||||
{{ $className := printf "background-color-%s" (md5 $language) }}
|
||||
<span
|
||||
class="mr-1 inline-block h-3 w-3 rounded-full {{ $className }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
||||
<span class="mr-1 inline-block h-3 w-3 rounded-full"
|
||||
style="background-color: {{ if .language }} {{- index $giteaColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ $fetchRepo := resources.Get "js/fetch-repo.js" }}
|
||||
{{ $fetchRepo = $fetchRepo | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
|
||||
<script
|
||||
async
|
||||
type="text/javascript"
|
||||
src="{{ $fetchRepo.RelPermalink }}"
|
||||
integrity="{{ $fetchRepo.Data.Integrity }}"
|
||||
data-repo-url="{{ $giteaURL }}"
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
fetch({{ $giteaURL }}, {
|
||||
headers: new Headers({
|
||||
'User-agent': 'Mozilla/4.0 Custom User Agent'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
|
||||
document.getElementById('{{ $id }}-description').innerHTML = data.description;
|
||||
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
|
||||
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,69 +1,75 @@
|
|||
{{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
|
||||
{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}}
|
||||
{{- $githubColors := .Site.Data.githubColors -}}
|
||||
{{- with $githubData -}}
|
||||
{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
|
||||
{{- $showThumbnail := .Get "showThumbnail" | default true -}}
|
||||
|
||||
|
||||
<div class="github-card-wrapper">
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
|
||||
{{ partial "icon.html" "github" }}
|
||||
</span>
|
||||
{{- with $githubData -}}
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
class="w-full md:w-auto p-0 m-0 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
{{- if $showThumbnail -}}
|
||||
<div class="w-full nozoom">
|
||||
<img
|
||||
src="{{ $githubThumbnailURL }}"
|
||||
alt="GitHub Repository Thumbnail"
|
||||
class="nozoom mt-0 mb-0 w-full h-full object-cover">
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<div class="w-full md:w-auto pt-3 p-5">
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral mr-[10px]">
|
||||
{{ partial "icon.html" "github" }}
|
||||
</span>
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
{{ $language := .language | default "fallback" }}
|
||||
{{ $className := printf "background-color-%s" (md5 $language) }}
|
||||
<span
|
||||
class="mr-1 inline-block h-3 w-3 rounded-full {{ $className }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stargazers_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
||||
<span class="mr-1 inline-block h-3 w-3 rounded-full"
|
||||
style="background-color: {{ if .language }} {{- index $githubColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stargazers_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
fetch({{ $githubURL }}, {
|
||||
headers: new Headers({
|
||||
'User-agent': 'Mozilla/4.0 Custom User Agent'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
|
||||
document.getElementById('{{ $id }}-description').innerHTML = data.description;
|
||||
document.getElementById('{{ $id }}-stargazers').innerHTML = data.stargazers_count;
|
||||
document.getElementById('{{ $id }}-forks').innerHTML = data.forks;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{ $fetchRepo := resources.Get "js/fetch-repo.js" }}
|
||||
{{ $fetchRepo = $fetchRepo | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
|
||||
<script
|
||||
async
|
||||
type="text/javascript"
|
||||
src="{{ $fetchRepo.RelPermalink }}"
|
||||
integrity="{{ $fetchRepo.Data.Integrity }}"
|
||||
data-repo-url="{{ $githubURL }}"
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
|
|
@ -3,55 +3,50 @@
|
|||
|
||||
{{- $gitLabData := resources.GetRemote $gitlabURL | transform.Unmarshal -}}
|
||||
{{- with $gitLabData -}}
|
||||
<div class="gitlab-card-wrapper">
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .web_url }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral mr-[10px]">
|
||||
{{ partial "icon.html" "gitlab" }}
|
||||
</span>
|
||||
<div
|
||||
id="{{ $id }}-name_with_namespace"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .name_with_namespace | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .web_url }}" class="cursor-pointer">
|
||||
<div class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
|
||||
{{ partial "icon.html" "gitlab" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-name_with_namespace" class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .name_with_namespace | markdownify }}
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-star_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .star_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-star_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .star_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ $fetchRepo := resources.Get "js/fetch-repo.js" }}
|
||||
{{ $fetchRepo = $fetchRepo | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
|
||||
<script
|
||||
async
|
||||
type="text/javascript"
|
||||
src="{{ $fetchRepo.RelPermalink }}"
|
||||
integrity="{{ $fetchRepo.Data.Integrity }}"
|
||||
data-repo-url="{{ $gitlabURL }}"
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
fetch({{ $gitlabURL }}, {
|
||||
headers: new Headers({
|
||||
'User-agent': 'Mozilla/4.0 Custom User Agent'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('{{ $id }}-name_with_namespace').innerHTML = data.name_with_namespace;
|
||||
document.getElementById('{{ $id }}-description').innerHTML = data.description;
|
||||
document.getElementById('{{ $id }}-star_count').innerHTML = data.star_count;
|
||||
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
{{ $icon := .Get "icon"}}
|
||||
{{ $icon := .Get "icon" }}
|
||||
<div class="flex mt-2">
|
||||
<span
|
||||
class="rounded-full bg-primary-500 dark:bg-primary-400 text-neutral-50 dark:text-neutral-800 px-1.5 py-[1px] text-xs font-normal"
|
||||
>
|
||||
<span class="flex flex-row items-center">
|
||||
{{if $icon}}
|
||||
<span class="mr-1">{{ partial "icon" $icon }}</span>
|
||||
{{ end }}
|
||||
<span> {{- .Inner | markdownify -}} </span>
|
||||
<span
|
||||
class="rounded-full bg-primary-500 dark:bg-primary-400 text-neutral-50 dark:text-neutral-800 px-1.5 py-[1px] text-xs font-normal">
|
||||
<span class="flex flex-row items-center">
|
||||
{{ if $icon }}
|
||||
<span class="mr-1">{{ partial "icon" $icon }}</span>
|
||||
{{ end }}
|
||||
<span> {{- .Inner | markdownify -}} </span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
{{ $limit := .Get "limit" | default 1 }}
|
||||
{{ $title := .Get "title" | default (i18n "shortcode.recent_articles" | emojify) }}
|
||||
{{ $parent := .Page.RelPermalink }}
|
||||
|
@ -7,41 +6,37 @@
|
|||
{{ $value := .Get "value" }}
|
||||
<h2 class="mt-20 text-2xl font-extrabold mb-10">{{ $title }}</h2>
|
||||
|
||||
|
||||
{{ if $cardView | default false}}
|
||||
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ if $cardView | default false }}
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ if $where }}
|
||||
{{ range ( where .Site.RegularPages $where $value | first $limit ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ range ( where .Site.RegularPages $where $value | first $limit ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range .Site.RegularPages | first $limit }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ range .Site.RegularPages | first $limit }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
</section>
|
||||
{{ else }}
|
||||
|
||||
<section class="space-y-10 w-full mt-10 mb-10">
|
||||
<section class="space-y-10 w-full mt-10 mb-10">
|
||||
{{ if $where }}
|
||||
{{ range ( where .Site.RegularPages $where $value | first $limit ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ range ( where .Site.RegularPages $where $value | first $limit ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range .Site.RegularPages | first $limit }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ range .Site.RegularPages | first $limit }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
</section>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div dir="ltr" class="text-left">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $url := .Get "url"}}
|
||||
{{ $url := .Get "url" }}
|
||||
{{ with resources.GetRemote (urls.Parse $url) }}
|
||||
{{ .Content | markdownify }}
|
||||
{{ .Content | markdownify }}
|
||||
{{ else }}
|
||||
{{ errorf "Mardown Importer Shortcode - Unable to get remote resource" . }}
|
||||
{{ errorf "Mardown Importer Shortcode - Unable to get remote resource" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div dir="rtl" class="text-right">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
<div class="flex justify-between">
|
||||
<span
|
||||
class="w-full py-6 mr-3 rounded-md"
|
||||
{{ with .Get 0 }}style="background-color: {{ . }}"{{ end }}
|
||||
></span>
|
||||
{{ with .Get 0 }}style="background-color: {{ . }}"{{ end }}></span>
|
||||
<span
|
||||
class="w-full py-6 mr-3 rounded-md"
|
||||
{{ with .Get 1 }}style="background-color: {{ . }}"{{ end }}
|
||||
></span>
|
||||
{{ with .Get 1 }}style="background-color: {{ . }}"{{ end }}></span>
|
||||
<span
|
||||
class="w-full py-6 mr-3 rounded-md"
|
||||
{{ with .Get 2 }}style="background-color: {{ . }}"{{ end }}
|
||||
></span>
|
||||
{{ with .Get 2 }}style="background-color: {{ . }}"{{ end }}></span>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<ol class="border-l-2 border-primary-500 dark:border-primary-300 list-none">
|
||||
{{- .Inner -}}
|
||||
</ol>
|
||||
</ol>
|
||||
|
|
|
@ -4,26 +4,25 @@
|
|||
{{ $subheader := .Get "subheader" }}
|
||||
<li>
|
||||
<div class="flex flex-start">
|
||||
<div class="bg-primary-500 dark:bg-primary-300 text-neutral-50 dark:text-neutral-700 min-w-[30px] h-8 text-2xl flex items-center justify-center rounded-full -ml-12 mt-5">
|
||||
<div
|
||||
class="bg-primary-500 dark:bg-primary-300 text-neutral-50 dark:text-neutral-700 min-w-[30px] h-8 text-2xl flex items-center justify-center rounded-full -ml-12 mt-5">
|
||||
{{ partial "icon" $icon }}
|
||||
</div>
|
||||
<div class="block p-6 rounded-lg shadow-2xl min-w-full ml-6 mb-10 break-words">
|
||||
<div class="flex justify-between">
|
||||
{{ if $header }}
|
||||
<h2 class="mt-0">
|
||||
{{ $header }}
|
||||
</h2>
|
||||
<h2 class="mt-0">{{ $header }}</h2>
|
||||
{{ end }}
|
||||
{{ if $badge }}
|
||||
<h3 class="">
|
||||
{{ partial "badge" $badge}}
|
||||
</h3>
|
||||
<h3 class="">
|
||||
{{ partial "badge" $badge }}
|
||||
</h3>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if $subheader }}
|
||||
<h4 class="mt-0">
|
||||
{{ $subheader }}
|
||||
</h4>
|
||||
<h4 class="mt-0">
|
||||
{{ $subheader }}
|
||||
</h4>
|
||||
{{ end }}
|
||||
<div class="mb-6">
|
||||
{{- .Inner -}}
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
{{- $startDelay := .Get "startDelay" | default 0 -}}
|
||||
{{- $breakLines := .Get "breakLines" | default true -}}
|
||||
{{- $waitUntilVisible := .Get "waitUntilVisible" | default true -}}
|
||||
{{- $loop := .Get "loop" | default false -}}
|
||||
|
||||
{{- $loop := .Get "loop" | default false -}}
|
||||
{{- $classList := slice -}}
|
||||
{{- with .Get "class" -}}
|
||||
{{- $classList = $classList | append . -}}
|
||||
{{- $classList = $classList | append . -}}
|
||||
{{- end -}}
|
||||
{{- $tag := .Get "tag" | default "div" -}}
|
||||
|
||||
|
@ -17,7 +16,7 @@
|
|||
|
||||
{{- $attrs := printf `id="%v"` $id -}}
|
||||
{{- with $classList -}}
|
||||
{{- $attrs = delimit $classList " " | printf `%v class="%v"` $attrs -}}
|
||||
{{- $attrs = delimit $classList " " | printf `%v class="%v"` $attrs -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ printf `<%v %v>%s</%v>` $tag $attrs $initialString $tag | safeHTML }}
|
||||
|
@ -34,4 +33,4 @@
|
|||
loop: {{ $loop }}
|
||||
}).go();
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
{{- $label := .Get "id" | default "Blowfish" -}}
|
||||
{{- $params := .Get "params" -}}
|
||||
|
||||
|
||||
<lite-youtube videoid="{{ $id }}" playlabel="{{ $label }}" params="{{ $params }}"></lite-youtube>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue