예제 #1
0
func newPaginationURLFactory(pathElements ...string) paginationURLFactory {
	pathSpec := helpers.CurrentPathSpec()

	return func(page int) string {
		var rel string
		if page == 1 {
			rel = fmt.Sprintf("/%s/", path.Join(pathElements...))
		} else {
			rel = fmt.Sprintf("/%s/%s/%d/", path.Join(pathElements...), pathSpec.PaginatePath(), page)
		}

		return pathSpec.URLizeAndPrep(rel)
	}
}
예제 #2
0
// KeyPrep... Taxonomies should be case insensitive. Can make it easily conditional later.
func kp(in string) string {
	return helpers.CurrentPathSpec().MakePathSanitized(in)
}