Skip to content

Commit 2ec915a

Browse files
committed
rename back the function
1 parent bbcdf95 commit 2ec915a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

each.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func (app *App) MapPage(ctx context.Context, f func(Page) error) []error {
6565
return errs
6666
}
6767

68-
// MapPageGeneric maps over all pages with generic return type
69-
func MapPageGeneric[T any](app *App, ctx context.Context, f func(Page) T) []T {
68+
// MapPage maps over all pages with generic return type
69+
func MapPage[T any](app *App, ctx context.Context, f func(Page) T) []T {
7070
if app.pages == nil {
7171
app.populatePagesCache(ctx)
7272
}

extensions/autolink_pages/autolink_pages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func UpdatePagesList(Page) (err error) {
4040
defer autolinkPage_lck.Unlock()
4141

4242
app := GetApp()
43-
ps := MapPageGeneric(app, context.Background(), func(p Page) *NormalizedPage {
43+
ps := MapPage(app, context.Background(), func(p Page) *NormalizedPage {
4444
return &NormalizedPage{
4545
page: p,
4646
normalizedName: path.Base(strings.ToLower(p.Name())),
@@ -70,7 +70,7 @@ func backlinksSection(p Page) template.HTML {
7070
}
7171

7272
app := GetApp()
73-
pages := MapPageGeneric(app, context.Background(), func(a Page) Page {
73+
pages := MapPage(app, context.Background(), func(a Page) Page {
7474
_, tree := a.AST()
7575
if a.Name() == p.Name() || !containLinkTo(tree, p) {
7676
return nil

extensions/date/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func dateHandler(r Request) Output {
2020
return xlog.BadRequest(err.Error())
2121
}
2222

23-
pages := MapPageGeneric(app, r.Context(), func(p Page) Page {
23+
pages := MapPage(app, r.Context(), func(p Page) Page {
2424
_, tree := p.AST()
2525
allDates := FindAllInAST[*DateNode](tree)
2626
for _, d := range allDates {

extensions/hashtags/hashtags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (h *Hashtags) tagPages(ctx context.Context, hashtag string) []Page {
135135
app := GetApp()
136136
uniqHandle := unique.Make(strings.ToLower(hashtag))
137137

138-
return MapPageGeneric(app, ctx, func(p Page) Page {
138+
return MapPage(app, ctx, func(p Page) Page {
139139
if p.Name() == Config.Index {
140140
return nil
141141
}
@@ -164,7 +164,7 @@ func (h *Hashtags) relatedPages(p Page) template.HTML {
164164
hashtags[v.unique] = true
165165
}
166166

167-
pages := MapPageGeneric(app, context.Background(), func(rp Page) Page {
167+
pages := MapPage(app, context.Background(), func(rp Page) Page {
168168
if rp.Name() == p.Name() {
169169
return nil
170170
}

extensions/search/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func search(ctx context.Context, keyword string) []*searchResult {
7171
reg := regexp.MustCompile(`(?imU)^(.*` + regexp.QuoteMeta(keyword) + `.*)$`)
7272

7373
app := GetApp()
74-
return MapPageGeneric(app, ctx, func(p Page) *searchResult {
74+
return MapPage(app, ctx, func(p Page) *searchResult {
7575
match := reg.FindString(p.Name())
7676
if len(match) > 0 {
7777
return &searchResult{

0 commit comments

Comments
 (0)