How do I avoid hard coding the links in a custom made navigation bar?
You should create a menu for this (drupal menus works with system paths, no need to "hardcode" the links) and display this menu in a block where you want.