func findPage(site *Site, f string) *Page { currentPath := source.NewFile(filepath.FromSlash(f)) //t.Logf("looking for currentPath: %s", currentPath.Path()) for _, page := range site.Pages { //t.Logf("page: %s", page.Source.Path()) if page.Source.Path() == currentPath.Path() { return page } } return nil }
func findPage(site *Site, f string) *Page { // TODO: it seems that filepath.FromSlash results in page.Source.Path() returning windows backslash - which means refLinking's string compare is totally busted. // TODO: Not used for non-fragment linking (SVEN thinks this is a bug) currentPath := source.NewFile(filepath.FromSlash(f)) //t.Logf("looking for currentPath: %s", currentPath.Path()) for _, page := range site.Pages { //t.Logf("page: %s", page.Source.Path()) if page.Source.Path() == currentPath.Path() { return page } } return nil }