Topological aspects of generalized gravitational entropy