This paper intends to create an immersive teaching content generation path based on knowledge mapping and knowledge ontology to promote a high degree of fit between party history education and the Civics and Political Science curriculum. In the visualization of knowledge points of party history events, concepts and inter-concept relationships and related attributes are defined based on the information resources of party history events to construct a knowledge ontology. Based on the different mapping between knowledge concepts to establish the knowledge semantic model, and import nodes and node relationships in the knowledge graph library to build the knowledge graph of party history events. In addition, an ontology model in the form of a network is used to store the knowledge, encode the knowledge semantic information into a domain knowledge ontology based on the hierarchical relationship of the course, formally represent the knowledge ontology of the course, and divide, extend and extract the course concepts by using the top-down method. The method of calculating the amount of knowledge assists in adjusting the structure of courseware, generating the content of courseware based on the knowledge points of chapters, and forming the automatic generation model of courseware based on the domain ontology. By integrating the formalized course knowledge ontology and automatic courseware generation, we build an immersive teaching content generation model suitable for integrating Party history and Civic and political thinking. In the teaching application based on the immersive teaching content generation model, the students’ experimental scores are concentrated in the interval of (60,95), which show statistically significant differences with the normative scores (P=0.000), indicating that the model can provide a solid tool support for the in-depth fusion of Party history and Civic and Political courses’ teaching content generation in colleges and universities.