the repository which powers this website
bendn 6 weeks ago
parent 93b2637 · commit 93e4974
-rw-r--r--.gitignore1
-rw-r--r--themed/base.html23
-rw-r--r--themed/commit.html4
-rw-r--r--themed/index.html18
-rw-r--r--themed/log.html4
-rw-r--r--themed/refs.html6
-rw-r--r--themed/summary.html12
-rw-r--r--themed/themed.in.css4
-rw-r--r--themed/tree.html2
9 files changed, 48 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index afa3b182..4f9eb8be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@ cgitrc.5.xml
node_modules
package.json
package-lock.json
+.cache/
diff --git a/themed/base.html b/themed/base.html
index a1e270d5..06569739 100644
--- a/themed/base.html
+++ b/themed/base.html
@@ -18,8 +18,8 @@
{% endblock %}
{% block repo_header %}
<header class="bg-[#262F3F] border-b border-[#333A45]">{# Repo header #}
- <div class="max-w-7xl mx-auto py-4 flex gap-x-1 items-center">
- <img width="40px" height="40px" src="/favicon.ico"></img>
+ <div class="max-w-7xl mx-auto py-4 flex gap-x-1 items-center pl-2">
+ <a href="{{ cgit_rooturl()|attr }}"><img width="40px" height="40px" src="/favicon.ico"></img></a>
<div class="text-4xl"><a href="{{ cgit_rooturl()|attr }}" class="hover:text-[#73D0FF] hover:underline">{{ ctx.cfg.root_title }}</a> / <a href="{! cgit_shared_repolink_url(NULL, NULL, NULL); !}" class="font-semibold hover:text-[#73D0FF] hover:underline">{{ ctx.repo->name }}</a></div>
</div>
</header>
@@ -49,12 +49,12 @@
<nav class="flex text-sm mb-4">
{# Repo navigation panel #}
{! repo_summary_bar_current_branch(); !}
- <a href="{! cgit_shared_repolink_url("log", ctx.qry.head, NULL); !}" class="flex gap-x-1 py-1.5 px-3 ml-3 rounded-md hover:bg-[#333A45]">
+ <!-- <a href="{! cgit_shared_repolink_url("log", ctx.qry.head, NULL); !}" class="flex gap-x-1 py-1.5 px-3 ml-3 rounded-md hover:bg-[#333A45]">
{# Heroicons micro clock #}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 self-center text-[#a3a29c]"><path fill-rule="evenodd" d="M1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8Zm7.75-4.25a.75.75 0 0 0-1.5 0V8c0 .414.336.75.75.75h3.25a.75.75 0 0 0 0-1.5h-2.5v-3.5Z" clip-rule="evenodd" /></svg>
{! int num_commits = get_num_commits(); !}
<span class="font-semibold">{{ num_commits|%d }}</span><span class="font-semibold text-[#a3a29c]">Commit{% if num_commits != 1 %}s{% endif %}</span>
- </a>
+ </a> -->
<a href="{! cgit_shared_repolink_url("refs", ctx.qry.head, "heads"); !}" class="flex gap-x-1 py-1.5 px-3 rounded-md hover:bg-[#333A45]">
{# Heroicons micro list-bullet #}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 self-center text-[#a3a29c]"><path d="M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" /></svg>
@@ -112,15 +112,24 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 text-[#a3a29c]"><path fill-rule="evenodd" d="M10.986 3H12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h1.014A2.25 2.25 0 0 1 7.25 1h1.5a2.25 2.25 0 0 1 2.236 2ZM9.5 4v-.75a.75.75 0 0 0-.75-.75h-1.5a.75.75 0 0 0-.75.75V4h3Z" clip-rule="evenodd" /></svg>
</button>
</div>
+ <div class="flex outline-1 outline-[#333A45] rounded-lg mb-2 has-[input:focus-within]:outline-2 has-[input:focus-within]:outline-[#73D0FF]">
+ {# Clone URL box #}
+ <span class="whitespace-pre py-1.5 px-2 text-sm text-[#a3a29c] bg-[#262F3F] border-r border-[#333A45]">SSH </span>
+ <input type="text" value="[email protected]/{! html_attr(ctx.repo->url); !}" class="ssh-repo-clone-url flex-1 py-1.5 pl-2 text-sm focus:outline-none bg-[#1F2430] text-[#CCCAC2]" onfocus="this.select();" readonly>
+ <button class="py-1.5 px-2 cursor-pointer" onclick="document.querySelector('.ssh-repo-clone-url').select();document.execCommand('copy');">
+ {# Heroicons micro clipboard #}
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 text-[#a3a29c]"><path fill-rule="evenodd" d="M10.986 3H12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h1.014A2.25 2.25 0 0 1 7.25 1h1.5a2.25 2.25 0 0 1 2.236 2ZM9.5 4v-.75a.75.75 0 0 0-.75-.75h-1.5a.75.75 0 0 0-.75.75V4h3Z" clip-rule="evenodd" /></svg>
+ </button>
+ </div>
<a href="vscode://vscode.git/clone?url={! cgit_add_clone_urls(html_url_arg); !}" class="flex items-center gap-x-1 hover:text-[#73D0FF] hover:underline mb-2">
{# Heroicons micro arrow-top-right-on-square #}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4"><path d="M6.22 8.72a.75.75 0 0 0 1.06 1.06l5.22-5.22v1.69a.75.75 0 0 0 1.5 0v-3.5a.75.75 0 0 0-.75-.75h-3.5a.75.75 0 0 0 0 1.5h1.69L6.22 8.72Z" /><path d="M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 0 0 7 4H4.75A2.75 2.75 0 0 0 2 6.75v4.5A2.75 2.75 0 0 0 4.75 14h4.5A2.75 2.75 0 0 0 12 11.25V9a.75.75 0 0 0-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5Z" /></svg>
Open with VS Code
</a>
- <a href="vscodium://vscode.git/clone?url={! cgit_add_clone_urls(html_url_arg); !}" class="flex items-center gap-x-1 hover:text-[#73D0FF] hover:underline mb-2">
+ <!-- <a href="vscodium://vscode.git/clone?url={! cgit_add_clone_urls(html_url_arg); !}" class="flex items-center gap-x-1 hover:text-[#73D0FF] hover:underline mb-2">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4"><path d="M6.22 8.72a.75.75 0 0 0 1.06 1.06l5.22-5.22v1.69a.75.75 0 0 0 1.5 0v-3.5a.75.75 0 0 0-.75-.75h-3.5a.75.75 0 0 0 0 1.5h1.69L6.22 8.72Z" /><path d="M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 0 0 7 4H4.75A2.75 2.75 0 0 0 2 6.75v4.5A2.75 2.75 0 0 0 4.75 14h4.5A2.75 2.75 0 0 0 12 11.25V9a.75.75 0 0 0-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5Z" /></svg>
Open with VSCodium
- </a>
+ </a> -->
</div>
</div>
</nav>
@@ -133,7 +142,7 @@
{# cgit footer #}
generated by
<a href="https://git.zx2c4.com/cgit/about/" class="hover:text-[#73D0FF] hover:underline">cgit</a>
- <a href="https://git-scm.com/" class="hover:text-[#73D0FF] hover:underline">git {{ git_version_string }}</a>)
+ (<a href="https://git-scm.com/" class="hover:text-[#73D0FF] hover:underline">git {{ git_version_string }}</a>)
at
{{ show_date(time(NULL), 0, cgit_date_mode(DATE_ISO8601)) }}
</div>
diff --git a/themed/commit.html b/themed/commit.html
index d5f95c77..9c535b10 100644
--- a/themed/commit.html
+++ b/themed/commit.html
@@ -19,7 +19,7 @@
!}
{! page_start(); !}
{! repo_header(); !}
- <main class="max-w-[1280px] mx-auto py-4">{# Main content #}
+ <main class="max-w-7xl mx-auto py-4 pl-2 pr-2">{# Main content #}
{! repo_description_panel(); !}
{! repo_summary_bar(); !}
<div class="grid grid-cols-1 border border-[#333A45] rounded-md divide-y divide-[#333A45] mb-4">
@@ -37,7 +37,7 @@
</div>
</div>
<div class="px-3 py-2 rounded-b-md bg-[#262F3F] flex gap-x-1 items-center">
- <img src="{! gravatar_url(info->author_email); !}?s=24">
+ <img class="gravatar" src="{! gravatar_url(info->author_email); !}?s=24">
<span class="font-semibold text-sm">{{ info->author }}</span>
<span class="text-[#a3a29c] text-sm">{! cgit_print_age_themed(info->committer_date, info->committer_tz, TM_MONTH * 12); !}</span>
<div class="flex-1"></div>
diff --git a/themed/index.html b/themed/index.html
index 88fb6abc..997d367b 100644
--- a/themed/index.html
+++ b/themed/index.html
@@ -5,12 +5,14 @@
{! page_start(); !}
<header class="bg-[#262F3F] border-b border-[#333A45]">
{# Repo header #}
- <div class="max-w-7xl mx-auto py-4 flex gap-x-1 items-center">
- <img width="40px" height="40px" src="/favicon.ico"></img>
- <a href="{{ cgit_rooturl()|attr }}" class="text-4xl text-[#CCCAC2] hover:text-[#73D0FF] hover:underline">{{ ctx.cfg.root_title }}</a>
+ <div class="pl-2 max-w-7xl mx-auto py-4 flex gap-x-1 items-center">
+ <a href="{{ cgit_rooturl()|attr }}"><img width="40px" height="40px" src="/favicon.ico"></img></a>
+ <a href="{{ cgit_rooturl()|attr }}" class="text-4xl text-[#CCCAC2] hover:text-[#73D0FF] hover:underline">
+ {{ ctx.cfg.root_title }}
+ </a>
</div>
</header>
- <main class="max-w-7xl mx-auto py-4">
+ <main class="max-w-7xl mx-auto py-4 pl-2 pr-2">
{# Main content #}
<form method="GET" action="{{ cgit_rooturl()|attr }}" class="flex text-sm mb-4 outline-1 outline-[#333A45] rounded-lg has-[input:focus-within]:outline-2 has-[input:focus-within]:outline-[#73D0FF]">
{# Search box #}
@@ -28,13 +30,13 @@
{! if (!cgit_repolist_is_visible(ctx.repo)) { continue; } !}
<div{% if i > 0 %} class="border-t border-[#333A45] pt-2 mt-2"{% endif %}>
{# Heroicons outline cube #}
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 text-[#a3a29c]"><path stroke-linecap="round" stroke-linejoin="round" d="m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" /></svg>
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 text-[#a3a29c]"><path stroke-linecap="round" stroke-linejoin="round" d="m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" /></svg> -->
</div>
- <div class="{% if i > 0 %}border-t border-[#333A45] pt-2 mt-2 {% endif %}pl-2">
+ <div class="{% if i > 0 %}border-t border-[#333A45] pt-2 mt-2 {% endif %}">
{! char *repourl = cgit_repourl(ctx.repo->url); !}
- <div><a href="{{ repourl|attr }}" class="font-semibold text-[#73D0FF] hover:text-[#4CB3FF] hover:underline">{{ ctx.repo->name }}</a></div>
+ <div><a href="{{ repourl|attr }}" class="text-lg font-bold text-[#73D0FF] hover:text-[#4CB3FF] hover:underline">{{ ctx.repo->name }}</a></div>
{! free(repourl); !}
- <div class="text-sm text-[#a3a29c]">{{ ctx.repo->desc }}</div>
+ <div class="text-sm text-[#CCCAC2]">{{ ctx.repo->desc }}</div>
<div class="text-sm text-[#a3a29c]">Updated {! cgit_repolist_print_modtime_themed(ctx.repo); !}</div>
</div>
{% endfor %}
diff --git a/themed/log.html b/themed/log.html
index ff8370a2..8446150d 100644
--- a/themed/log.html
+++ b/themed/log.html
@@ -1,7 +1,7 @@
{% page cgit_print_log %}
{! page_start(); !}
{! repo_header(); !}
- <main class="max-w-7xl mx-auto py-4">{# Main content #}
+ <main class="max-w-7xl mx-auto py-4 pl-2 pr-2">{# Main content #}
{! repo_description_panel(); !}
{! repo_summary_bar(); !}
{!
@@ -31,7 +31,7 @@
<div class="px-3 py-2 border-t border-[#333A45]">
<div><a href="{! cgit_shared_reporevlink_url("commit", ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); !}" class="hover:text-[#73D0FF] hover:underline">{{ info->subject }}</a></div>
<div class="mt-2 text-sm text-[#a3a29c] flex gap-x-1 items-center">
- <img src="{! gravatar_url(info->author_email); !}?s=16">
+ <img class="gravatar" src="{! gravatar_url(info->author_email); !}?s=16">
{{ info->author }} committed {! cgit_print_age_themed(info->committer_date, info->committer_tz, TM_MONTH * 12); !}
</div>
</div>
diff --git a/themed/refs.html b/themed/refs.html
index 9267d1bc..c5e1b68d 100644
--- a/themed/refs.html
+++ b/themed/refs.html
@@ -36,7 +36,7 @@
{% if ref->object->type == OBJ_COMMIT %}
<div class="text-sm text-[#a3a29c] flex gap-x-1">
{{ info->subject }} &middot; Updated {! cgit_print_age_themed(info->committer_date, info->committer_tz, TM_MONTH * 12); !}
- <img src="{! gravatar_url(info->author_email); !}?s=24" class="mt-[-0.2rem]">
+ <img class="gravatar" src="{! gravatar_url(info->author_email); !}?s=24" class="mt-[-0.2rem]">
{{ info->author }}
</div>
{% endif %}
@@ -89,14 +89,14 @@
Updated {! cgit_print_age_themed(info->tagger_date, info->tagger_tz, TM_MONTH * 12); !}
{% endif %}
{% if info->tagger %}
- <img src="{! gravatar_url(info->tagger_email); !}?s=24" class="mt-[-0.2rem]">
+ <img class="gravatar" src="{! gravatar_url(info->tagger_email); !}?s=24" class="mt-[-0.2rem]">
{{ info->tagger }}
{% endif %}
</div>
{% elif ref->object->type == OBJ_COMMIT %}
<div class="text-sm text-[#a3a29c] flex gap-x-1">
Updated {! cgit_print_age_themed(ref->commit->commit->date, 0, TM_MONTH * 12); !}
- <img src="{! gravatar_url(ref->commit->author_email); !}?s=24" class="mt-[-0.2rem]">
+ <img class="gravatar" src="{! gravatar_url(ref->commit->author_email); !}?s=24" class="mt-[-0.2rem]">
{{ ref->commit->author }}
</div>
{% endif %}
diff --git a/themed/summary.html b/themed/summary.html
index 26342d53..a18983a6 100644
--- a/themed/summary.html
+++ b/themed/summary.html
@@ -10,7 +10,7 @@
{% block cgit_print_summary_impl %}
{! page_start(); !}
{! repo_header(); !}
- <main class="max-w-7xl mx-auto py-4">{# Main content #}
+ <main class="max-w-7xl mx-auto py-4 pl-2 pr-2">{# Main content #}
{! repo_description_panel(); !}
{! repo_summary_bar(); !}
<div class="grid grid-cols-[auto_1fr_auto_auto] border border-[#333A45] rounded-md mb-4">
@@ -29,8 +29,8 @@
}
struct commitinfo *info = cgit_parse_commit(commit);
!}
- <div class="col-span-4 rounded-t-md bg-[#262F3F] px-3 py-2 flex gap-x-1">
- <img src="{! gravatar_url(info->author_email); !}?s=24">
+ <div class="col-span-4 rounded-t-md bg-[#262F3F] px-3 py-2 flex gap-x-1 items-center">
+ <img class="gravatar" src="{! gravatar_url(info->author_email); !}?s=32">
<span class="font-semibold">{{ info->author }}</span>
<a href="{! cgit_shared_reporevlink_url("commit", ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); !}" class="ml-2 text-[#a3a29c] hover:text-[#73D0FF] hover:underline">{{ info->subject }}</a>
<div class="flex-1"></div>
@@ -41,6 +41,12 @@
&middot;
{! cgit_print_age_themed(info->committer_date, info->committer_tz, TM_MONTH * 12); !}
</span>
+ <a href="{! cgit_shared_repolink_url("log", ctx.qry.head, NULL); !}" class="flex gap-x-1 py-1.5 px-3 ml-3 rounded-md hover:bg-[#333A45]">
+ {# Heroicons micro clock #}
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4 self-center text-[#a3a29c]"><path fill-rule="evenodd" d="M1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8Zm7.75-4.25a.75.75 0 0 0-1.5 0V8c0 .414.336.75.75.75h3.25a.75.75 0 0 0 0-1.5h-2.5v-3.5Z" clip-rule="evenodd" /></svg>
+ {! int num_commits = get_num_commits(); !}
+ <span class="font-semibold">{{ num_commits|%d }}</span><span class="font-semibold text-[#a3a29c]">Commit{% if num_commits != 1 %}s{% endif %}</span>
+ </a>
</div>
{! cgit_free_commitinfo(info); !}
{# Files #}
diff --git a/themed/themed.in.css b/themed/themed.in.css
index 646ad259..d274ef08 100644
--- a/themed/themed.in.css
+++ b/themed/themed.in.css
@@ -166,3 +166,7 @@
color: #F27983;
}
}
+
+.gravatar {
+ border-radius: 50%;
+} \ No newline at end of file
diff --git a/themed/tree.html b/themed/tree.html
index eaa2b4a4..516afc17 100644
--- a/themed/tree.html
+++ b/themed/tree.html
@@ -135,7 +135,7 @@
!}
{! page_start(); !}
{! repo_header(); !}
- <main class="max-w-7xl mx-auto py-4">{# Main content #}
+ <main class="max-w-7xl mx-auto py-4 pl-2 pr-2">{# Main content #}
{! repo_description_panel(); !}
{!
char *hex = ctx.qry.oid;