Skip to content

Commit d6b3de5

Browse files
committed
updated to use the code field instead
1 parent 84eb783 commit d6b3de5

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

content/code/2024-online-adaptive-cbf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
layout: code
33
title: "Online Adaptive CBFs"
44
date: 2024-10-22
5-
github: tkkim-robot/online_adaptive_cbf
5+
code: https://github.com/tkkim-robot/online_adaptive_cbf
66
---

layouts/code/list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ <h1>{{ .Title }}</h1>
77
{{ range .Pages }}
88

99
<div>
10-
<a href={{ .RelPermalink }}>
11-
{{ partial "github-repo-card" . }}
10+
<a href={{ .RelPermalink }}>
11+
{{ partial "github-repo-card" . }}
1212
</a>
1313
</div>
1414

layouts/partials/github-repo-card.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<div>
22

3+
{{/* Expects ".Params.code" to be of the format "https://github.com/username/repo" */}}
4+
{{/* Uses https://github.com/anuraghazra/github-readme-stats to render the card */}}
5+
36
{{/* split the string to get the username and repo string */}}
4-
{{ $github_split := split .Params.github "/" }}
5-
{{ $username := index $github_split 0 }}
6-
{{ $repo := index $github_split 1 }}
7+
{{ $github_split := split .Params.code "/" }}
8+
{{ $username := index $github_split 3 }}
9+
{{ $repo := index $github_split 4 }}
710

811
<div class="repo">
9-
<a href="https://github.com/{{ .Params.github }}" target="_blank">
10-
<img
12+
<a href={{ .Params.code }} target="_blank">
13+
<img
1114
src="https://github-readme-stats.vercel.app/api/pin/?username={{ $username }}&repo={{ $repo }}&show_owner=true&description_lines_count=3"
1215
>
1316
</a>
1417
</div>
1518

1619
</div>
17-

0 commit comments

Comments
 (0)