1. Crane Jin
  2. mysite

Commits

Crane Jin  committed c021768

refacting...

  • Participants
  • Parent commits af6f41f
  • Branches default

Comments (0)

Files changed (1)

File mysite.go

View file
  • Ignore whitespace
 
 }
 
-func indexPage(ctx *web.Context, lang string) {
-	//pages.Execute(ctx, "index", nil)
-	var blogsBaseUrl string
-	if lang != "" {
-		blogsBaseUrl = "/" + lang + "blogs"
-	} else {
-		blogsBaseUrl = "/blogs"
-	}
-
-	ctx.Redirect(http.StatusFound, blogsBaseUrl)
-}
-
 type BlogListData struct {
 	Blogs        []blog.Blog
 	CurrentPage  int
 	web.Get(`/(en/)?admin/?$`, adminPage)
 	web.Get(`/(en/)?admin/(create|edit)-blog/?$`, blogForm)
 	web.Get(`/(en/)?admin/refreshtpl/?$`, refreshTpl)
-	web.Get(`/(en/)?$`, indexPage)
+	web.Get(`/(en/)?$`, getBlogs)
 	web.Get(`/words/(2[0-9][1-9][0-9])-([0-1][0-9])-([0-3][0-9])/?$`, getWordsByDate)
 	web.Get(`/words/?$`, getDatesForWords)