+{% block subheader -%}{% include "subheader.html" -%}{% endblock subheader -%}
+
+
+{% if repo_url -%}
+| summary | +history | +branches | +tags | +files | ++ |
{% block content %}{% endblock content %}
+
+
+diff --git a/templates/base.html b/templates/base.html index 882f694..f729531 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,16 +1,60 @@
+{% set head_title = site_name | default(value="Itsy-Gitsy") -%} +{% set head_description = metadata.description | default(value=site_description | default(value="Static Git repository listings")) -%} +{% set root_url = site_url | default(value=site_dir) -%} +{% if name -%} +{% set repo_url = root_url ~ "/" ~ name -%} +{% set head_title = head_title ~ " -- " ~ name -%} +{% endif -%} +{% set asset_url = root_url ~ "/" ~ site_assets -%} +{% set head_url = repo_url | default(value=root_url) -%} + {% block html_head -%} -| summary | +history | +branches | +tags | +files | ++ |
{{branch.message}}
+| branch: | {{branch.ref_name}} |
| commit: | {% if branch.full_hash in commits -%}{{branch.full_hash}}{% else -%}{{branch.full_hash}}{% endif -%} |
| author: | {{branch.author.name}} <{{branch.author.email}}> |
| committer: | {{branch.committer.name}} <{{branch.committer.email}}> |
| date: | {{ts_to_git_timestamp(ts=branch.ts_utc, tz=branch.ts_offset)}} |
| Branch | -Commit ID | -Message | +Commit | +Message | Author | Date |
|---|---|---|---|---|---|---|
| {{entry.ref_name}} | {{entry.short_hash}} | -{{entry.summary}} | -{{entry.author.name}} | +{{entry.summary}} | +{{entry.author.name}} | {{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} |
{{commit.message}}
+| commit: | {{commit.full_hash}} |
| author: | {{commit.author.name}} <{{commit.author.email}}> |
| committer: | {{commit.committer.name}} <{{commit.committer.email}}> |
| date: | {{ts_to_git_timestamp(ts=commit.ts_utc, tz=commit.ts_offset)}} |
| parents: | {% for parent in commit.parents -%}{% if loop.index0 > 0 -%}, {%endif-%}{% if parent in commits -%}{{parent}}{%else-%}{{parent}}{%endif-%}{%-endfor-%} |
diff --git a/{{file.basefile}} b/{{file.basefile}}
+line changes: +{{file.additions}}/-{{file.deletions}}
+index {{file.oldid | truncate(length=7,end="")}}..{{file.newid | truncate(length=7,end="")}}
+--- {{file.oldfile}}
++++ {{file.newfile}}
+ {{hunk.context}}
- {%- for line in hunk.lines -%}
- {%- if line.kind in ["del","add"] -%}{%- endif -%}
- {{line.prefix}}{{line.text}}
- {%- if line.kind in ["del","add"] -%}{%- endif -%}
- {%- endfor -%}
+{{hunk.context}}
+{%- for line in hunk.lines -%}
+{{line.prefix}}{{line.text}}
+{%- endfor -%}
{% endfor -%}
+
{% endfor -%}
+| File | -ID | Type | Mode | Size | ||||
|---|---|---|---|---|---|---|---|---|
| {{file.name}} | -{{file.id}} | -{{file.kind}} ({{file.is_binary}}) | -{{file.mode}} | -{{file.size}} | +{{file.name}}{% if file.kind == "dir" -%}/{% endif -%} | +{{file.kind}} | +{{file.mode | mask(mask="0xfff") | oct}} | +{{file.size}} |
{{file.contents | safe }}
@@ -17,4 +22,5 @@
{%- else -%}
{{file.contents}}
{%- endif -%}
+| File | +Type | +Mode | +Size | +
|---|---|---|---|
| {{file.name}}{% if file.kind == "dir" -%}/{% endif -%} | +{{file.kind}} | +{{file.mode | mask(mask="0xfff") | oct}} | +{{file.size}} | +
| Commit ID | +Commit | Message | Author | Date | -Diff | -Refs | +Diff | +Refs |
|---|---|---|---|---|---|---|---|---|
| {{entry.short_hash}} | -{{entry.summary}} | -{{entry.author.name}} | -{{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} | -{{entry.stats.files}} (+{{entry.stats.additions}}/-{{entry.stats.deletions}}) | -{%- for ref in entry.alt_refs -%}{%- if loop.index0 > 0 -%}, {%- endif -%}{{ref}}{%- endfor -%} | -|||
| {{entry.short_hash}} | +{{entry.summary}} | +{{entry.author.name}} | +{{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} | +{{entry.stats.files}} (+{{entry.stats.additions}}/-{{entry.stats.deletions}}) | +{%- for ref in entry.alt_refs -%}{%- if loop.index0 < 3 -%}{{ref}}{%- endif -%}{%- endfor -%}{% if entry.alt_refs | length > 3 -%}...{% endif -%} | +
| Repository | +Description | +Website | +Last Updated | +
|---|---|---|---|
| {{ repo.name }} | +{{repo.metadata.description}} | +{% if repo.metadata.website -%}link{% endif -%} | +{{ts_to_date(ts=repo.history[0].ts_utc, tz=repo.history[0].ts_offset)}} | +
| Commit ID | +Commit | Message | Author | Date | -Diff | -Refs | +Diff | +Refs |
|---|---|---|---|---|---|---|---|---|
| {{entry.short_hash}} | -{{entry.summary}} | -{{entry.author.name}} | -{{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} | -{{entry.stats.files}} (+{{entry.stats.additions}}/-{{entry.stats.deletions}}) | -{%- for ref in entry.alt_refs -%}{%- if loop.index0 > 0 -%}, {%- endif -%}{{ref}}{%- endfor -%} | -|||
| {{entry.short_hash}} | +{{entry.summary}} | +{{entry.author.name}} | +{{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} | +{{entry.stats.files}} (+{{entry.stats.additions}}/-{{entry.stats.deletions}}) | +{%- for ref in entry.alt_refs -%}{%- if loop.index0 < 3 -%}{{ref}}{%- endif -%}{%- endfor -%}{% if entry.alt_refs | length > 3 -%}...{% endif -%} | +
| Branch | -Commit ID | -Message | +Commit | +Message | Author | Date |
|---|---|---|---|---|---|---|
| {{entry.ref_name}} | {{entry.short_hash}} | -{{entry.summary}} | -{{entry.author.name}} | +{{entry.summary}} | +{{entry.author.name}} | {{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} |
| Tag | -Commit ID | -Message | +Commit | +Message | Author | Date |
|---|---|---|---|---|---|---|
| {{entry.ref_name}} | {{entry.short_hash}} | -{{entry.summary}} | -{{entry.author.name}} | +{{entry.summary}} | +{{entry.author.name}} | {{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} |
| File | -ID | -Type | -Mode | -Size | +Type | +Mode | +Size | |
|---|---|---|---|---|---|---|---|---|
| {{file.name}} | -{{file.id}} | -{{file.kind}} ({{file.is_binary}}) | -{{file.mode}} | -{{file.size}} | +{{file.name}}{% if file.kind == "dir" -%}/{% endif -%} | +{{file.kind}} | +{{file.mode | mask(mask="0xfff") | oct}} | +{{file.size}} |
{{tag.message}}
-{{commit.message}}
-{%-else-%}{{tag.tagged_id}}{%-endif-%}| tag: | {{tag.ref_name}} |
| hash: | {{tag.full_hash}} |
| tagged commit: | {% if tag.tagged_id -%}{% if tag.tagged_id in commits -%}{{tag.tagged_id}}{% else -%}{{tag.tagged_id}}{% endif -%}{% endif -%} |
| author: | {{tag.author.name}} <{{tag.author.email}}> |
| date: | {{ts_to_git_timestamp(ts=tag.ts_utc, tz=tag.ts_offset)}} |
| Tag | -Commit ID | -Message | +Commit | +Message | Author | Date |
|---|---|---|---|---|---|---|
| {{entry.ref_name}} | {{entry.short_hash}} | -{{entry.summary}} | -{{entry.author.name}} | +{{entry.summary}} | +{{entry.author.name}} | {{ts_to_date(ts=entry.ts_utc, tz=entry.ts_offset)}} |