In summary, we have demonstrated that, by using polycondensation reaction, it is possible to systematically change the molecular composition of covalent triazine-based frameworks. The sequence of the molecular building blocks, and thus the level of doping of the pristine CTF with electron-rich bipyridine moieties (n-doping), correlate directly with the material features such as specific surface area, bandgap and surface wettability with water, which are crucial for the photocatalytic activity of the CTFs in hydrogen evolution reaction. In the series, we showed that doping CTFs with bipyridine moieties results in an increase in the solvent-solid interactions and in more efficient charge separation, beneficial for HER reaction. In contrast, it results also in reduced bandgap and surface, potentially detrimental to the HER reaction. Altogether, those properties drastically influence the photocatalytic activity thus leading to a sweet spot in HER activity with 66% of bipyridine building units in the framework. This local maximum was both anticipated based on physico-chemical properties of the material and experimentally observed.