mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
chore: add warn message for GetRemote usage in shortcodes
This commit is contained in:
@@ -56,4 +56,6 @@
|
|||||||
data-repo-id="{{ $id }}"></script>
|
data-repo-id="{{ $id }}"></script>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{- else -}}
|
||||||
|
{{ warnf "codeberg shortcode: unable to fetch %q: %s" $codebergURL .Position }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if gt $startLine $endLine }}
|
{{ if gt $startLine $endLine }}
|
||||||
{{ errorf "Code Importer Shortcode - startLine is greater than endLine" . }}
|
{{ errorf "codeimporter shortcode: startLine is greater than endLine" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $selectedLines := first $endLine $lines }}
|
{{ $selectedLines := first $endLine $lines }}
|
||||||
@@ -23,5 +23,5 @@
|
|||||||
{{ $codeBlock := printf "```%s\n%s\n```" $type (delimit $selectedLines "\n") }}
|
{{ $codeBlock := printf "```%s\n%s\n```" $type (delimit $selectedLines "\n") }}
|
||||||
{{ $codeBlock | markdownify }}
|
{{ $codeBlock | markdownify }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ errorf "Code Importer Shortcode - Unable to get remote resource" . }}
|
{{ warnf "codeimporter shortcode: unable to fetch %q: %s" $url .Position }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
@@ -56,4 +56,6 @@
|
|||||||
data-repo-id="{{ $id }}"></script>
|
data-repo-id="{{ $id }}"></script>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{- else -}}
|
||||||
|
{{ warnf "forgejo shortcode: unable to fetch %q: %s" $forgejoURL .Position }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -56,4 +56,6 @@
|
|||||||
data-repo-id="{{ $id }}"></script>
|
data-repo-id="{{ $id }}"></script>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{- else -}}
|
||||||
|
{{ warnf "gitea shortcode: unable to fetch %q: %s" $giteaURL .Position }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -71,5 +71,7 @@
|
|||||||
data-repo-url="{{ $githubURL }}"
|
data-repo-url="{{ $githubURL }}"
|
||||||
data-repo-id="{{ $id }}"></script>
|
data-repo-id="{{ $id }}"></script>
|
||||||
</a>
|
</a>
|
||||||
|
{{- else -}}
|
||||||
|
{{ warnf "github shortcode: unable to fetch %q: %s" $githubURL .Position }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
{{ with resources.GetRemote (urls.Parse $url) }}
|
{{ with resources.GetRemote (urls.Parse $url) }}
|
||||||
{{ .Content | markdownify }}
|
{{ .Content | markdownify }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ errorf "Mardown Importer Shortcode - Unable to get remote resource" . }}
|
{{ warnf "mdimporter shortcode: unable to fetch %q: %s" $url .Position }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user