Skip to content

Commit

Permalink
better update info display
Browse files Browse the repository at this point in the history
  • Loading branch information
kowyo committed Oct 26, 2024
1 parent a851535 commit 4b80878
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions layouts/shortcodes/update-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
{{- $author := .Get "author" -}}
{{- $message := .Get "message" -}}

<div class='hx-text-gray-700 hx-flex hx-justify-start hx-items-center hx-my-2 hx-text-sm dark:hx-text-gray-400 hx-transition-colors hx-border-gray-500 hx-text-gray-900 dark:hx-border-gray-200/30 dark:hx-text-gray-200 hx-rounded-md'>
<div class="hx-my-0 hx-whitespace-nowrap hx-text-ellipsis hx-overflow-hidde hover:hx-text-gray-900 dark:hover:hx-text-gray-100">最近更新时间 {{ $update_time | markdownify }}</div>
<div class="hx-mx-1">||</div>
<div class="hx-my-0 hx-whitespace-nowrap hx-text-ellipsis hx-overflow-hidde hover:hx-text-gray-900 dark:hover:hx-text-gray-100">更新者 {{ $author | markdownify }}</div>
<div class="hx-mx-1">||</div>
<div class="hx-my-0 hx-whitespace-nowrap hx-text-ellipsis hx-overflow-hidden hover:hx-text-gray-900 dark:hover:hx-text-gray-100">{{ $message | markdownify }}</div>
<div class="hx-mt-4 hx-text-gray-500 hx-text-sm hx-flex hx-items-center hx-flex-wrap hx-gap-y-2 hx-text-ellipsis">
<span>最近由 {{$author}} 于{{ $update_time }}更新:{{ $message | markdownify }}</span>
</div>
2 changes: 1 addition & 1 deletion scripts/gen_repo_update_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_latest_commit(owner, repo):

def save_latest_update(commit_info):
datetime_object = commit_info['date']
yymmdd = f'{datetime_object.year}.{datetime_object.month}.{datetime_object.day}'
yymmdd = f'{datetime_object.year}{datetime_object.month}{datetime_object.day}'
message_line = commit_info["message"].split('\n')
result_content = f"""{{{{< update-info update_time="{yymmdd}" author="{commit_info['author']}" message="{message_line[0]}" >}}}}\n"""
with open('result.txt', 'w') as file:
Expand Down

0 comments on commit 4b80878

Please sign in to comment.