sync theme
This commit is contained in:
parent
8db6bd0e55
commit
8f3d03b188
53 changed files with 1747 additions and 213 deletions
|
@ -2,6 +2,7 @@
|
|||
class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
{{ with .Get "href" }}href="{{ . }}"{{ end }}
|
||||
{{ with .Get "target" }}target="{{ . }}"{{ end }}
|
||||
{{ with .Get "rel" }}rel="{{ . }}"{{ end }}
|
||||
role="button"
|
||||
>
|
||||
{{ .Inner }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}}
|
||||
{{- $codebergData := getJSON ($codebergURL) -}}
|
||||
{{- $codebergData := resources.GetRemote $codebergURL | transform.Unmarshal -}}
|
||||
{{- $codebergColors := .Site.Data.codebergColors -}}
|
||||
{{- with $codebergData -}}
|
||||
|
||||
|
@ -34,14 +34,14 @@
|
|||
<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">
|
||||
<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" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
.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.starts_count;
|
||||
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
|
||||
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
|
|
67
themes/blowfish/layouts/shortcodes/forgejo.html
Normal file
67
themes/blowfish/layouts/shortcodes/forgejo.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{{ $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
|
||||
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">
|
||||
|
||||
<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>
|
||||
|
||||
</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 -}}
|
67
themes/blowfish/layouts/shortcodes/gitea.html
Normal file
67
themes/blowfish/layouts/shortcodes/gitea.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{{ $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
|
||||
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">
|
||||
|
||||
<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>
|
||||
|
||||
</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,6 +1,6 @@
|
|||
{{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
|
||||
{{- $githubData := getJSON ($githubURL) -}}
|
||||
{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}}
|
||||
{{- $githubColors := .Site.Data.githubColors -}}
|
||||
{{- with $githubData -}}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ $id := delimit (slice "gitlab" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $gitlabURL := print (default "https://gitlab.com/" (.Get "baseURL")) "api/v4/projects/" (.Get "projectID") -}}
|
||||
|
||||
{{- $gitLabData := getJSON ($gitlabURL) -}}
|
||||
{{- $gitLabData := resources.GetRemote $gitlabURL | transform.Unmarshal -}}
|
||||
{{- with $gitLabData -}}
|
||||
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .web_url }}" class="cursor-pointer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue