I got an answer from this site.
When page.path is not available, copy the following code into any rb file in plugin directory.
class PagePathGenerator < Generator
safe true
## See post.dir and post.base for directory information.
def generate(site)
site.posts.each do |post|
post.data['path'] = post.name
end
end
end
And I have the link correctly.