Skip to content

Commit ebc3676

Browse files
committed
add generator for readme
Signed-off-by: cuisongliu <cuisongliu@qq.com>
1 parent 3d73956 commit ebc3676

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Welcome to the Cluster Image Documentation repository! This repository contains
99
- [Rootfs Image](docs/docker/rootfs.md)
1010
- [Sealos Image](docs/docker/sealos.md)
1111
- [Laf Image](docs/docker/laf.md)
12-
- [App Image](docs/docker/app.md)
12+
- [App Image](docs/docker/apps.md)
1313

1414
### Aliyun HK Images
1515

1616
- [Rootfs Image](docs/aliyun-hk/rootfs.md)
1717
- [Sealos Image](docs/aliyun-hk/sealos.md)
1818
- [Laf Image](docs/aliyun-hk/laf.md)
19-
- [App Image](docs/aliyun-hk/app.md)
19+
- [App Image](docs/aliyun-hk/apps.md)
2020

2121
Please navigate to the above links to access the detailed documentation for each image category.
2222

generator/markdown/other.md.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Here are the versions of the images along with their corresponding links:
3131
{{range .Data}}{{ $data := . }}
3232
### {{ $data.Name }}
3333
34-
{{range .Tags}}- [{{ $repo }}/{{$data.Name }}:{{ . }}](https://explore.ggcr.dev/?image={{$registry}}/{{$repo}}/{{ $data.Name }}:{{ . }})
34+
{{range .Tags}}- [{{$registry}}/{{ $repo }}/{{$data.Name }}:{{ . }}](https://explore.ggcr.dev/?image={{$registry}}/{{$repo}}/{{ $data.Name }}:{{ . }})
3535
{{end}}
3636
{{end}}
3737
`

generator/types/sort.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,15 @@ func (vs ByLatest) Less(i, j int) bool {
4242
func Sort(list []string) {
4343
sort.Sort(ByLatest(list))
4444
}
45+
46+
type ByImageInfo []ImageInfo
47+
48+
func (vs ByImageInfo) Len() int { return len(vs) }
49+
func (vs ByImageInfo) Swap(i, j int) { vs[i], vs[j] = vs[j], vs[i] }
50+
func (vs ByImageInfo) Less(i, j int) bool {
51+
return vs[i].Name < vs[j].Name
52+
}
53+
54+
func SortByImageInfo(list []ImageInfo) {
55+
sort.Sort(ByImageInfo(list))
56+
}

0 commit comments

Comments
 (0)