mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
refactor: enhance code/diagram copy button functionality and styling
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
|
||||
{{- if $config.copyable -}}
|
||||
{{- $copyIcon := dict "Class" "fa-regular fa-clone" | partial "plugin/icon.html" -}}
|
||||
{{- $successIcon := dict "Class" "fa-solid fa-check text-success" | partial "plugin/icon.html" -}}
|
||||
{{- $copyBtn := printf `<div class="code-copy-btn" aria-label="%s" role="button" title="%s">%s%s</div>` (T "assets.copyToClipboard") (T "assets.copyToClipboard") $copyIcon $successIcon -}}
|
||||
{{- $copyBtn := printf `<div class="code-copy-btn" aria-label="%s" role="button" title="%s">%s</div>` (T "assets.copyToClipboard") (T "assets.copyToClipboard") $copyIcon -}}
|
||||
{{- $wrapper = replaceRE `(<div class="code-wrapper">[\s\S]*?<\/div>)` (printf `$1%s` $copyBtn) $wrapper -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user