From Kondo effect to weak-link regime in quantum spin-1/2 spin chains