Developing efficient, stable and sustainable photocatalysts for water splitting is one of the most significant methods to generate hydrogen. Conjugated microporous polymers, as a new type of organic semiconductor photocatalyst, have adjustable bandgaps and high specific surface areas, and can be synthesized using diverse methods. In this work, we report the design and synthesis of a series of pyridyl conjugated microporous polymers (PCMPs) utilizing polycondensation of aromatic aldehydes and aromatic ketones in the presence of ammonium acetate. PCMPs with different chemical structures were synthesized via adjusting monomers with different geometry and content of nitrogen element, which adjusts the bandgap and photocatalytic performance. Photocatalytic hydrogen evolution rate (HER) up to 1198.9 μmol·h-1·g-1 was achieved on the optimized polymer with a specific surface area of 312 m2·g-1 under UV–vis light irradiation (λ＞320 nm). This metal-free synthetic method provides a new avenue to prepare an efficient photocatalyst for hydrogen evolution.