update the theme
This commit is contained in:
parent
008abb31c3
commit
3988dc59f8
50 changed files with 6947 additions and 6547 deletions
|
@ -1,6 +1,6 @@
|
|||
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
|
||||
{{ if .Get "default" }}
|
||||
{{ template "_internal/shortcodes/figure.html" . }}
|
||||
{{ partial "shortcodes/figure.html" . }}
|
||||
{{ else }}
|
||||
{{- $url := urls.Parse (.Get "src") }}
|
||||
{{- $altText := .Get "alt" }}
|
||||
|
@ -37,6 +37,7 @@
|
|||
{{ (.Resize "1024x").RelPermalink }} 1024w,
|
||||
{{ (.Resize "1320x").RelPermalink }} 2x"
|
||||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
data-zoom-src="{{ (.Resize "1320x").RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{- end }}
|
||||
|
|
|
@ -1,5 +1,31 @@
|
|||
{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" }}
|
||||
|
||||
<div id="{{ $id }}" class="gallery">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
{{ $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 }}
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
{{- $githubColors := .Site.Data.githubColors -}}
|
||||
{{- with $githubData -}}
|
||||
|
||||
<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">
|
||||
|
@ -64,4 +65,5 @@
|
|||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div class="mermaid" align="center">
|
||||
{{ .Inner }}
|
||||
<pre>{{ .Inner | safeHTML }}</pre>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
{{ $header := .Get "header" }}
|
||||
{{ $badge := .Get "badge" }}
|
||||
{{ $subheader := .Get "subheader" }}
|
||||
{{ $text := .Get "text" }}
|
||||
<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">
|
||||
|
@ -17,7 +16,7 @@
|
|||
{{ end }}
|
||||
{{ if $badge }}
|
||||
<h3 class="">
|
||||
{{ partial "badge" $badge}}
|
||||
{{ partial "badge" $badge}}
|
||||
</h3>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue