The low specific surface area (SSA) and high charge recombination rate of g-C3N4 (hereafter referred to as CN) limit its applications for dye photodegradation. A photocatalyst that enhanced the SSA and retarded the charge recombination rate of g-C3N4 was developed in this study. In this study, a g-C3N4/ZnO S-scheme heterojunction photocatalyst was prepared via template method. Zeolitic-imidazolate-framework-8 (ZIF8) was used as a template of g-C3N4 and as a precursor of ZnO. This method addressed the two above-mentioned limitations of CN simultaneously. It was confirmed that when calcination temperature was controlled at 450 °C, g-C3N4/ZnO S-scheme heterojunction was successfully fabricated to enhance the specific surface area and charge separation rate of g-C3N4. CN/ZIF8-450 displayed optimal AR1 decolorization performance (95%), which was 1.6 times higher than that of CN (43%), when the reaction time was 1 h. The excellent performance of CN/ZIF8-450 was attributed to its high specific surface area (182.8 m2/g), 3.4 times higher than that of CN (53.6 m2/g), and low charge recombination rate due to the S-scheme heterojunction. The main reaction species in this system were ·O2- and h+. This study provided a simple approach to overcoming the limitations of CN in dye wastewater treatment.