support for hash-permalink and #end for last page