mirror of
https://gitee.com/butubb8/blowfish.git
synced 2025-12-05 14:17:50 +08:00
Merge pull request #2331 from ZhenShuo2021/chore/error-msg
🔧 Chore: add warn message for GetRemote usage in shortcodes
This commit is contained in:
@@ -56,4 +56,6 @@
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
{{- else -}}
|
||||
{{ warnf "codeberg shortcode: unable to fetch %q: %s" $codebergURL .Position }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if gt $startLine $endLine }}
|
||||
{{ errorf "Code Importer Shortcode - startLine is greater than endLine" . }}
|
||||
{{ errorf "codeimporter shortcode: startLine is greater than endLine" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ $selectedLines := first $endLine $lines }}
|
||||
@@ -23,5 +23,5 @@
|
||||
{{ $codeBlock := printf "```%s\n%s\n```" $type (delimit $selectedLines "\n") }}
|
||||
{{ $codeBlock | markdownify }}
|
||||
{{ else }}
|
||||
{{ errorf "Code Importer Shortcode - Unable to get remote resource" . }}
|
||||
{{ warnf "codeimporter shortcode: unable to fetch %q: %s" $url .Position }}
|
||||
{{ end }}
|
||||
|
||||
@@ -56,4 +56,6 @@
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
{{- else -}}
|
||||
{{ warnf "forgejo shortcode: unable to fetch %q: %s" $forgejoURL .Position }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -56,4 +56,6 @@
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
</div>
|
||||
{{- else -}}
|
||||
{{ warnf "gitea shortcode: unable to fetch %q: %s" $giteaURL .Position }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
|
||||
{{- $showThumbnail := .Get "showThumbnail" | default true -}}
|
||||
|
||||
|
||||
<div class="github-card-wrapper">
|
||||
{{- with $githubData -}}
|
||||
{{- 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 p-0 m-0 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
@@ -71,5 +70,7 @@
|
||||
data-repo-url="{{ $githubURL }}"
|
||||
data-repo-id="{{ $id }}"></script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- else -}}
|
||||
{{ warnf "github shortcode: unable to fetch %q: %s" $githubURL .Position }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
{{ with resources.GetRemote (urls.Parse $url) }}
|
||||
{{ .Content | markdownify }}
|
||||
{{ else }}
|
||||
{{ errorf "Mardown Importer Shortcode - Unable to get remote resource" . }}
|
||||
{{ warnf "mdimporter shortcode: unable to fetch %q: %s" $url .Position }}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user