Skip to content

Commit c404320

Browse files
committed
Added some routes to make some wordpress routes work here
1 parent 17a7a3a commit c404320

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

goblog.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,25 @@ func main() {
151151
router.GET("/", _blog.Home)
152152
router.GET("/index.php", _blog.Home)
153153
router.GET("/posts/:yyyy/:mm/:dd/:slug", _blog.Post)
154+
// lets posts work with our without the word posts in front
155+
router.GET("/:yyyy/:mm/:dd/:slug", _blog.Post)
154156
router.GET("/admin/posts/:yyyy/:mm/:dd/:slug", _admin.Post)
155157
router.GET("/tag/:name", _blog.Tag)
156158
router.GET("/login", _blog.Login)
157159
router.GET("/logout", _blog.Logout)
158160

159161
//todo: register a template mapping to a "page type"
160162
router.GET("/posts", _blog.Posts)
163+
router.GET("/blog", _blog.Posts)
161164
router.GET("/tags", _blog.Tags)
162165
router.GET("/presentations", _blog.Speaking)
163166
router.GET("/research", _blog.Research)
164167
router.GET("/projects", _blog.Projects)
165168
router.GET("/about", _blog.About)
166169
router.GET("/sitemap.xml", _blog.Sitemap)
167170
router.GET("/archives", _blog.Archives)
171+
// lets old WordPress stuff stored at wp-content/uploads work
172+
router.Use(static.Serve("/wp-content", static.LocalFile("www", false)))
168173

169174
router.GET("/admin", _admin.Admin)
170175

0 commit comments

Comments
 (0)