A web page generation method, device and computer readable storage medium
By creating page template files with positioning tags and using the template engine to combine public components in the jQuery-tmpl format and the Freemarker template engine, the inconvenience of content maintenance and update of static web pages is solved, and the convenient management and modification of static web pages is realized. , which meets the needs of web projects for unified operation and management of content.
Patent Information
- Application Number
- CN202011362924.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-11-27
AI Technical Summary
Existing static web pages are inconvenient in content maintenance and update, and have poor user interactivity, which cannot meet the needs of unified operation and management of content in the web project architecture.
By creating page template files with positioning tags, the template engine is combined with public components in the jQuery-tmpl format and the Freemarker template engine to achieve page rendering and editing, allowing developers to edit static page content online to achieve a WYSIWYG effect.
It realizes the convenient management and modification of static web pages, improves the efficiency of content update, and meets the needs of web projects for unified operation and management of content.
Smart Images

Figure CN112632437B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a web page generation method, device and computer-readable storage medium. Background Art
[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] Web pages are the main carriers for business external display and information output. They are divided into static pages and dynamic pages. Compared with dynamic pages, static pages have better loading performance, higher security, more server resource saving and are more conducive to SEO optimization. The disadvantages of static pages are that they are not conducive to content maintenance and updating and have poor user interactivity. For web page projects that are mainly display pages, choosing static pages as front-end display pages can ensure their high security protection capabilities and provide services to users in a continuous and stable manner.
[0004] The official website developed by the enterprise mainly uses the MVC (Model-View-Controller) application software design framework. The user access page is divided into a view that dynamically calls data for rendering by the application or a static page resource in the system. However, on the one hand, the controller and the view are closely related. If the application fails to respond to user requests due to an abnormal situation, the view cannot be displayed normally. On the other hand, the modification of static page content in the application is highly dependent on the developer, which cannot meet the needs of unified content operation and management in the web project architecture.
[0005] Therefore, how to generate web pages that are easy to manage and modify is an urgent problem to be solved. Summary of the invention
[0006] In view of the problems existing in the above-mentioned prior art, a method, device and computer-readable storage medium for generating a web page are proposed. The above-mentioned problems can be solved by using this method, device and computer-readable storage medium.
[0007] The present invention provides the following solutions.
[0008] In a first aspect, a method for generating a web page is provided, comprising: creating a page template file, the page template file comprising at least: a general page structure file, a page style file, a first JS file for indicating page logic, and a second JS file for calling at least one common component; marking each designated page element in the page template file with a unique corresponding positioning tag to form a page template file with a positioning tag; loading the page template file with the positioning tag to form a template page, binding a corresponding click-to-edit event to the positioning tag in the template page; in response to a click-to-edit operation on each positioning tag, obtaining a page element value corresponding to each designated page element; and rendering the page using a template engine and according to the page template file with the positioning tag and the page element value to generate a web page.
[0009] In some implementations, creating a page template file includes: generating at least one common component in a jQuery-tmpl format; and generating a second JS file for calling the at least one common component in a jQuery-tmpl format.
[0010] In some implementations, generating at least one common component in jQuery-tmpl format includes: extracting at least one common component in HTML format from an existing page; and converting the common component in HTML format into a common component in jQuery-tmpl format.
[0011] In some embodiments, the type of the specified page element includes at least one or more of the following: pictures, static text, links, videos, and rich text; the method also includes: setting a corresponding type of positioning tag according to the type of the specified page element; and when loading a page template file with a positioning tag, binding a corresponding type of click-to-edit event according to the type of the positioning tag.
[0012] In some implementations, after marking each designated page element with a unique corresponding positioning tag, the method further includes: setting a default element value for the designated page element corresponding to each positioning tag.
[0013] In some implementations, the template engine is a Freemarker template engine.
[0014] In a second aspect, a web page generation device is provided, comprising: a template generation module and a background template management module; wherein the template generation module is configured to: create a page template file, the page template file comprises at least: a general page structure file, a page style file, a first JS file for indicating page logic and a second JS file for calling at least one common component; and, mark each designated page element in the page template file with a unique corresponding positioning tag to form a page template file with a positioning tag; the background template management module is configured to: load a page template file with a positioning tag to form a template page, bind a corresponding click-to-edit event to the positioning tag in the template page; obtain a page element value corresponding to each designated page element in response to a click-to-edit operation on each positioning tag; and, render a page using a template engine and according to the page template file with the positioning tag and the page element value to generate a web page.
[0015] In some embodiments, the template generation module is configured to further: generate at least one common component in the jQuery-tmpl format; generate a second JS file for calling the at least one common component in the jQuery-tmpl format.
[0016] In some embodiments, the template generation module is configured to further: extract at least one common component in HTML format from an existing page; and convert the common component in HTML format into a common component in jQuery-tmpl format.
[0017] In some embodiments, the type of the specified page element includes at least one or more of the following: pictures, static text, links, videos, and rich text; the template generation module is configured to also be used to: set a corresponding type of positioning tag according to the type of the specified page element; and the background template management module is configured to also be used to: when loading a page template file with a positioning tag, bind a corresponding type of click-to-edit event according to the type of the positioning tag.
[0018] In some implementations, the template generation module is configured to further: after marking each designated page element with a unique corresponding positioning tag, set a default element value for the designated page element corresponding to each positioning tag.
[0019] In some implementations, the template engine is a Freemarker template engine.
[0020] According to a third aspect, a web page generating device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute: the method according to the first aspect.
[0021] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a multi-core processor, the multi-core processor executes the method of the first aspect.
[0022] At least one of the above-mentioned technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: In this embodiment, by uploading a page template file carrying a positioning tag to the background, an editable template page is formed, and the corresponding click-to-edit event is bound to the positioning tag, so that developers can easily edit or modify the web page content online, and can immediately update the user-oriented static page to achieve a what-you-see-is-what-you-get effect.
[0023] It should be understood that the above description is only an overview of the technical solution of the present invention, so that the technical means of the present invention can be more clearly understood and implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described below by way of example. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The advantages and benefits of the present invention and other advantages and benefits will be apparent to those skilled in the art by reading the detailed description of the exemplary embodiments below. The accompanying drawings are only used for the purpose of illustrating exemplary embodiments and are not to be considered as limiting the present invention. Moreover, the same reference numerals are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0025] Figure 1 A schematic diagram of a flow chart of a method for generating a web page according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of positioning tags of respective types according to an embodiment of the present invention;
[0027] Figure 3a is a schematic diagram of a template page according to an embodiment of the present invention;
[0028] Figure 3b is a schematic diagram of a template page according to yet another embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of the structure of a web page generating device according to an embodiment of the present invention;
[0030] Figure 5 FIG. 4 is a schematic diagram of the structure of a web page generating device according to another embodiment of the present invention.
[0031] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0032] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0033] In the present invention, it should be understood that terms such as “including” or “having” are intended to indicate the existence of features, numbers, steps, behaviors, components, parts or a combination thereof disclosed in the specification, and are not intended to exclude the possibility of the existence of one or more other features, numbers, steps, behaviors, components, parts or a combination thereof.
[0034] It should also be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0035] The embodiment of the present invention provides a method for generating a web page. The inventive concept of the method is first introduced below.
[0036] The embodiment of the present invention provides a web page generation method. Specifically, firstly, a page template file is created. The page template file at least includes: a general page structure file, a page style file for indicating page styles such as fonts, colors, and positions, a first JS file for indicating page logic, and a second JS file for calling at least one common component. The common component may include, for example, a page top navigation, a page bottom navigation, a page sidebar navigation, a carousel, etc. After the page template file is created, each designated page element in the page template file is marked with a unique corresponding positioning tag to form a page template file with a positioning tag. The page template file with the positioning tag is loaded in an application browser to form a template page, and in the background editable mode of the browser, a corresponding click edit event is bound to the positioning tag in the template page, and then in response to the click edit operation for each positioning tag, the page element value corresponding to each designated page element is obtained. Afterwards, the page is rendered using a template engine and based on the page template file with the positioning tag and the page element value to generate a web page. Therefore, the backend administrator can upload the page template file with the positioning tag to the backend to form an editable template page, and bind the corresponding click-to-edit event to the positioning tag, so that the web page content can be easily edited or modified online, and the user-oriented static page can be updated immediately to achieve a what-you-see-is-what-you-get effect.
[0037] Those skilled in the art will appreciate that the described application scenario is only an example in which the embodiments of the present invention can be implemented. The scope of application of the embodiments of the present invention is not limited in any way. After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are specifically described below.
[0038] Figure 1 This is a flow chart of a web page generation method 100 according to an embodiment of the present application. The method is applied in a web server. In the flow, from the device perspective, the execution subject can be one or more electronic devices; from the program perspective, the execution subject can correspondingly be the program installed on these electronic devices.
[0039] like Figure 1 As shown, the method 100 may include:
[0040] Step 101: Create a page template file.
[0041] Specifically, the page template file may include at least: a general page structure file, a page style file, a first JS file for indicating page logic, and a second JS file for calling at least one common component.
[0042] The general page structure file can be an HTML file, which includes a page header and a page body; the page header is used to build the environment for the business page of the business application, for example, it contains various function libraries for building page codes; the page body includes multiple function functions encoded in script languages, for example, function functions that implement the same workflow abstracted from the business scenario. This basic page structure is used to build the environment required for the business page to run and / or implement the same workflow abstracted from similar business scenarios.
[0043] The page style file can be a CSS (Cascading Style Sheets) file. A CSS file is a text file containing CSS formatting codes. CSS is a computer language used to express the style of an HTML file. It is used to define page styles, such as fonts, colors, spacing, backgrounds, etc. A CSS style sheet contains rules for applying styles to specified page elements. Style rules are formatting instructions that can be applied to elements in a web page, such as text paragraphs or links. The page style file is used to define the page style presented by a page generated based on the page template.
[0044] The first JS file is a text file written in JavaScript scripting language, which is used to indicate the page logic and define the dynamic effects of the page. For example, clicking a certain area of the page will execute a pop-up event. JavaScript script files can not only reduce the size of web pages and increase web browsing speed, but also enrich the performance of web pages, such as animation, sound, etc.
[0045] The second JS file is a text file written in JavaScript scripting language and created to call at least one common component. For example, the common component may include page top navigation, page bottom navigation, page sidebar navigation, carousel, etc. Clicking on the common component element displayed on the page will call the component content of the corresponding common component.
[0046] In some implementations, the above step 101 may also include: generating at least one common component in the jQuery-tmpl format; generating a second JS file for calling at least one common component in the jQuery-tmpl format. It is understood that the common component content can be called on each page through the second JS file later, and the common component can be modified independently. For example, refer to Figure 3a or Figure 3b , assuming that the "Previous Page", "1", "2", ..., "Next Page" in the lower part are the page bottom navigation in the common component, then the component logic, fill value and other parameters of the page bottom navigation can be modified independently, and the page template will use the second JS file to directly call the modified common component. In this way, especially when it is necessary to modify the common components used in different page templates in batches, the modification efficiency is significantly improved.
[0047] In some embodiments, at least one common component in HTML format can be extracted from an existing page, and the common component in HTML format can be converted into a common component in jQuery-tmpl format, thereby generating at least one common component in jQuery-tmpl format. Alternatively, in some cases, at least one common component in jQuery-tmpl format can also be directly generated by a developer.
[0048] For example, the page template file generation step may include: designing and generating a common component in jQuery-tmpl format, such as a page top navigation. Generating a second JS file for calling the common component in jQuery-tmpl format. Designing the style of the page template to generate a page style file in CSS format language. Designing the page logic of the page template to generate a first JS file. Encapsulating the above page style file, the first JS file and the second JS file together into HTML code, the HTML code may also include: a general page style file and a general page structure file (HTML file) so as to create the page template file.
[0049] Step 102: Mark each designated page element in the page template file with a unique corresponding positioning tag to form a page template file with positioning tags;
[0050] In some implementations, after marking each designated page element with a unique corresponding positioning tag in step 102, the method may further include: setting a default element value for the designated page element corresponding to each positioning tag.
[0051] In some embodiments, reference Figure 2 , the type of the specified page element includes at least one or more of the following: picture, static text, link, video and rich text. The positioning tag can be classified into different types such as picture (PIC), static text (WRD), link (LNK), video (VDI), rich text (DOC) according to the type of the specified page element.
[0052] A possible exemplary code of a page template file is shown below to explain how to insert a positioning tag into a page template file.
[0053]
[0054] It can be seen that the first positioning tag (free="WRD103") can be inserted in one of the lines of the above code in the page template file, and the second positioning tag (free="WRD104") can be inserted in another line, WRD indicates that the type of the positioning tag is static text, wherein the first positioning tag includes the tag identifier "free", the positioning tag symbol "WRD" and the content number "103", and the default element value corresponding to the first positioning tag is "News Center". The second positioning tag includes the tag identifier "free", the positioning tag symbol "WRD" and the content number "104", and the default element value corresponding to the first positioning tag is "Picture Display". Optionally, the default element value may not be set. Optionally, other positioning tags may also be inserted in other code files of the page template file, such as the third positioning tag (free="VDI001"), the fourth positioning tag (free="PIC123"), and so on, which are not listed one by one in this application.
[0055] The above steps 101 and 102 can be understood as steps for generating a page template file with a tag. The generated page template file can be loaded in the application as a view for use, such as Figure 3a and Figure 3b On the other hand, it can also be uploaded to the template management module through the backend management system so that the backend personnel can generate the required web page based on the page template file, which is introduced in detail in steps 103 to 105.
[0056] Step 103: Load a page template file with a positioning tag to form a template page, and bind a corresponding click-to-edit event to the positioning tag in the template page;
[0057] In some embodiments, the above method also includes: setting a corresponding type of positioning tag according to the type of specified page element; and when loading a page template file with a positioning tag, binding a corresponding type of click-to-edit event according to the type of the positioning tag.
[0058] refer to Figure 2 , showing that when the positioning tag is classified as static text and the positioning tag symbol is WRD, the corresponding click editing event after the tag is clicked is "evoke the text input box, enter text", and so on.
[0059] Figure 3a A template page is shown. Figure 3b Another template page is shown. The difference between the two is that the page style is different. It can be understood that using two different types of page style files can generate the following Figure 3a and Figure 3b The different pages shown. Figure 3bFor example, "News Center" is assumed to be the default element value of the specified page element corresponding to the first positioning tag (free="WRD103"). Figure 2 , when the "News Center" is clicked, the corresponding click edit event is to call up a text input box, enter text, and the backend administrator can enter a replacement value such as "Product Introduction". Optionally, when the default element value corresponding to the positioning tag is not set, the page can display "Editable here". Among them, Figure 3b The "Picture 1", "Picture 2" and "Picture 3" in the figure show different default pictures. Figure 2 , backend business personnel can call up the picture library component by clicking on the picture, select or upload the picture and obtain the picture address, and then replace the picture in the template page with the picture to be displayed, such as the product picture.
[0060] Step 104: in response to a click-to-edit operation on each positioning tag, obtaining a page element value corresponding to each designated page element;
[0061] Step 105: Utilize the template engine and perform page rendering according to the page template file with the positioning tag and the page element value to generate a web page.
[0062] In some embodiments, the template engine is a Freemarker template engine. It is understood that the Freemarker template engine can call the default element value corresponding to the positioning tag. Compared with the "editable here" prompt, the exemplary default element value can provide editing guidance to the user. Optionally, the template engine can also be Velocity (a Java-based template engine) to generate output text such as HTML (Hyper Text Markup Language) web pages.
[0063] The above steps 103 to 105 can be understood as steps of generating a web page based on a page template file with tags.
[0064] For example, you can use iframe to load the page template file with the positioning tag to create a template page, and set the template page to editable mode. In the template page, the page elements with positioning tags will display their preset default values. If the default value is empty, you can add a default value of "editable here" for the page element. Each positioning tag is bound to a corresponding click edit event, so that the modified page element value will be displayed in the iframe in real time. Each positioning tag and its corresponding page element value will be saved in the database, and rendered by the freemarker template engine to generate an html format file, which will be placed in the temporary directory of the page in the static resources for preview. Finally, the template page enters the pending release stage. After the review process, the html file will be copied from the temporary directory to the official directory, and Internet users can access the web page.
[0065] Based on the same technical concept, an embodiment of the present invention further provides a web page generation device, which is used to execute the web page generation method provided by any of the above embodiments. Figure 4 A schematic diagram of the structure of a web page generating device provided by an embodiment of the present invention.
[0066] like Figure 4 As shown, the device 400 includes: a template generation module 401 and a background template management module 402.
[0067] The template generation module 401 is configured to: create a page template file, the page template file includes at least: a general page structure file, a page style file, a first JS file for indicating page logic and a second JS file for calling at least one common component; and mark each designated page element in the page template file with a unique corresponding positioning tag to form a page template file with a positioning tag.
[0068] The background template management module 402 is configured to: load a page template file with a positioning tag to form a template page, and bind a corresponding click-to-edit event to the positioning tag in the template page; obtain a page element value corresponding to each specified page element in response to a click-to-edit operation on each positioning tag; and use a template engine to render a page based on the page template file with the positioning tag and the page element value to generate a web page.
[0069] In some embodiments, the template generation module is configured to further: generate at least one common component in the jQuery-tmpl format; generate a second JS file for calling the at least one common component in the jQuery-tmpl format.
[0070] In some embodiments, the template generation module is configured to further: extract at least one common component in HTML format from an existing page; and convert the common component in HTML format into a common component in jQuery-tmpl format.
[0071] In some embodiments, the type of the specified page element includes at least one or more of the following: pictures, static text, links, videos, and rich text; the template generation module is configured to also be used to: set a corresponding type of positioning tag according to the type of the specified page element; and the background template management module is configured to also be used to: when loading a page template file with a positioning tag, bind a corresponding type of click-to-edit event according to the type of the positioning tag.
[0072] In some implementations, the template generation module is configured to further: after marking each designated page element with a unique corresponding positioning tag, set a default element value for the designated page element corresponding to each positioning tag.
[0073] In some implementations, the template engine is a Freemarker template engine.
[0074] It should be noted that the web page generation device in the embodiment of the present application can implement the various processes of the embodiment of the aforementioned web page generation method and achieve the same effects and functions, which will not be repeated here.
[0075] Figure 5 A web page generation device according to an embodiment of the present application is used to execute Figure 1 The web page generation method shown, the device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the above embodiment.
[0076] According to some embodiments of the present application, a non-volatile computer storage medium of a web page generation method is provided, on which computer executable instructions are stored, and the computer executable instructions are configured to execute the method described in the above embodiment when executed by a processor.
[0077] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, their descriptions are simplified, and the relevant parts can be referred to the partial description of the method embodiments.
[0078] The apparatus, device and computer-readable storage medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the apparatus, device and computer-readable storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the apparatus, device and computer-readable storage medium will not be repeated here.
[0079] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0080] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0081] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0083] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0084] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0085] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. In addition, although the operations of the method of the present invention are described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0086] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A method for generating a web page, characterized in that: include: Create a page template file, the page template file at least including: a general page structure file, a page style file, a first JS file for indicating page logic, and a second JS file for calling at least one common component; Marking each designated page element in the page template file with a unique corresponding positioning tag to form a page template file with positioning tags; the positioning tags include a tag identifier, a positioning tag symbol and a content number; Loading the page template file with the positioning tag to form a template page, and binding a corresponding click-to-edit event to the positioning tag in the template page; In response to a click-to-edit operation on each of the positioning tags, obtaining a page element value corresponding to each of the designated page elements; The template engine is used to render the page according to the page template file with the positioning tag and the page element value to generate a web page.
2. The method according to claim 1, characterized in that Create the page template file, including: generating the at least one common component in jQuery-tmpl format; The second JS file is generated for calling the at least one common component in the jQuery-tmpl format.
3. The method according to claim 2, characterized in that Generating the at least one common component in jQuery-tmpl format, comprising: Extracting at least one common component in HTML format from an existing page; The common component in HTML format is converted into a common component in jQuery-tmpl format.
4. The method according to claim 1, characterized in that: The type of the specified page element includes at least one or more of the following: picture, static text, link, video and rich text; the method further includes: According to the type of the designated page element, the positioning tag of the corresponding type is set; and, When the page template file with the positioning tag is loaded, a click-to-edit event of a corresponding type is bound according to the type of the positioning tag.
5. The method according to claim 1, characterized in that After marking each designated page element with a unique corresponding positioning tag, the method further includes: setting a default element value for each designated page element corresponding to the positioning tag.
6. The method according to claim 1, characterized in that The template engine is a Freemarker template engine.
7. A web page generation device, characterized in that: include: Template generation module and background template management module; among them, The template generation module is configured to: create a page template file, the page template file at least including: a general page structure file, a page style file, a first JS file for indicating page logic, and a second JS file for calling at least one common component; and mark each designated page element in the page template file with a unique corresponding positioning tag to form a page template file with a positioning tag; the positioning tag includes a tag identifier, a positioning tag symbol, and a content number; The background template management module is configured to: load the page template file with the positioning tag to form a template page, bind the corresponding click-to-edit event to the positioning tag in the template page; obtain the page element value corresponding to each specified page element in response to the click-to-edit operation for each positioning tag; and use the template engine to render the page according to the page template file with the positioning tag and the page element value to generate a web page.
8. The device according to claim 7, characterized in that The template generation module is configured to further: generating the at least one common component in jQuery-tmpl format; The second JS file is generated for calling the at least one common component in the jQuery-tmpl format.
9. The device according to claim 8, characterized in that The template generation module is configured to further: Extracting at least one common component in HTML format from an existing page; The common component in HTML format is converted into a common component in jQuery-tmpl format.
10. The device according to claim 7, characterized in that The type of the specified page element includes at least one or more of the following: picture, static text, link, video and rich text; The template generation module is configured to further: set the positioning tag of a corresponding type according to the type of the specified page element; as well as, The background template management module is configured to be further used for: when loading the page template file with the positioning tag, binding a corresponding type of click-to-edit event according to the type of the positioning tag.
11. The device according to claim 7, characterized in that The template generation module is configured to further be used for: after marking each designated page element with a unique corresponding positioning tag, setting a default element value for each designated page element corresponding to the positioning tag.
12. The device according to claim 7, characterized in that The template engine is a Freemarker template engine.
13. A web page generation device, characterized in that: include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to execute: the method as described in any one of claims 1-6.
14. A computer-readable storage medium storing a program, wherein when the program is executed by a multi-core processor, the multi-core processor executes the method according to any one of claims 1 to 6.
