WO2023123089A1 - Content management system, static page management method and device, and storage medium - Google Patents

Content management system, static page management method and device, and storage medium Download PDF

Info

Publication number
WO2023123089A1
WO2023123089A1 PCT/CN2021/142611 CN2021142611W WO2023123089A1 WO 2023123089 A1 WO2023123089 A1 WO 2023123089A1 CN 2021142611 W CN2021142611 W CN 2021142611W WO 2023123089 A1 WO2023123089 A1 WO 2023123089A1
Authority
WO
WIPO (PCT)
Prior art keywords
source code
page
static page
updated
code file
Prior art date
Application number
PCT/CN2021/142611
Other languages
French (fr)
Chinese (zh)
Inventor
韩非
雷焱森
刘阳
温书豪
马健
Original Assignee
深圳晶泰科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳晶泰科技有限公司 filed Critical 深圳晶泰科技有限公司
Priority to PCT/CN2021/142611 priority Critical patent/WO2023123089A1/en
Publication of WO2023123089A1 publication Critical patent/WO2023123089A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present application relates to the technical field of page management, in particular, to a content management system, a static page management method, device and storage medium.
  • CMS Content Management System, content management system
  • data that is, content management is realized through dynamic pages.
  • Write write the corresponding data model in the server-side program, and build a table in the database to store the corresponding data.
  • the server-side reads the corresponding data from the database, dynamically renders the page and Return to the client.
  • CMS in related technologies include: Django-CMS, ThinkPhp, Strapi, and other content management system frameworks based on different languages. Database; page dynamic rendering, when a user visits, the server dynamically renders the page.
  • the CMS in the related art has the following problems: Problem 1, when managing the content of the static page, it relies too much on the data model. For some or all of the content on the static page, the corresponding data model is established in the program in advance and a table is created in the database, and finally the template is replaced and reconstructed for the static page. It should be noted that, as static pages become more and more complex today, the previous page reconstruction, data model design and development will bring huge time investment in maintenance.
  • the present application provides a content management system, static page management method, device and storage medium to solve the problem of excessive reliance on data models when managing the content of static pages in the related art.
  • a content management system includes: a page editor, which is used to obtain source code files, display static pages generated by source code files, and respond to editing operations on target nodes in static pages, modify node content data associated with target nodes, and obtain updated static Pages and updated source code files, in which a static page is associated with a key-value pair dataset of node identifiers and node content; the version management system is used to obtain source code files from the code warehouse and send the source code files to the page for editing It is also used to obtain the updated source code file from the page editor and send the updated source code file to the code warehouse; the front-end development scaffolding tool is used to generate the source code file obtained by the page editor into a static page; static resources
  • the server is configured to obtain the updated static page from the page editor, store the updated static page, and generate an access link corresponding to the updated static page.
  • the static resource server is a cloud server
  • the cloud server stores the updated static page and generates an access path corresponding to the updated static page.
  • the front-end development scaffolding tool performs at least one of the following processes on the source code file to obtain a static page: packaging processing, compression processing, and page content injection processing; wherein, the packaging processing is used to detect the public code corresponding to the source code file and convert the public The visual data corresponding to the code is injected into the mark position of the static page; the compression processing is used to compress the space data and newline data in the source code file, and replace the variable larger than the preset length with the variable of the target length; the page content injection processing is used to convert the The data in the source code file is injected into the default page template.
  • a static page management method includes: obtaining the source code file, generating the source code file as a static page through the front-end development scaffolding tool, and displaying the static page, wherein, the static page is associated with a node identifier and a node content key-value pair data set; responding to the static
  • the editing operation of the target node in the page modifies the node content data associated with the target node to obtain an updated static page; the source code file is updated according to the updated static page to obtain an updated source code file.
  • the method further includes: detecting whether a release instruction for the updated static page is received; to synchronize the updated static page to the static resource server.
  • the method further includes: receiving feedback information corresponding to the release instruction, and judging whether the updated static page is The release is successful; if the release fails, obtain the source code file of the previous version of the updated static page through the version management system, and obtain the target source code file; generate the static page corresponding to the target source code file through the front-end development scaffolding tool, and obtain the target source code file to be detected in response to the editing operation of the static page to be detected, modify the content data associated with the static page to be detected, obtain the target static page, and update the target source code file according to the target static page.
  • the method before updating the source code file according to the updated static page to obtain the updated source code file, the method further includes: judging whether a confirmation instruction for the updated static page is received, and if the confirmation instruction is received , executing the step of updating the source code file according to the updated static page to obtain the updated source code file.
  • a device for managing static pages includes: a first acquisition unit for acquiring source code files, generating the source code files as static pages through front-end development scaffolding tools, and displaying the static pages, wherein the static pages are associated with a node identifier and a key value of the node content For the data set; the first response unit is used to respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page; the update unit is used to update the static page according to the updated static page Update the source code file to get the updated source code file.
  • the device further includes: a detection unit, configured to detect whether a release instruction for the updated static page is received after the update unit updates the source code file according to the updated static page and obtains the updated source code file; A unit, configured to synchronize the updated static page to the static resource server when the detection unit detects that the publishing instruction is received.
  • the device further includes: a receiving unit, configured to receive feedback information corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server, and judge whether the updated static page is published according to the feedback information Success; the second acquisition unit is used to obtain the source code file of the previous version of the updated static page through the version management system in the case of failure of the release, and obtains the target source code file; the generation unit is used to generate through the front-end development scaffolding tool The static page corresponding to the target source code file obtains the static page to be detected; the second response unit is used to respond to the editing operation of the static page to be detected, modify the content data associated with the static page to be detected, obtain the target static page, and according to The target static page updates the target source code file.
  • a receiving unit configured to receive feedback information corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server, and judge whether the updated static page is published according to the feedback information Success
  • the second acquisition unit is used to obtain the source
  • the device further includes: a judging unit, used for judging whether a confirmation instruction for the updated static page is received before the updating unit updates the source code file according to the updated static page and obtains the updated source code file;
  • the unit is configured to execute the step of updating the source code file according to the updated static page to obtain the updated source code file when the confirmation instruction is received.
  • a non-volatile storage medium includes a stored program, wherein, when the program runs, the device where the non-volatile storage medium is located is controlled to execute a A method of managing static pages.
  • an electronic device including a processor and a memory; computer-readable instructions are stored in the memory, and the processor is used to run the computer-readable instructions, wherein, when the computer-readable instructions run A static page management method is implemented.
  • the page editor is used to obtain the source code file, display the static page generated by the source code file, and respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain the updated Static pages and updated source code files, where a static page is associated with a node identifier and a key-value pair data set of node content; a version management system is used to obtain source code files from the code warehouse and send the source code files to the page The editor is also used to obtain the updated source code file from the page editor and send the updated source code file to the code warehouse; the front-end development scaffolding tool is used to generate the source code file obtained by the page editor into a static page; static The resource server is used to obtain the updated static page from the page editor, store the updated static page, and generate an access link corresponding to the updated static page, which solves the problem of data loss when managing the content of the static page in related technologies.
  • Model dependence is too high.
  • Static resources are stored in the way of linking node content data with node identifiers, and the node content data associated with nodes in static pages can be modified to achieve the purpose of modifying static pages, thereby improving the flexibility of managing static pages and reducing the need for data models.
  • the effect of dependence is too high.
  • FIG. 1 is a schematic diagram of a content management system provided according to an embodiment of the present application
  • Fig. 2 is a schematic diagram of an optional content management system provided according to an embodiment of the present application.
  • FIG. 3 is a flowchart of a static page management method provided according to an embodiment of the present application.
  • Fig. 4 is a flow chart of the rollback operation of the page code in the static page management method provided according to the embodiment of the present application;
  • Fig. 5 is a schematic diagram of an apparatus for managing static pages provided according to an embodiment of the present application.
  • CMS full name in English: content management system, Chinese: content management system
  • CMS is a software that helps users create, manage and modify content on the website without professional technical knowledge. its different data. Static pages actually exist and are directly loaded into the pages displayed on the client's browser without compilation by the server.
  • search engine optimization is a way to adjust the website by understanding the operating rules of the search engine and improve the ranking of the target website in the relevant search engine.
  • a content management system is provided, as shown in Figure 1, the system includes:
  • the page editor 101 is used to obtain the source code file, display the static page generated by the source code file, and respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain the updated static page and update
  • the final source code file in which the static page is associated with a key-value pair data set of node identifier and node content.
  • the page editor 101 is a set of browser-side web applications for previewing static pages and editing static page content. It can pull locally packaged static pages, and can also obtain the submission records of the project warehouse through the version management system 102. Switch the project to a different submission version, obtain the source code file from the code warehouse, and package the source code file into a static page through the front-end development scaffolding tool 103, and generate node identifiers and node content data corresponding to multiple nodes of the static page, multiple pairs The node identifier and node content data constitute key-value pair data.
  • the user can edit the content of the static page, visually click the node in the page, and dynamically modify the node content of the key-value pair data.
  • the node content is modified, according to the current static page and the corresponding key value Generate a new static page for the data.
  • modifying and saving the preview page reversely locate the path and location of the source code file of the modified node, update the source code file, and achieve the purpose of modifying the content of the source code file, achieving the realization of a static page out of the database for content management purposes.
  • the page editor 101 when the page editor 101 previews the page, it can import a packaged static page under the corresponding directory of the project, click on the corresponding page to jump to the URL, and load the corresponding page at the same time Data, update the content data when saving, the NodeGit third-party tool library can be used in the page editor 101, the tool library can realize the encapsulation of the underlying operation of the version management system 102, and provide the API interface of javascript objects.
  • the version management system 102 is used to obtain the source code file from the code warehouse, and send the source code file to the page editor 101, and is also used to obtain the updated source code file from the page editor 101, and send the updated source code file to the code storehouse.
  • the version management system 102 refers to the management tool of the code warehouse, which can be Git and SVN.
  • the third-party tool library NodeGit is used to control Git to switch the code warehouse, code rollback, A series of operations such as code pull and submission.
  • the page editor 101 will search for the file corresponding to the source code according to the currently updated node-node content mapping relationship, and after matching the corresponding file, the version management system 102 will update the source code file according to the latest node content.
  • the front-end development scaffolding tool 103 is used to generate the source code file obtained by the page editor 101 into a static page.
  • the static resource server 104 may export the static resource files stored locally on the computer to a specified file directory of the static resource server, and the front-end development scaffolding tool 103 generates static pages according to the static resource files.
  • the static resource server 104 is configured to obtain an updated static page from the page editor 101, store the updated static page, and generate an access link corresponding to the updated static page.
  • the static page when storing a static page, you can use a scanning tool to scan the content nodes in the static page, and assign a unique identifier to each content node, and generate a flattened key-value pair data according to the scanning situation.
  • the key-value pair data stores the node identifier and node content in one-to-one correspondence, thereby forming a static resource file, and storing the static resource file in the static resource server 104 .
  • the scanning tool may be an analysis script tool of NodeJS, and may also be a tool for analyzing an html file and generating a DOM structure. This embodiment does not limit the type of the scanning tool.
  • the page editor 101 in the content management system is a GUI editing tool
  • the version management system 102 is git
  • the front-end development scaffolding tool 103 is a webpack tool
  • the static resource server 104 For the cloud server, use the webpack packaging tool to package the source code files to build a static page.
  • the GUI editing tool can edit the static page and generate an updated static page.
  • the GUI editing tool can also synchronize the updated static page to the cloud.
  • the server, GUI editing tools and git can execute Git commands through NodeJ to update the source code corresponding to the static page.
  • the content management system adopts the page editor 101 to obtain the source code file, display the static page generated by the source code file, and modify the node associated with the target node in response to the editing operation of the target node in the static page content data, to obtain the updated static page and the updated source code file, wherein, the static page is associated with a key-value pair data set of node identifier and node content;
  • the version management system 102 is used to obtain the source code file from the code warehouse , and send the source code file to the page editor 101, and also be used to obtain the updated source code file from the page editor 101, and send the updated source code file to the code warehouse;
  • the front-end development scaffolding tool 103 is used to edit the page
  • the source code file obtained by the editor 101 is generated as a static page;
  • the static resource server 104 is used to obtain the updated static page from the page editor 101, store the updated static page, and generate an access link corresponding to the updated static page to solve The problem of over-reliance on the data model when managing the content
  • Static resources are stored in the way of linking node content data with node identifiers, and the node content data associated with nodes in static pages can be modified to achieve the purpose of modifying static pages, thereby improving the flexibility of managing static pages and reducing the need for data models. The effect of dependence.
  • the static resource server 104 is a cloud server, and the cloud server stores updated static pages and generates an access path corresponding to the updated static pages.
  • the static resource server 104 is a cloud server with a cloud storage function provided by the current cloud provider.
  • developers can also develop server programs to process requests and responses, and deploy the programs on corresponding servers.
  • static pages can be stored on the cloud server and access links can be generated, and the jump between pages can be realized according to the relative file path and the jump relationship in the page, and the corresponding static page can be displayed.
  • the relative path before the page is similar to the relative path between the local, for example: a folder is placed on the cloud server, and there are 1.html and 2.html in the folder , 3.html three files, you can access this folder on the cloud through the website www.test.com, when you need to access 1.html, you only need to modify and access www.test.com/1.html, access 2. html, 2.html and 1.html are the same.
  • the use of the cloud storage function requires the installation of the COSCMD tool.
  • the uploaded files refer to the static resources to be stored as mentioned above; the uploaded folder contains all the codes of a static resource management.
  • the NodeJS part also has static resource pictures, video text and other parts.
  • the command format for uploading files coscmd upload ⁇ localpath> ⁇ cospath>
  • the command format for uploading folders coscmd upload-r ⁇ localpath> ⁇ cospath>.
  • the front-end development scaffolding tool 103 performs at least one of the following processes on the source code file to obtain a static page: packaging processing, compression processing, and page content injection processing; wherein, packaging processing It is used to detect the public code corresponding to the source code file, and inject the visual data corresponding to the public code into the mark position of the static page; the compression process is used to compress the space data and newline data in the source code file, and replace the variable larger than the preset length is the variable of the target length; the page content injection process is used to inject the data in the source code file into the preset page template.
  • packaging processing It is used to detect the public code corresponding to the source code file, and inject the visual data corresponding to the public code into the mark position of the static page
  • the compression process is used to compress the space data and newline data in the source code file, and replace the variable larger than the preset length is the variable of the target length
  • the page content injection process is used to inject the data in the source code file into the preset page template.
  • the front-end development scaffolding tool 103 integrates functions of source code file packaging, compression, obfuscation, hot update, and automatic page content injection.
  • the packaging and compression function of the front-end development scaffolding tool 103 is that it can detect the injected code fragments of the common part on different pages, and inject the corresponding public part into the corresponding target position according to this fragment.
  • many pages may There will be a public header or bottom, these public parts only need to maintain one copy, mark or import in other files in a special way, and finally inject these public parts into each marked place, and replace the original marked.
  • the packaging function of the front-end development scaffolding tool 103 also has the ability to merge requests and merge multiple static resources into one.
  • the compression and obfuscation functions of the front-end development scaffolding tool 103 are mainly aimed at js script files, compressing redundant spaces and line breaks, and replacing redundant variables in the code.
  • the variable named thisisatestname in some codes can be compressed by the scaffolding tool Replace it with an abbreviation such as a or b), so as to achieve storage space for smaller files and save transmission bandwidth.
  • the hot update of the front-end development scaffolding tool 103 is the ability to package and refresh pages in real time during static page development and debugging, thereby improving the efficiency of development and debugging.
  • the automatic injection of the page content of the front-end development scaffolding tool 103 refers to the ability of the scaffolding tool to match special strings in the page to perform template injection or template replacement. Will match ⁇ % and %> and the contents of them, and replace.
  • the template injection of the front-end development scaffolding tool 103 can be realized by the plug-in of webpack.
  • the simplest method is to match a target string, then find the target content according to the information obtained by matching in this string, and then read the target content for replacement.
  • the static pages packaged with functions will have special tags for identification and positioning at specific content, and the generated pages will cooperate with the GUI tool for page editing and preview to realize the positioning of edited content and the ability to reverse locate the corresponding content in the source code location.
  • the front-end development scaffolding tool 103 is Webpack
  • the statically dependent third-party style and component library is Bootstrap
  • html-loader is used to deal with the template reuse problem of repeated parts of multiple pages.
  • the project directory generated by the front-end development scaffolding tool 103 includes a plurality of folders, specifically, includes a config folder, and the config folder is a configuration file for packaging and constructing static page files.
  • These configuration files guide webpack to build and package. Including the injection of public templates, the merging and packaging of js and css resources, the encoding of multimedia resources such as pictures, and the template processing of html files; it also includes the dist folder.
  • the contents of the dist folder are static resource files after packaging and construction.
  • the content of the static resource file previewed and published on the static resource server 104 also includes a map folder, the json data stored in the map folder is consistent with the directory structure of the html folder under the static folder, and each html file is stored.
  • the json data stores the unique identifier of the dom node and the key-value pair data of the content.
  • This file is automatically generated and updated every time the html file is updated (the process used Cheerio performs dom analysis on the html file in the node environment), and when packaging, it will replace the content of the corresponding node in the html folder according to the mapping data in this folder; return the server folder, and the files in the server folder are used for processing
  • the service logic of the page editing GUI includes the operation of the code warehouse, the resource synchronization operation of the static resource server 104, and the rewriting operation of the source code file; it also includes the static folder, which stores the source code of the static page in the development stage under the static folder. It is used to generate the initial source of the final build and packaged page; it also includes the webapp folder, where the source code of the GUI interactive interface is stored under the webapp folder.
  • the GUI interface starts, the code here will be compiled and executed, and combined with the server file Cooperate with the files under the folder, and perform a series of operations on the files.
  • a static page management method is provided.
  • Fig. 3 is a flowchart of a static page management method according to an embodiment of the present application. As shown in Figure 3, the method includes the following steps:
  • Step S302 obtain the source code file, generate the source code file as a static page through the front-end development scaffolding tool, and display the static page, wherein, the static page is associated with a data set of node identifier and node content key-value pair.
  • Node content data constitutes key-value pair data.
  • the overall resources can be packaged, and the packaged static resource files will be exported to the corresponding folder of the project for calling by the GUI web application for editing and previewing.
  • you can use the closed tag to wrap the place that needs to be edited and modified, and give the tag class "cms-editable”, inject a special tag on the content node that needs to be edited, so as to facilitate the establishment of mapping data between nodes and node content , and it is also convenient to accurately locate the marked target node during editing.
  • Step S304 in response to the editing operation on the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page.
  • the static pages under the project folder can be displayed, and the main interface will switch and display after clicking the static page to be edited.
  • the above operations have the characteristics of what you see is what you get, and you can preview the page effect after the copy or image resource is updated in real time.
  • Step S306 updating the source code file according to the updated static page to obtain the updated source code file.
  • the method before updating the source code file according to the updated static page to obtain the updated source code file, the method further includes: judging whether to receive the updated The confirmation instruction of the static page, in the case of receiving the confirmation instruction, executes the step of updating the source code file according to the updated static page to obtain the updated source code file.
  • the updated static page is only a temporary file, only after clicking the save button, according to the currently updated node-node content mapping relationship, to find the corresponding file of the source code, after matching the corresponding file , the source code data will be updated persistently according to the latest content.
  • the focused dom in the mouse movement event will be obtained.
  • the custom attribute map-id of the dom it can be identified according to the value Keyword goes to the corresponding json file under the map folder, and the content update in the current dom node is synchronized to the content corresponding to the key.
  • the static page management method obtaineds the source code file, generates the source code file as a static page through the front-end development scaffolding tool, and displays the static page, wherein, the static page is associated with a node identifier and node content Key-value pair data set; respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain the updated static page; update the source code file according to the updated static page, and obtain the updated source code file.
  • Static resources are stored in the way of linking node content data with node identifiers, and the node content data associated with nodes in static pages can be modified to achieve the purpose of modifying static pages, thereby improving the flexibility of managing static pages and reducing the need for data models. The effect of dependence.
  • the method further includes: detecting whether the updated Publishing instruction of the static page; upon receiving the publishing instruction, synchronizing the updated static page to the static resource server.
  • the source code file after the source code file is updated, it will actively trigger a project packaging operation to generate a brand new project folder, which can be previewed in the GUI tool.
  • This operation simulates the interface published to the static resource server.
  • the user After confirming that it is correct, the user can click the release button to trigger the submission operation of the code warehouse, and store the modification record in the version management system of the code warehouse.
  • the GUI tool After submitting the source code, the GUI tool will save the project folder in the project
  • the static pages under the static resource server are synchronized to the folder specified by the static resource server through the interface of the static resource server to realize the publishing of the static pages.
  • the method further includes: receiving feedback information corresponding to the publishing instruction, and judging whether the updated static page is successfully published according to the feedback information; if the publishing fails, obtaining the updated static page through the version management system Obtain the target source code file from the source code file of the previous version of the static page; generate the static page corresponding to the target source code file through the front-end development scaffolding tool, and obtain the static page to be detected; respond to the editing operation of the static page to be detected, and modify the static page to be detected The content data associated with the static page is obtained to obtain the target static page, and the target source code file is updated according to the target static page.
  • the publishing website can also send a notification message to the GUI tool.
  • the GUI tool uses the function of version switching Perform the rollback operation of the page code, specifically, obtain the source code file corresponding to the static page through the version management system, generate the static page to be detected, modify the content data associated with the static page to be detected, and obtain the modified static page, thereby according to The modified static page updates the source code file to realize the rollback of the source code file.
  • Step 1 Use the scaffolding tool to generate the file directory of the project according to the preset file content and file structure.
  • Step 2 Install all third-party plug-ins that the project depends on: webpack, nodeGit, bootstrap, coscmd, cheerio, etc.
  • Step 3 Develop a static page.
  • the purpose of this is to be able to edit when needed
  • a special mark is injected into the content node of the content node, which is convenient for establishing the mapping data of the node and the node content, and at the same time, it is convenient for accurately locating the marked target node when editing.
  • Step 4 Edit and preview. After developing a set of static pages, you can package the overall resources. The packaged static resource files will be exported to the project folder, and run the script at the same time to open the GUI web application for editing and previewing.
  • the static pages under the project folder will be displayed.
  • the main interface will be switched and displayed.
  • Use the mouseover event of the mouse to obtain the target node that the mouse is hovering over in real time when the mouse is moving double-click the mouse to obtain the focus of the target node, and edit the content of the corresponding node.
  • This operation has the characteristics of what you see is what you get, and you can preview the page effect after the copy or image resource is updated in real time. But these are only temporary files, and the source code data will be permanently updated only after clicking the save button.
  • Step 5 Update the source code and trigger the packaging operation. After clicking Save on the GUI tool, the GUI will search for the file corresponding to the source code according to the currently updated node-node content mapping relationship. After matching the corresponding file, it will update the source code file according to the latest content.
  • the preview operation can be performed in the GUI tool.
  • This operation simulates publishing to a static resource server on the interface.
  • the user can click the publish button. This button will trigger the commit operation of the code warehouse, and the modification record of this time will be stored in the version management system of the code warehouse.
  • the GUI tool will synchronize the static resources under the project folder in the project to the folder specified by the static resource server through the interface of the static resource server.
  • Step 6 Move to the officially released website to check the update status of the page content again. In case of an unexpected situation, use the version switching function of the GUI tool to perform the rollback operation of the page code.
  • FIG. 4 is a flow chart of the rollback operation of the page code in the static page management method according to the embodiment of the present application. As shown in FIG. 4 , the rollback operation of the page code includes the following steps:
  • Node Git obtains the log submitted by git, switches the version, and judges whether to perform the detection operation. If so, pulls the source code of the target version, and triggers the packaging and reconstruction work of the scaffolding tool to package the static resources. Furthermore, the GUI defines the local node service, and the page is automatically refreshed to the latest version. The user can edit the content of the case on the GUI interface, display the edited page, and save the edited page. After saving, update the warehouse source code according to the node key-value pair data corresponding to the page, and trigger the packaging and building operation of the scaffolding tool. At the same time, start the preview server, preview the static files in the project directory, and publish the page. After the page is published, Node Git commits the changes to the current version, and COSCMD uploads the project files and folders.
  • the front-end and lightweight of static page content management can be realized, and the data content management system can get rid of the dependence on server programs and databases; Any editable node can be visually edited to realize visual real-time editing and preview of static page resources, which improves the efficiency of maintenance.
  • developers do not need to refactor secondary development of static pages, and they can be used after one development. Static page resources are released , the path entity is clear, which is conducive to search engine optimization.
  • the embodiment of the present application also provides a static page management device. It should be noted that the static page management device in the embodiment of the present application can be used to execute the static page management method provided in the embodiment of the present application.
  • the static page management apparatus provided by the embodiment of the present application is introduced below.
  • Fig. 5 is a schematic diagram of an apparatus for managing static pages according to an embodiment of the present application.
  • the device includes: a first acquiring unit 501 , a first responding unit 502 and an updating unit 503 .
  • the first obtaining unit 501 is used to obtain the source code file, generate the source code file as a static page through the front-end development scaffolding tool, and display the static page, wherein the static page is associated with a node identifier and a key value of the node content to the dataset;
  • the first response unit 502 is configured to respond to an editing operation on the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page;
  • the updating unit 503 is configured to update the source code file according to the updated static page to obtain the updated source code file.
  • the device further includes: a detection unit, configured to update the source code file according to the updated static page by the updating unit 503 and obtain the updated source code file, Detect whether a posting instruction for the updated static page is received; a synchronization unit is configured to synchronize the updated static page to the static resource server when the detection unit detects that the posting instruction is received.
  • the device further includes: a receiving unit, configured to receive the feedback corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server information, and judge whether the updated static page is released successfully according to the feedback information; the second acquisition unit is used to obtain the source code file of the previous version of the updated static page through the version management system to obtain the target The source code file; the generation unit is used to generate the static page corresponding to the target source code file through the front-end development scaffolding tool to obtain the static page to be detected; the second response unit is used to respond to the editing operation of the static page to be detected and modify the static page to be detected The content data associated with the static page is obtained to obtain the target static page, and the target source code file is updated according to the target static page.
  • a receiving unit configured to receive the feedback corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server information, and judge whether the updated static page is released successfully according to the feedback information
  • the second acquisition unit is used to obtain the source code
  • the device further includes: a judging unit, configured to update the source code file according to the updated static page before the updating unit 503 obtains the updated source code file, Judging whether a confirmation instruction for the updated static page is received; the execution unit is configured to execute the step of updating the source code file according to the updated static page to obtain the updated source code file when the confirmation instruction is received.
  • a judging unit configured to update the source code file according to the updated static page before the updating unit 503 obtains the updated source code file, Judging whether a confirmation instruction for the updated static page is received
  • the execution unit is configured to execute the step of updating the source code file according to the updated static page to obtain the updated source code file when the confirmation instruction is received.
  • the static page management device obtains the source code file through the first acquisition unit 501, generates the source code file as a static page through the front-end development scaffolding tool, and displays the static page, wherein the static page is associated with a node symbol
  • the key-value pair data set of symbols and node content the first response unit 502 responds to the edit operation of the target node in the static page, modifies the node content data associated with the target node, and obtains the updated static page;
  • the update unit 503 according to the updated The source code file of the static page is updated to obtain the updated source code file.
  • the static page management device includes a processor and a memory, and the above-mentioned first acquisition unit 501, first response unit 502, and update unit 503 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to achieve the corresponding functions.
  • the processor includes a kernel, and the kernel fetches corresponding program units from the memory.
  • One or more kernels can be set, and the problem of excessive dependence on the data model in the management of static page content in related technologies can be solved by adjusting kernel parameters.
  • Memory may include non-permanent memory in computer-readable media, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory including at least one memory chip.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • the embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute a static page management method .
  • the embodiment of the present application also provides an electronic device, including a processor and a memory; computer-readable instructions are stored in the memory, and the processor is used to run the computer-readable instructions, wherein, when the computer-readable instructions are running, a static page Management method.
  • the electronic device herein may be a server, a PC, a PAD, a mobile phone, and the like.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash random access memory
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, 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, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application discloses a content management system, a static page management method and device, and a storage medium. The system comprises: a page editor used for acquiring a source code file, for displaying a static page produced from the source code file and, in response to an editing operation on a target node in the static page, for modifying node content data associated with the target node so as to obtain an updated static page and an updated source code file; a version management system used for acquiring a source code file from a codebase and sending the source code file to the page editor and also used for acquiring an updated source code file from the page editor and sending the updated source code file to the codebase; a front-end development scaffolding tool used for producing a static page from a source code file acquired by the page editor; and a static resource server used for storing an updated static page. The present application resolves the problem in the prior art of over-dependence on data models during static page content management.

Description

内容管理系统、静态页面的管理方法、装置及存储介质Content management system, static page management method, device and storage medium 技术领域technical field
本申请涉及页面管理技术领域,具体而言,涉及一种内容管理系统、静态页面的管理方法、装置及存储介质。The present application relates to the technical field of page management, in particular, to a content management system, a static page management method, device and storage medium.
背景技术Background technique
目前主流的CMS(Content Management System,内容管理系统)都是通过数据驱动的,也即通过动态页面实现内容管理,具体地,开发者使用模板语法,针对静态页面中的内容进行有变量替换和重写,在服务器端程序中编写对应的数据模型,同时在数据库中建表以存储对应的数据,当访问者访问对应的网站时,服务器端从数据库中读取对应的数据,将页面动态渲染并返回客户端。The current mainstream CMS (Content Management System, content management system) is driven by data, that is, content management is realized through dynamic pages. Write, write the corresponding data model in the server-side program, and build a table in the database to store the corresponding data. When the visitor visits the corresponding website, the server-side reads the corresponding data from the database, dynamically renders the page and Return to the client.
相关技术中的CMS有:Django-CMS、ThinkPhp、Strapi,以及其他基于不同的语言开发的内容管理系统的框架,上述通过数据驱动的CMS系统的特点是:数据驱动,需要提前设计好数据模型和数据库;页面动态渲染,在有用户访问时,服务器动态渲染页面。CMS in related technologies include: Django-CMS, ThinkPhp, Strapi, and other content management system frameworks based on different languages. Database; page dynamic rendering, when a user visits, the server dynamically renders the page.
因而,相关技术中的CMS存在以下问题:问题一,在对静态页面的内容进行管理时对数据模型依赖过高,在使用CMS时,首先需要开发出一套成型的静态页面,然后根据CMS框架的设定,针对静态页面上部分或者全部的内容预先在程序中建立相应的数据模型并在数据库中建表,最后对静态页面进行模板替换和重构。需要说明的是,在静态页面越来越复杂的今天,前期的页面重构、数据模型的设计和开发,会带来维护上巨大的时间投入。问题二,动态页面不利于SEO(Search Engine Optimization,搜索引擎优化),动态链接对SEO的优化更多的是便于页面的调整和管理,动态页面链接对服务器负载产生较大的压力,网站访问速度慢,路径准确不清晰,页面异常率高,存在虚假的路径文件,不利于SEO优化效果。Therefore, the CMS in the related art has the following problems: Problem 1, when managing the content of the static page, it relies too much on the data model. For some or all of the content on the static page, the corresponding data model is established in the program in advance and a table is created in the database, and finally the template is replaced and reconstructed for the static page. It should be noted that, as static pages become more and more complex today, the previous page reconstruction, data model design and development will bring huge time investment in maintenance. Question 2, dynamic pages are not conducive to SEO (Search Engine Optimization, search engine optimization), dynamic links to SEO optimization is more convenient for page adjustment and management, dynamic page links have a greater pressure on server load, website access speed Slow, the path is not accurate and clear, the page exception rate is high, and there are false path files, which is not conducive to SEO optimization effect.
针对相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题,目前尚未提出有效的解决方案。Aiming at the problem of excessive reliance on the data model when managing the content of the static page in the related art, no effective solution has been proposed yet.
发明内容Contents of the invention
本申请提供一种内容管理系统、静态页面的管理方法、装置及存储介质,以解决 相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题。The present application provides a content management system, static page management method, device and storage medium to solve the problem of excessive reliance on data models when managing the content of static pages in the related art.
根据本申请的一个方面,提供了内容管理系统。该系统包括:页面编辑器,用于获取源码文件,展示由源码文件生成的静态页面,并响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面以及更新后的源码文件,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;版本管理系统,用于从代码仓库获取源码文件,并将源码文件发送至页面编辑器,还用于从页面编辑器获取更新后的源码文件,并将更新后的源码文件发送至代码仓库;前端开发脚手架工具,用于将页面编辑器获取的源码文件生成为静态页面;静态资源服务器,用于从页面编辑器获取更新后的静态页面,存储更新后的静态页面,并生成更新后的静态页面对应的访问链接。According to one aspect of the present application, a content management system is provided. The system includes: a page editor, which is used to obtain source code files, display static pages generated by source code files, and respond to editing operations on target nodes in static pages, modify node content data associated with target nodes, and obtain updated static Pages and updated source code files, in which a static page is associated with a key-value pair dataset of node identifiers and node content; the version management system is used to obtain source code files from the code warehouse and send the source code files to the page for editing It is also used to obtain the updated source code file from the page editor and send the updated source code file to the code warehouse; the front-end development scaffolding tool is used to generate the source code file obtained by the page editor into a static page; static resources The server is configured to obtain the updated static page from the page editor, store the updated static page, and generate an access link corresponding to the updated static page.
可选地,静态资源服务器为云服务器,云服务器存储更新后的静态页面,并生成更新后的静态页面对应的访问路径。Optionally, the static resource server is a cloud server, and the cloud server stores the updated static page and generates an access path corresponding to the updated static page.
可选地,前端开发脚手架工具对源码文件进行以下至少之一处理,得到静态页面:打包处理、压缩处理、页面内容注入处理;其中,打包处理用于检测源码文件对应的公共代码,并将公共代码对应的可视化数据注入到静态页面的标记位置;压缩处理用于压缩源码文件中的空格数据和换行数据,并将大于预设长度的变量替换为目标长度的变量;页面内容注入处理用于将源码文件中的数据注入预设页面模板中。Optionally, the front-end development scaffolding tool performs at least one of the following processes on the source code file to obtain a static page: packaging processing, compression processing, and page content injection processing; wherein, the packaging processing is used to detect the public code corresponding to the source code file and convert the public The visual data corresponding to the code is injected into the mark position of the static page; the compression processing is used to compress the space data and newline data in the source code file, and replace the variable larger than the preset length with the variable of the target length; the page content injection processing is used to convert the The data in the source code file is injected into the default page template.
根据本申请的另一个方面,提供了一种静态页面的管理方法。该方法包括:获取源码文件,通过前端开发脚手架工具将源码文件生成为静态页面,并展示静态页面,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面;根据更新后的静态页面更新源码文件,得到更新后的源码文件。According to another aspect of the present application, a static page management method is provided. The method includes: obtaining the source code file, generating the source code file as a static page through the front-end development scaffolding tool, and displaying the static page, wherein, the static page is associated with a node identifier and a node content key-value pair data set; responding to the static The editing operation of the target node in the page modifies the node content data associated with the target node to obtain an updated static page; the source code file is updated according to the updated static page to obtain an updated source code file.
可选地,在根据更新后的静态页面更新源码文件,得到更新后的源码文件之后,该方法还包括:检测是否接收到针对更新后的静态页面的发布指令;在接收到发布指令的情况下,将更新后的静态页面同步至静态资源服务器。Optionally, after updating the source code file according to the updated static page and obtaining the updated source code file, the method further includes: detecting whether a release instruction for the updated static page is received; to synchronize the updated static page to the static resource server.
可选地,在接收到发布指令的情况下,将更新后的静态页面同步至静态资源服务器之后,该方法还包括:接收发布指令对应的反馈信息,并根据反馈信息判断更新后的静态页面是否发布成功;在发布失败的情况下,通过版本管理系统获取更新后的静态页面的上一版本的源码文件,得到目标源码文件;通过前端开发脚手架工具生成目标源码文件对应的静态页面,得到待检测的静态页面;响应对待检测的静态页面的编辑操作,修改待检测的静态页面关联的内容数据,得到目标静态页面,并根据目标静态页面更新目标源码文件。Optionally, after receiving the release instruction, after synchronizing the updated static page to the static resource server, the method further includes: receiving feedback information corresponding to the release instruction, and judging whether the updated static page is The release is successful; if the release fails, obtain the source code file of the previous version of the updated static page through the version management system, and obtain the target source code file; generate the static page corresponding to the target source code file through the front-end development scaffolding tool, and obtain the target source code file to be detected in response to the editing operation of the static page to be detected, modify the content data associated with the static page to be detected, obtain the target static page, and update the target source code file according to the target static page.
可选地,在根据更新后的静态页面更新源码文件,得到更新后的源码文件之前,该方法还包括:判断是否接收到对更新后的静态页面的确认指令,在接收到确认指令的情况下,执行根据更新后的静态页面更新源码文件,得到更新后的源码文件的步骤。Optionally, before updating the source code file according to the updated static page to obtain the updated source code file, the method further includes: judging whether a confirmation instruction for the updated static page is received, and if the confirmation instruction is received , executing the step of updating the source code file according to the updated static page to obtain the updated source code file.
根据本申请的另一方面,提供了一种静态页面的管理装置。该装置包括:第一获取单元,用于获取源码文件,通过前端开发脚手架工具将源码文件生成为静态页面,并展示静态页面,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;第一响应单元,用于响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面;更新单元,用于根据更新后的静态页面更新源码文件,得到更新后的源码文件。According to another aspect of the present application, a device for managing static pages is provided. The device includes: a first acquisition unit for acquiring source code files, generating the source code files as static pages through front-end development scaffolding tools, and displaying the static pages, wherein the static pages are associated with a node identifier and a key value of the node content For the data set; the first response unit is used to respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page; the update unit is used to update the static page according to the updated static page Update the source code file to get the updated source code file.
可选地,该装置还包括:检测单元,用于在更新单元根据更新后的静态页面更新源码文件,得到更新后的源码文件之后,检测是否接收到针对更新后的静态页面的发布指令;同步单元,用于在检测单元检测出接收到发布指令的情况下,将更新后的静态页面同步至静态资源服务器。Optionally, the device further includes: a detection unit, configured to detect whether a release instruction for the updated static page is received after the update unit updates the source code file according to the updated static page and obtains the updated source code file; A unit, configured to synchronize the updated static page to the static resource server when the detection unit detects that the publishing instruction is received.
可选地,该装置还包括:接收单元,用于在同步单元将更新后的静态页面同步至静态资源服务器之后,接收发布指令对应的反馈信息,并根据反馈信息判断更新后的静态页面是否发布成功;第二获取单元,用于在发布失败的情况下,通过版本管理系统获取更新后的静态页面的上一版本的源码文件,得到目标源码文件;生成单元,用于通过前端开发脚手架工具生成目标源码文件对应的静态页面,得到待检测的静态页面;第二响应单元,用于响应对待检测的静态页面的编辑操作,修改待检测的静态页面关联的内容数据,得到目标静态页面,并根据目标静态页面更新目标源码文件。Optionally, the device further includes: a receiving unit, configured to receive feedback information corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server, and judge whether the updated static page is published according to the feedback information Success; the second acquisition unit is used to obtain the source code file of the previous version of the updated static page through the version management system in the case of failure of the release, and obtains the target source code file; the generation unit is used to generate through the front-end development scaffolding tool The static page corresponding to the target source code file obtains the static page to be detected; the second response unit is used to respond to the editing operation of the static page to be detected, modify the content data associated with the static page to be detected, obtain the target static page, and according to The target static page updates the target source code file.
可选地,该装置还包括:判断单元,用于在更新单元根据更新后的静态页面更新源码文件,得到更新后的源码文件之前,判断是否接收到对更新后的静态页面的确认指令;执行单元,用于在接收到确认指令的情况下,执行根据更新后的静态页面更新源码文件,得到更新后的源码文件的步骤。Optionally, the device further includes: a judging unit, used for judging whether a confirmation instruction for the updated static page is received before the updating unit updates the source code file according to the updated static page and obtains the updated source code file; The unit is configured to execute the step of updating the source code file according to the updated static page to obtain the updated source code file when the confirmation instruction is received.
根据本发明实施例的另一方面,还提供了一种非易失性存储介质,非易失性存储介质包括存储的程序,其中,程序运行时控制非易失性存储介质所在的设备执行一种静态页面的管理方法。According to another aspect of the embodiments of the present invention, a non-volatile storage medium is also provided, and the non-volatile storage medium includes a stored program, wherein, when the program runs, the device where the non-volatile storage medium is located is controlled to execute a A method of managing static pages.
根据本发明实施例的另一方面,还提供了一种电子装置,包含处理器和存储器;存储器中存储有计算机可读指令,处理器用于运行计算机可读指令,其中,计算机可读指令运行时执行一种静态页面的管理方法。According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a processor and a memory; computer-readable instructions are stored in the memory, and the processor is used to run the computer-readable instructions, wherein, when the computer-readable instructions run A static page management method is implemented.
通过本申请,采用页面编辑器,用于获取源码文件,展示由源码文件生成的静态页面,并响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数 据,得到更新后的静态页面以及更新后的源码文件,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;版本管理系统,用于从代码仓库获取源码文件,并将源码文件发送至页面编辑器,还用于从页面编辑器获取更新后的源码文件,并将更新后的源码文件发送至代码仓库;前端开发脚手架工具,用于将页面编辑器获取的源码文件生成为静态页面;静态资源服务器,用于从页面编辑器获取更新后的静态页面,存储更新后的静态页面,并生成更新后的静态页面对应的访问链接,解决了相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题。通过节点标志符关联节点内容数据的方式存储静态资源,可以对静态页面中的节点关联的节点内容数据进行修改达到修改静态页面的目的,进而达到了提高管理静态页面的灵活性、降低对数据模型依赖性的效果。Through this application, the page editor is used to obtain the source code file, display the static page generated by the source code file, and respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain the updated Static pages and updated source code files, where a static page is associated with a node identifier and a key-value pair data set of node content; a version management system is used to obtain source code files from the code warehouse and send the source code files to the page The editor is also used to obtain the updated source code file from the page editor and send the updated source code file to the code warehouse; the front-end development scaffolding tool is used to generate the source code file obtained by the page editor into a static page; static The resource server is used to obtain the updated static page from the page editor, store the updated static page, and generate an access link corresponding to the updated static page, which solves the problem of data loss when managing the content of the static page in related technologies. Model dependence is too high. Static resources are stored in the way of linking node content data with node identifiers, and the node content data associated with nodes in static pages can be modified to achieve the purpose of modifying static pages, thereby improving the flexibility of managing static pages and reducing the need for data models. The effect of dependence.
附图说明Description of drawings
构成本申请的一部分的附图用来提供对本申请的进一步理解,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings constituting a part of the application are used to provide further understanding of the application, and the schematic embodiments and descriptions of the application are used to explain the application, and do not constitute an improper limitation to the application. In the attached picture:
图1是根据本申请实施例提供的内容管理系统的示意图;FIG. 1 is a schematic diagram of a content management system provided according to an embodiment of the present application;
图2是根据本申请实施例提供的可选的内容管理系统的示意图;Fig. 2 is a schematic diagram of an optional content management system provided according to an embodiment of the present application;
图3是根据本申请实施例提供的静态页面的管理方法的流程图;FIG. 3 is a flowchart of a static page management method provided according to an embodiment of the present application;
图4是根据本申请实施例提供的静态页面的管理方法中进行页面代码的回滚操作流程图;Fig. 4 is a flow chart of the rollback operation of the page code in the static page management method provided according to the embodiment of the present application;
图5是根据本申请实施例提供的静态页面的管理装置的示意图。Fig. 5 is a schematic diagram of an apparatus for managing static pages provided according to an embodiment of the present application.
具体实施方式Detailed ways
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使 用的数据在适当情况下可以互换,以便这里描述的本申请的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It should be understood that the data so used may be interchanged under appropriate circumstances for the embodiments of the application described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.
为了便于描述,以下对本申请实施例涉及的部分名词或术语进行说明:For ease of description, some nouns or terms involved in the embodiments of the present application are described below:
CMS(英文全称:content management system,中文:内容管理系统)是帮助用户在网站上创建,管理修改内容而无需专业技术知识的软件动态页面是一对多访问,通过一个页面,可以通过若干参数返回其不同的数据。静态页面是实际存在的,无需经过服务器的编译,直接加载到客户浏览器上显示出来的页面。CMS (full name in English: content management system, Chinese: content management system) is a software that helps users create, manage and modify content on the website without professional technical knowledge. its different data. Static pages actually exist and are directly loaded into the pages displayed on the client's browser without compilation by the server.
SEO:(英文全称:Search Engine Optimization,中文:搜索引擎优化),搜索引擎优化是一种透过了解搜索引擎的运作规则来调整网站,以及提高目的网站在有关搜索引擎内排名的方式。SEO: (English full name: Search Engine Optimization, Chinese: Search Engine Optimization), search engine optimization is a way to adjust the website by understanding the operating rules of the search engine and improve the ranking of the target website in the relevant search engine.
根据本申请的实施例,提供了一种内容管理系统,如图1所示,该系统包括:According to an embodiment of the present application, a content management system is provided, as shown in Figure 1, the system includes:
页面编辑器101,用于获取源码文件,展示由源码文件生成的静态页面,并响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面以及更新后的源码文件,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集。The page editor 101 is used to obtain the source code file, display the static page generated by the source code file, and respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain the updated static page and update The final source code file, in which the static page is associated with a key-value pair data set of node identifier and node content.
具体地,页面编辑器101是一套预览静态页面和编辑静态页面内容的浏览器端的web应用,可以拉取本地已经打包好的静态页面,还可以通过版本管理系统102获取项目仓库的提交记录、切换项目至不同的提交版本,从代码仓库获取源码文件,并通过前端开发脚手架工具103将源码文件打包成静态页面,同时生成静态页面的多个节点对应的节点标志符和节点内容数据,多对节点标志符和节点内容数据构成键值对数据。Specifically, the page editor 101 is a set of browser-side web applications for previewing static pages and editing static page content. It can pull locally packaged static pages, and can also obtain the submission records of the project warehouse through the version management system 102. Switch the project to a different submission version, obtain the source code file from the code warehouse, and package the source code file into a static page through the front-end development scaffolding tool 103, and generate node identifiers and node content data corresponding to multiple nodes of the static page, multiple pairs The node identifier and node content data constitute key-value pair data.
在生成静态页面之后,用户可以编辑静态页面的内容,可视化的点选页面内的节点,动态的修改键值对数据的节点内容,在修改完成节点内容之后,根据当前静态页面和对应的键值对数据生成一份新的静态页面,在修改并保存预览页面时,逆向的定位到修改节点的源码文件路径和位置,更新源码文件,实现修改源码文件内容的目的,达到了脱离数据库实现静态页面的内容管理的目的。After the static page is generated, the user can edit the content of the static page, visually click the node in the page, and dynamically modify the node content of the key-value pair data. After the node content is modified, according to the current static page and the corresponding key value Generate a new static page for the data. When modifying and saving the preview page, reversely locate the path and location of the source code file of the modified node, update the source code file, and achieve the purpose of modifying the content of the source code file, achieving the realization of a static page out of the database for content management purposes.
在一种可选的实施例中,页面编辑器101进行页面预览时,可以引入项目对应目录下的打包好的静态页面,点选对应的页面会进行URL的跳转,同时载入对应的页面数据,在保存时进行内容数据的更新,页面编辑器101中可以使用NodeGit第三方工 具库,该工具库可实现了对版本管理系统102底层操作的封装,并提供了javascript对象的API接口。In an optional embodiment, when the page editor 101 previews the page, it can import a packaged static page under the corresponding directory of the project, click on the corresponding page to jump to the URL, and load the corresponding page at the same time Data, update the content data when saving, the NodeGit third-party tool library can be used in the page editor 101, the tool library can realize the encapsulation of the underlying operation of the version management system 102, and provide the API interface of javascript objects.
版本管理系统102,用于从代码仓库获取源码文件,并将源码文件发送至页面编辑器101,还用于从页面编辑器101获取更新后的源码文件,并将更新后的源码文件发送至代码仓库。The version management system 102 is used to obtain the source code file from the code warehouse, and send the source code file to the page editor 101, and is also used to obtain the updated source code file from the page editor 101, and send the updated source code file to the code storehouse.
需要说明的是,版本管理系统102指的是代码仓库的管理工具,可以是Git和SVN,本实例中利用第三方工具库NodeGit,控制Git对代码仓库进行代码版本的切换、代码的回滚、代码的拉去和提交等一系列的操作。It should be noted that the version management system 102 refers to the management tool of the code warehouse, which can be Git and SVN. In this example, the third-party tool library NodeGit is used to control Git to switch the code warehouse, code rollback, A series of operations such as code pull and submission.
具体地,在页面编辑器101上点击保存后,页面编辑器101会根据当前已经更新过的节点-节点内容的映射关系,去寻找源码对应的文件,在匹配到对应的文件后,版本管理系统102会根据最新的节点内容更新源码文件。Specifically, after clicking Save on the page editor 101, the page editor 101 will search for the file corresponding to the source code according to the currently updated node-node content mapping relationship, and after matching the corresponding file, the version management system 102 will update the source code file according to the latest node content.
前端开发脚手架工具103,用于将页面编辑器101获取的源码文件生成为静态页面。The front-end development scaffolding tool 103 is used to generate the source code file obtained by the page editor 101 into a static page.
具体地,静态资源服务器104可以将计算机本地存储的静态资源文件导出至指定的静态资源服务器文件目录下,前端开发脚手架工具103根据静态资源文件生成静态页面。Specifically, the static resource server 104 may export the static resource files stored locally on the computer to a specified file directory of the static resource server, and the front-end development scaffolding tool 103 generates static pages according to the static resource files.
静态资源服务器104,用于从页面编辑器101获取更新后的静态页面,存储更新后的静态页面,并生成更新后的静态页面对应的访问链接。The static resource server 104 is configured to obtain an updated static page from the page editor 101, store the updated static page, and generate an access link corresponding to the updated static page.
具体地,在存储静态页面时,可以使用扫描工具对静态页面中的内容节点进行扫描,并为每一个内容节点赋予一个唯一的标志符,根据扫描情况生成一份扁平化的键值对数据,键值对数据一一对应的存储节点标志符和节点内容,从而形成一份静态资源文件,并将静态资源文件存储在静态资源服务器104中。Specifically, when storing a static page, you can use a scanning tool to scan the content nodes in the static page, and assign a unique identifier to each content node, and generate a flattened key-value pair data according to the scanning situation. The key-value pair data stores the node identifier and node content in one-to-one correspondence, thereby forming a static resource file, and storing the static resource file in the static resource server 104 .
其中,扫描工具可以为NodeJS的解析脚本工具,还可以是解析html文件并生成DOM结构的工具,本实施例不限定扫描工具的类型。Wherein, the scanning tool may be an analysis script tool of NodeJS, and may also be a tool for analyzing an html file and generating a DOM structure. This embodiment does not limit the type of the scanning tool.
在一种可选的实施例中,如图2所示,内容管理系统中的页面编辑器101为GUI编辑工具,版本管理系统102为git,前端开发脚手架工具103为webpack工具,静态资源服务器104为云服务器,通过webpack打包工具对源码文件进行打包,构建一份静态页面,GUI编辑工具可以对静态页面进行编辑,并生成更新的静态页面,GUI编辑工具还可以将更新的静态页面同步至云服务器,GUI编辑工具与git可以通过NodeJ执行Git命令,实现静态页面对应的源码的更新。In an optional embodiment, as shown in Figure 2, the page editor 101 in the content management system is a GUI editing tool, the version management system 102 is git, the front-end development scaffolding tool 103 is a webpack tool, and the static resource server 104 For the cloud server, use the webpack packaging tool to package the source code files to build a static page. The GUI editing tool can edit the static page and generate an updated static page. The GUI editing tool can also synchronize the updated static page to the cloud. The server, GUI editing tools and git can execute Git commands through NodeJ to update the source code corresponding to the static page.
本申请实施例提供的内容管理系统,采用页面编辑器101,用于获取源码文件, 展示由源码文件生成的静态页面,并响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面以及更新后的源码文件,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;版本管理系统102,用于从代码仓库获取源码文件,并将源码文件发送至页面编辑器101,还用于从页面编辑器101获取更新后的源码文件,并将更新后的源码文件发送至代码仓库;前端开发脚手架工具103,用于将页面编辑器101获取的源码文件生成为静态页面;静态资源服务器104,用于从页面编辑器101获取更新后的静态页面,存储更新后的静态页面,并生成更新后的静态页面对应的访问链接,解决了相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题。通过节点标志符关联节点内容数据的方式存储静态资源,可以对静态页面中的节点关联的节点内容数据进行修改达到修改静态页面的目的,进而达到了提高管理静态页面的灵活性、降低对数据模型依赖性的效果。The content management system provided by the embodiment of the present application adopts the page editor 101 to obtain the source code file, display the static page generated by the source code file, and modify the node associated with the target node in response to the editing operation of the target node in the static page content data, to obtain the updated static page and the updated source code file, wherein, the static page is associated with a key-value pair data set of node identifier and node content; the version management system 102 is used to obtain the source code file from the code warehouse , and send the source code file to the page editor 101, and also be used to obtain the updated source code file from the page editor 101, and send the updated source code file to the code warehouse; the front-end development scaffolding tool 103 is used to edit the page The source code file obtained by the editor 101 is generated as a static page; the static resource server 104 is used to obtain the updated static page from the page editor 101, store the updated static page, and generate an access link corresponding to the updated static page to solve The problem of over-reliance on the data model when managing the content of the static page in the related art is solved. Static resources are stored in the way of linking node content data with node identifiers, and the node content data associated with nodes in static pages can be modified to achieve the purpose of modifying static pages, thereby improving the flexibility of managing static pages and reducing the need for data models. The effect of dependence.
可选地,在本申请实施例提供的内容管理系统中,静态资源服务器104为云服务器,云服务器存储更新后的静态页面,并生成更新后的静态页面对应的访问路径。Optionally, in the content management system provided in the embodiment of the present application, the static resource server 104 is a cloud server, and the cloud server stores updated static pages and generates an access path corresponding to the updated static pages.
具体地,静态资源服务器104为当前云厂商提供的具有云存储功能的云服务器,此外,还也可以由开发人员自己开发服务器程序处理请求和响应,并将程序部署在相应的服务器上。Specifically, the static resource server 104 is a cloud server with a cloud storage function provided by the current cloud provider. In addition, developers can also develop server programs to process requests and responses, and deploy the programs on corresponding servers.
需要说明的是,对于云存储功能,可以在云服务器上存储静态页面并生成访问链接,根据相对的文件路径及页面内的跳转关系,实现页面间的跳转,并展示对应的静态页面,无需专门的处理浏览器的响应,其中,页面之前的相对路径和本地之间的相对路径是类似的,例如:一个文件夹被放到了云服务器上,文件夹中有1.html、2.html、3.html三个文件,通过www.test.com这个网址可以访问到云上的这个文件夹,当需要访问1.html时只需要修改访问www.test.com/1.html,访问2.html、2.html和1.html同理。It should be noted that for the cloud storage function, static pages can be stored on the cloud server and access links can be generated, and the jump between pages can be realized according to the relative file path and the jump relationship in the page, and the corresponding static page can be displayed. There is no need to deal with the browser's response specifically, where the relative path before the page is similar to the relative path between the local, for example: a folder is placed on the cloud server, and there are 1.html and 2.html in the folder , 3.html three files, you can access this folder on the cloud through the website www.test.com, when you need to access 1.html, you only need to modify and access www.test.com/1.html, access 2. html, 2.html and 1.html are the same.
需要说明的是,云存储功能的使用需要安装COSCMD工具,在当前计算机用户的文件目录下,配置云服务器的桶(Bucket)、区域(Region)、秘钥Key、秘钥ID,在配置完成后配合node的shell进程,调用命令行上传本地的文件夹以及文件到云服务器,上传的文件是指前面提到的要存放的静态资源;上传的文件夹包含了一个静态资源管理的所有代码,有NodeJS的部分也有静态资源图片、视频文字等的部分。其中,上传文件命令格式:coscmd upload<localpath><cospath>,上传文件夹命令格式:coscmd upload-r<localpath><cospath>。It should be noted that the use of the cloud storage function requires the installation of the COSCMD tool. In the file directory of the current computer user, configure the bucket (Bucket), region (Region), secret key, and secret key ID of the cloud server. After the configuration is complete, With the shell process of node, call the command line to upload local folders and files to the cloud server. The uploaded files refer to the static resources to be stored as mentioned above; the uploaded folder contains all the codes of a static resource management. The NodeJS part also has static resource pictures, video text and other parts. Among them, the command format for uploading files: coscmd upload<localpath><cospath>, the command format for uploading folders: coscmd upload-r<localpath><cospath>.
可选地,在本申请实施例提供的内容管理系统中,前端开发脚手架工具103对源码文件进行以下至少之一处理,得到静态页面:打包处理、压缩处理、页面内容注入处理;其中,打包处理用于检测源码文件对应的公共代码,并将公共代码对应的可视 化数据注入到静态页面的标记位置;压缩处理用于压缩源码文件中的空格数据和换行数据,并将大于预设长度的变量替换为目标长度的变量;页面内容注入处理用于将源码文件中的数据注入预设页面模板中。Optionally, in the content management system provided by the embodiment of the present application, the front-end development scaffolding tool 103 performs at least one of the following processes on the source code file to obtain a static page: packaging processing, compression processing, and page content injection processing; wherein, packaging processing It is used to detect the public code corresponding to the source code file, and inject the visual data corresponding to the public code into the mark position of the static page; the compression process is used to compress the space data and newline data in the source code file, and replace the variable larger than the preset length is the variable of the target length; the page content injection process is used to inject the data in the source code file into the preset page template.
具体地,前端开发脚手架工具103集成了源码文件的打包、压缩、混淆、热更新、页面内容自动注入的功能。Specifically, the front-end development scaffolding tool 103 integrates functions of source code file packaging, compression, obfuscation, hot update, and automatic page content injection.
需要说明的是,静态页面在源码开发阶段为了实现代码的复用,会提取出多个页面内相同的部分,例如顶部菜单栏,底部的地址栏,有些表单或侧边栏也会实现复用,这样在源码开发阶段就只用维护一份代码,无需重复改动。It should be noted that in order to achieve code reuse in the source code development stage of static pages, the same parts in multiple pages will be extracted, such as the top menu bar, the bottom address bar, and some forms or sidebars will also be reused , so that only one code needs to be maintained during the source code development stage, without repeated changes.
其中,前端开发脚手架工具103的打包和压缩功能在于可以在不同的页面检测到公共部分的注入代码片段,根据这一片段,将对应的公共部分注入到对应的目标位置,具体地,很多页面可能会有一个公共的头部或者底部,这些公共部分只需要维护一份,在其他的文件里用特殊方式标记或引入,在最后会把这些公共的部分注入到每一个标记的地方,并替换原有标记。Among them, the packaging and compression function of the front-end development scaffolding tool 103 is that it can detect the injected code fragments of the common part on different pages, and inject the corresponding public part into the corresponding target position according to this fragment. Specifically, many pages may There will be a public header or bottom, these public parts only need to maintain one copy, mark or import in other files in a special way, and finally inject these public parts into each marked place, and replace the original marked.
同时,前端开发脚手架工具103的打包功能也具备合并请求,将多个静态资源合并为一个的能力。而前端开发脚手架工具103的压缩和混淆功能主要是针对js脚本文件,压缩其中多余的空格和换行,替换代码中的冗长变量,比如,有些代码中变量命名为thisisatestname在经过脚手架工具的压缩后可以替换为一个a或b之类的缩写),从而实现较小文件的存储空间,节约传输带宽。At the same time, the packaging function of the front-end development scaffolding tool 103 also has the ability to merge requests and merge multiple static resources into one. The compression and obfuscation functions of the front-end development scaffolding tool 103 are mainly aimed at js script files, compressing redundant spaces and line breaks, and replacing redundant variables in the code. For example, the variable named thisisatestname in some codes can be compressed by the scaffolding tool Replace it with an abbreviation such as a or b), so as to achieve storage space for smaller files and save transmission bandwidth.
前端开发脚手架工具103的热更新是在静态页面开发调试时实时打包和刷新页面的能力,从而提高了开发和调试的效率。The hot update of the front-end development scaffolding tool 103 is the ability to package and refresh pages in real time during static page development and debugging, thereby improving the efficiency of development and debugging.
前端开发脚手架工具103的页面内容的自动注入是指脚手架工具可以匹配页面中特殊字符串,进行模板注入或模板替换的能力,特殊字符可以自己定义或者配置,例如<%这里要注入%>,就会匹配<%和%>以及其中的内容,并替换。The automatic injection of the page content of the front-end development scaffolding tool 103 refers to the ability of the scaffolding tool to match special strings in the page to perform template injection or template replacement. Will match <% and %> and the contents of them, and replace.
前端开发脚手架工具103的模板注入由webpack的插件可以实现,最简单的就是匹配一段目标字符串,然后根据这段字符串中匹配获得的信息去找目标内容,再读取目标内容进行替换,该功能打包出的静态页面在特定的内容处会有特殊的标签进行标识和定位,其生成的页面会配合页面编辑预览的GUI工具实现编辑内容的定位和逆向定位对应内容在源码位置的能力。The template injection of the front-end development scaffolding tool 103 can be realized by the plug-in of webpack. The simplest method is to match a target string, then find the target content according to the information obtained by matching in this string, and then read the target content for replacement. The static pages packaged with functions will have special tags for identification and positioning at specific content, and the generated pages will cooperate with the GUI tool for page editing and preview to realize the positioning of edited content and the ability to reverse locate the corresponding content in the source code location.
在一种可选的实施例中,前端开发脚手架工具103是Webpack,静态依赖的第三方样式和组件库是Bootstrap,使用html-loader处理多页面重复部分的模板复用问题。In an optional embodiment, the front-end development scaffolding tool 103 is Webpack, the statically dependent third-party style and component library is Bootstrap, and html-loader is used to deal with the template reuse problem of repeated parts of multiple pages.
其中,前端开发脚手架工具103生成的项目目录下包括多个文件夹,具体地,包 括config文件夹,config文件夹为打包构建静态页面文件的配置文件,这些配置文件指导webpack构建打包时的操作,包括公共模板的注入,js、css资源的合并打包,图片等多媒体资源的编码,html文件的模板处理;还包括dist文件夹,dist文件夹内的内容是打包构建完成之后的静态资源文件,也是预览和发布到静态资源服务器104上的静态资源文件内容还包括;还包括map文件夹,map文件夹内存储的json数据与static文件夹下html文件夹的目录结构一致,存储的是每一个html页面内的可编辑内容的json数据,json数据中存储的是dom节点的唯一标志符与内容的键值对数据,该文件在每次html文件更新时自动生成并更新(这一过程中使用的是cheerio对html文件进行node环境下的dom解析),在打包时会根据此文件夹下的映射数据替换html文件夹下对应节点的内容;还server文件夹,server文件夹内的文件用于处理页面编辑GUI的服务逻辑,包括代码仓库的操作、静态资源服务器104的资源同步操作、源码文件的改写操作;还包括static文件夹,static文件夹下存储这静态页面在开发阶段的源码,是用于生成最终构建打包的页面的最初来源;还包括webapp文件夹,webapp文件夹下存储着GUI的交互界面的源代码,当GUI界面启动时,此处的代码会被编译执行,并与server文件夹下的文件进行配合,对文件进行一系列的操作。Wherein, the project directory generated by the front-end development scaffolding tool 103 includes a plurality of folders, specifically, includes a config folder, and the config folder is a configuration file for packaging and constructing static page files. These configuration files guide webpack to build and package. Including the injection of public templates, the merging and packaging of js and css resources, the encoding of multimedia resources such as pictures, and the template processing of html files; it also includes the dist folder. The contents of the dist folder are static resource files after packaging and construction. The content of the static resource file previewed and published on the static resource server 104 also includes a map folder, the json data stored in the map folder is consistent with the directory structure of the html folder under the static folder, and each html file is stored. The json data of the editable content in the page. The json data stores the unique identifier of the dom node and the key-value pair data of the content. This file is automatically generated and updated every time the html file is updated (the process used Cheerio performs dom analysis on the html file in the node environment), and when packaging, it will replace the content of the corresponding node in the html folder according to the mapping data in this folder; return the server folder, and the files in the server folder are used for processing The service logic of the page editing GUI includes the operation of the code warehouse, the resource synchronization operation of the static resource server 104, and the rewriting operation of the source code file; it also includes the static folder, which stores the source code of the static page in the development stage under the static folder. It is used to generate the initial source of the final build and packaged page; it also includes the webapp folder, where the source code of the GUI interactive interface is stored under the webapp folder. When the GUI interface starts, the code here will be compiled and executed, and combined with the server file Cooperate with the files under the folder, and perform a series of operations on the files.
根据本申请的实施例,提供了一种静态页面的管理方法。According to an embodiment of the present application, a static page management method is provided.
图3是根据本申请实施例的静态页面的管理方法的流程图。如图3所示,该方法包括以下步骤:Fig. 3 is a flowchart of a static page management method according to an embodiment of the present application. As shown in Figure 3, the method includes the following steps:
步骤S302,获取源码文件,通过前端开发脚手架工具将源码文件生成为静态页面,并展示静态页面,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集。Step S302, obtain the source code file, generate the source code file as a static page through the front-end development scaffolding tool, and display the static page, wherein, the static page is associated with a data set of node identifier and node content key-value pair.
可以通过版本管理系统从代码仓库获取源码文件,并通过前端开发脚手架工具将源码文件打包成静态页面,同时生成静态页面的多个节点对应的节点标志符和节点内容数据,多对节点标志符和节点内容数据构成键值对数据。You can obtain source code files from the code warehouse through the version management system, and package the source code files into static pages through the front-end development scaffolding tool, and generate node identifiers and node content data corresponding to multiple nodes of the static page, and multiple pairs of node identifiers and node identifiers. Node content data constitutes key-value pair data.
需要说明的是,在开发出一套静态页面之后,可以进行整体资源的打包,打包后的静态资源文件会导出到项目对应的文件夹下,以供编辑预览的GUI web应用调用,在开发静态页面时,可以在需要编辑和修改的地方使用闭合标签包裹,并赋予标签class=”cms-editable”,在需要编辑的内容节点上注入一个特殊的标记,方便建立起节点和节点内容的映射数据,也便于在编辑时准确的定位到所标记的目标节点。It should be noted that after developing a set of static pages, the overall resources can be packaged, and the packaged static resource files will be exported to the corresponding folder of the project for calling by the GUI web application for editing and previewing. On the page, you can use the closed tag to wrap the place that needs to be edited and modified, and give the tag class="cms-editable", inject a special tag on the content node that needs to be edited, so as to facilitate the establishment of mapping data between nodes and node content , and it is also convenient to accurately locate the marked target node during editing.
步骤S304,响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面。Step S304, in response to the editing operation on the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page.
具体地,可以展示项目文件夹下的静态页面,点选需要编辑的静态页面后主界面会进行切换展示。使用鼠标的移动事件可以在鼠标移动时,实时的获取都鼠标悬停的 目标节点,双击鼠标,获取目标节点的聚焦,可以编辑对应节点的内容。上述操作具备所见即所得的特点,可以实时预览文案或者图片资源更新后的页面效果。Specifically, the static pages under the project folder can be displayed, and the main interface will switch and display after clicking the static page to be edited. Use the mouse movement event to obtain the target node that the mouse is hovering over in real time when the mouse is moving, double-click the mouse to obtain the focus of the target node, and edit the content of the corresponding node. The above operations have the characteristics of what you see is what you get, and you can preview the page effect after the copy or image resource is updated in real time.
步骤S306,根据更新后的静态页面更新源码文件,得到更新后的源码文件。Step S306, updating the source code file according to the updated static page to obtain the updated source code file.
可选地,在本申请实施例提供的静态页面的管理方法中,在根据更新后的静态页面更新源码文件,得到更新后的源码文件之前,该方法还包括:判断是否接收到对更新后的静态页面的确认指令,在接收到确认指令的情况下,执行根据更新后的静态页面更新源码文件,得到更新后的源码文件的步骤。Optionally, in the static page management method provided in the embodiment of the present application, before updating the source code file according to the updated static page to obtain the updated source code file, the method further includes: judging whether to receive the updated The confirmation instruction of the static page, in the case of receiving the confirmation instruction, executes the step of updating the source code file according to the updated static page to obtain the updated source code file.
需要说明的是,更新后的静态页面只是临时文件,只有在点击保存按钮后才,根据当前已经更新过的节点-节点内容的映射关系,去寻找源码对应的文件,在匹配到对应的文件后,会根据最新的内容会持久的更新源码数据,具体地,点击保存按钮后,获取鼠标的移动事件中聚焦的dom,在获取到dom的自定义属性map-id后,可以根据该值标识的关键字去map文件夹下对应的json文件中,将当前dom节点中的内容更新同步到该key对应的内容。It should be noted that the updated static page is only a temporary file, only after clicking the save button, according to the currently updated node-node content mapping relationship, to find the corresponding file of the source code, after matching the corresponding file , the source code data will be updated persistently according to the latest content. Specifically, after clicking the save button, the focused dom in the mouse movement event will be obtained. After obtaining the custom attribute map-id of the dom, it can be identified according to the value Keyword goes to the corresponding json file under the map folder, and the content update in the current dom node is synchronized to the content corresponding to the key.
本申请实施例提供的静态页面的管理方法,通过获取源码文件,通过前端开发脚手架工具将源码文件生成为静态页面,并展示静态页面,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面;根据更新后的静态页面更新源码文件,得到更新后的源码文件,解决了相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题。通过节点标志符关联节点内容数据的方式存储静态资源,可以对静态页面中的节点关联的节点内容数据进行修改达到修改静态页面的目的,进而达到了提高管理静态页面的灵活性、降低对数据模型依赖性的效果。The static page management method provided by the embodiment of the present application obtains the source code file, generates the source code file as a static page through the front-end development scaffolding tool, and displays the static page, wherein, the static page is associated with a node identifier and node content Key-value pair data set; respond to the editing operation of the target node in the static page, modify the node content data associated with the target node, and obtain the updated static page; update the source code file according to the updated static page, and obtain the updated source code file The invention solves the problem in the related art that the content of the static page is overly dependent on the data model. Static resources are stored in the way of linking node content data with node identifiers, and the node content data associated with nodes in static pages can be modified to achieve the purpose of modifying static pages, thereby improving the flexibility of managing static pages and reducing the need for data models. The effect of dependence.
可选地,在本申请实施例提供的静态页面的管理方法中,在根据更新后的静态页面更新源码文件,得到更新后的源码文件之后,该方法还包括:检测是否接收到针对更新后的静态页面的发布指令;在接收到发布指令的情况下,将更新后的静态页面同步至静态资源服务器。Optionally, in the static page management method provided in the embodiment of the present application, after updating the source code file according to the updated static page and obtaining the updated source code file, the method further includes: detecting whether the updated Publishing instruction of the static page; upon receiving the publishing instruction, synchronizing the updated static page to the static resource server.
具体地,在源码文件更新完毕后会主动的触发一次项目的打包操作,生成一份全新的项目文件夹,可以在GUI工具内进行预览操作,该操作模拟了发布到静态资源服务器上的界面。在确认无误后,用户可点击发布按钮,触发代码仓库的提交操作,将本次的修改记录存入代码仓库的版本管理系统之中,在提交完毕源码后,GUI工具会将项目中项目文件夹下的静态页面通过静态资源服务器的接口同步至静态资源服务器指定的文件夹下,实现静态页面的发布。Specifically, after the source code file is updated, it will actively trigger a project packaging operation to generate a brand new project folder, which can be previewed in the GUI tool. This operation simulates the interface published to the static resource server. After confirming that it is correct, the user can click the release button to trigger the submission operation of the code warehouse, and store the modification record in the version management system of the code warehouse. After submitting the source code, the GUI tool will save the project folder in the project The static pages under the static resource server are synchronized to the folder specified by the static resource server through the interface of the static resource server to realize the publishing of the static pages.
由于网络异常的情况时有发生,存在静态页面发布失败的情况下,可选地,在本 申请实施例提供的静态页面的管理方法中,在接收到发布指令的情况下,将更新后的静态页面同步至静态资源服务器之后,该方法还包括:接收发布指令对应的反馈信息,并根据反馈信息判断更新后的静态页面是否发布成功;在发布失败的情况下,通过版本管理系统获取更新后的静态页面的上一版本的源码文件,得到目标源码文件;通过前端开发脚手架工具生成目标源码文件对应的静态页面,得到待检测的静态页面;响应对待检测的静态页面的编辑操作,修改待检测的静态页面关联的内容数据,得到目标静态页面,并根据目标静态页面更新目标源码文件。Due to the occurrence of network exceptions from time to time, when there is a static page publishing failure, optionally, in the static page management method provided in the embodiment of the present application, when the release instruction is received, the updated static page After the page is synchronized to the static resource server, the method further includes: receiving feedback information corresponding to the publishing instruction, and judging whether the updated static page is successfully published according to the feedback information; if the publishing fails, obtaining the updated static page through the version management system Obtain the target source code file from the source code file of the previous version of the static page; generate the static page corresponding to the target source code file through the front-end development scaffolding tool, and obtain the static page to be detected; respond to the editing operation of the static page to be detected, and modify the static page to be detected The content data associated with the static page is obtained to obtain the target static page, and the target source code file is updated according to the target static page.
具体地,在静态页面发布之后,可以移步至正式发布的网址去再次检查页面内容的更新状况,在发生意外状况时,发布网站还可以向GUI工具发出通知消息,GUI工具通过版本切换的功能进行页面代码的回滚操作,具体地,通过版本管理系统获取静态页面对应的源码文件,生成待检测的静态页面,修改待检测的静态页面关联的内容数据,得到修改后的静态页面,从而根据修改后的静态页面更新源码文件,实现源码文件的回滚。Specifically, after the static page is released, you can move to the officially released website to check the update status of the page content again. When an unexpected situation occurs, the publishing website can also send a notification message to the GUI tool. The GUI tool uses the function of version switching Perform the rollback operation of the page code, specifically, obtain the source code file corresponding to the static page through the version management system, generate the static page to be detected, modify the content data associated with the static page to be detected, and obtain the modified static page, thereby according to The modified static page updates the source code file to realize the rollback of the source code file.
根据本申请的实施例,还提供了另一种静态页面的管理方法。According to the embodiment of the present application, another static page management method is also provided.
第一步:使用脚手架工具按照预设的文件内容和文件结构生成项目的文件目录。Step 1: Use the scaffolding tool to generate the file directory of the project according to the preset file content and file structure.
第二步:安装项目依赖的所有的第三方插件:webpack、nodeGit、bootstrap、coscmd、cheerio等。Step 2: Install all third-party plug-ins that the project depends on: webpack, nodeGit, bootstrap, coscmd, cheerio, etc.
第三步:开发静态页面,在开发静态页面的过程中,在需要编辑和修改的地方使用闭合标签包裹,并赋予标签class=”cms-editable”,这样做的目的是在与可以在需要编辑的内容节点上注入一个特殊的标记,方便建立起节点和节点内容的映射数据,同时也便于在编辑时准确的定位到所标记的目标节点。Step 3: Develop a static page. In the process of developing a static page, use a closed tag to wrap the place that needs to be edited and modified, and assign the tag class="cms-editable". The purpose of this is to be able to edit when needed A special mark is injected into the content node of the content node, which is convenient for establishing the mapping data of the node and the node content, and at the same time, it is convenient for accurately locating the marked target node when editing.
第四步:编辑预览,在开发出一套静态页面之后,可以进行整体资源的打包,打包后的静态资源文件会导出到项目的文件夹下,同时运行脚本,开启编辑预览的GUI web应用。Step 4: Edit and preview. After developing a set of static pages, you can package the overall resources. The packaged static resource files will be exported to the project folder, and run the script at the same time to open the GUI web application for editing and previewing.
GUI web应用启动后,会展示项目文件夹下的静态页面,点选需要编辑的静态页面后主界面会进行切换展示。使用鼠标的mouseover事件可以在鼠标移动时,实时的获取都鼠标悬停的目标节点,双击鼠标,获取目标节点的聚焦,既可以编辑对应节点的内容。该操作具备所见即所得的特点,可以实时预览到文案或者图片资源更新后的页面效果。但是这些只是临时文件,只有在点击保存按钮后才会持久的更新源码数据。After the GUI web application is started, the static pages under the project folder will be displayed. After clicking the static page to be edited, the main interface will be switched and displayed. Use the mouseover event of the mouse to obtain the target node that the mouse is hovering over in real time when the mouse is moving, double-click the mouse to obtain the focus of the target node, and edit the content of the corresponding node. This operation has the characteristics of what you see is what you get, and you can preview the page effect after the copy or image resource is updated in real time. But these are only temporary files, and the source code data will be permanently updated only after clicking the save button.
第五步:更新源码,并触发打包操作。在GUI工具上点击保存后,GUI会根据当前已经更新过的节点-节点内容的映射关系,去寻找源码对应的文件,在匹配到对应的文件后,会根据最新的内容更新源码文件。Step 5: Update the source code and trigger the packaging operation. After clicking Save on the GUI tool, the GUI will search for the file corresponding to the source code according to the currently updated node-node content mapping relationship. After matching the corresponding file, it will update the source code file according to the latest content.
需要说明的是,在源码文件更新完毕后会主动的触发一次项目的打包操作,生成一份全新的项目文件夹,此时可以在GUI工具内进行预览操作,该操作模拟了发布到静态资源服务器上的界面。在确认无误后,用户可点击发布按钮。该按钮会触发代码仓库的提交操作,本次的修改记录就存入代码仓库的版本管理系统之中。在提交完毕后,GUI工具会将项目中项目文件夹下的静态资源通过静态资源服务器的接口同步至静态资源服务器指定的文件夹下。It should be noted that after the source code file is updated, it will actively trigger a project packaging operation to generate a brand new project folder. At this time, the preview operation can be performed in the GUI tool. This operation simulates publishing to a static resource server on the interface. After confirming that it is correct, the user can click the publish button. This button will trigger the commit operation of the code warehouse, and the modification record of this time will be stored in the version management system of the code warehouse. After the submission is complete, the GUI tool will synchronize the static resources under the project folder in the project to the folder specified by the static resource server through the interface of the static resource server.
第六步:移步至正式发布的网址去再次检查页面内容的更新状况,在发生意外状况时,通过GUI工具的版本切换的功能进行页面代码的回滚操作。Step 6: Move to the officially released website to check the update status of the page content again. In case of an unexpected situation, use the version switching function of the GUI tool to perform the rollback operation of the page code.
具体地,图4是根据本申请实施例的静态页面的管理方法中进行页面代码的回滚操作流程图,如图4所示,进行页面代码的回滚操作包括以下步骤:Specifically, FIG. 4 is a flow chart of the rollback operation of the page code in the static page management method according to the embodiment of the present application. As shown in FIG. 4 , the rollback operation of the page code includes the following steps:
Node Git获取git提交的日志,并进行版本的切换,判断是否执行检测的操作,在使得情况下,拉取目标版本源码,并触发脚手架工具的打包重建工作,对静态资源进行打包。进一步的,GUI定本地node服务,页面自动刷新至最新版本,用户可以在GUI界面上编辑本案内容,显示编辑后的页面,还可以保存编辑后的页面。在保存之后,根据页面对应的节点键值对数据更新仓库源码,并触发脚手架工具的打包构建操作,同时,启动预览服务器,预览项目目录下的静态文件,并进行页面的发布。在页面发布之后,Node Git提交当前版本的修改,COSCMD上传项目文件和文件夹。Node Git obtains the log submitted by git, switches the version, and judges whether to perform the detection operation. If so, pulls the source code of the target version, and triggers the packaging and reconstruction work of the scaffolding tool to package the static resources. Furthermore, the GUI defines the local node service, and the page is automatically refreshed to the latest version. The user can edit the content of the case on the GUI interface, display the edited page, and save the edited page. After saving, update the warehouse source code according to the node key-value pair data corresponding to the page, and trigger the packaging and building operation of the scaffolding tool. At the same time, start the preview server, preview the static files in the project directory, and publish the page. After the page is published, Node Git commits the changes to the current version, and COSCMD uploads the project files and folders.
通过本实施例,一方面通过整合GIT、webpack、nodeJS等技术和工具,实现静态页面内容管理的前端化,轻量化,摆脱数据内容管理系统对服务器程序及数据库的依赖,另一方面,针对页面上任意的可编辑节点进行可视化的编辑,实现可视化的实时编辑和预览静态页面资源,提高了维护的效率,此外开发人员开发静态页面无需二次重构,一次开发即可使用,静态页面资源发布,路径实体清晰,有利于搜索引擎的优化。Through this embodiment, on the one hand, by integrating GIT, webpack, nodeJS and other technologies and tools, the front-end and lightweight of static page content management can be realized, and the data content management system can get rid of the dependence on server programs and databases; Any editable node can be visually edited to realize visual real-time editing and preview of static page resources, which improves the efficiency of maintenance. In addition, developers do not need to refactor secondary development of static pages, and they can be used after one development. Static page resources are released , the path entity is clear, which is conducive to search engine optimization.
需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that the steps shown in the flowcharts of the accompanying drawings may be performed in a computer system, such as a set of computer-executable instructions, and that although a logical order is shown in the flowcharts, in some cases, The steps shown or described may be performed in an order different than here.
本申请实施例还提供了一种静态页面的管理装置,需要说明的是,本申请实施例的静态页面的管理装置可以用于执行本申请实施例所提供的用于静态页面的管理方法。以下对本申请实施例提供的静态页面的管理装置进行介绍。The embodiment of the present application also provides a static page management device. It should be noted that the static page management device in the embodiment of the present application can be used to execute the static page management method provided in the embodiment of the present application. The static page management apparatus provided by the embodiment of the present application is introduced below.
图5是根据本申请实施例的静态页面的管理装置的示意图。如图5所示,该装置包括:第一获取单元501、第一响应单元502和更新单元503。Fig. 5 is a schematic diagram of an apparatus for managing static pages according to an embodiment of the present application. As shown in FIG. 5 , the device includes: a first acquiring unit 501 , a first responding unit 502 and an updating unit 503 .
具体地,第一获取单元501,用于获取源码文件,通过前端开发脚手架工具将源 码文件生成为静态页面,并展示静态页面,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;Specifically, the first obtaining unit 501 is used to obtain the source code file, generate the source code file as a static page through the front-end development scaffolding tool, and display the static page, wherein the static page is associated with a node identifier and a key value of the node content to the dataset;
第一响应单元502,用于响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面;The first response unit 502 is configured to respond to an editing operation on the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page;
更新单元503,用于根据更新后的静态页面更新源码文件,得到更新后的源码文件。The updating unit 503 is configured to update the source code file according to the updated static page to obtain the updated source code file.
可选地,在本申请实施例提供的静态页面的管理装置中,该装置还包括:检测单元,用于在更新单元503根据更新后的静态页面更新源码文件,得到更新后的源码文件之后,检测是否接收到针对更新后的静态页面的发布指令;同步单元,用于在检测单元检测出接收到发布指令的情况下,将更新后的静态页面同步至静态资源服务器。Optionally, in the static page management device provided in the embodiment of the present application, the device further includes: a detection unit, configured to update the source code file according to the updated static page by the updating unit 503 and obtain the updated source code file, Detect whether a posting instruction for the updated static page is received; a synchronization unit is configured to synchronize the updated static page to the static resource server when the detection unit detects that the posting instruction is received.
可选地,在本申请实施例提供的静态页面的管理装置中,该装置还包括:接收单元,用于在同步单元将更新后的静态页面同步至静态资源服务器之后,接收发布指令对应的反馈信息,并根据反馈信息判断更新后的静态页面是否发布成功;第二获取单元,用于在发布失败的情况下,通过版本管理系统获取更新后的静态页面的上一版本的源码文件,得到目标源码文件;生成单元,用于通过前端开发脚手架工具生成目标源码文件对应的静态页面,得到待检测的静态页面;第二响应单元,用于响应对待检测的静态页面的编辑操作,修改待检测的静态页面关联的内容数据,得到目标静态页面,并根据目标静态页面更新目标源码文件。Optionally, in the static page management device provided in the embodiment of the present application, the device further includes: a receiving unit, configured to receive the feedback corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server information, and judge whether the updated static page is released successfully according to the feedback information; the second acquisition unit is used to obtain the source code file of the previous version of the updated static page through the version management system to obtain the target The source code file; the generation unit is used to generate the static page corresponding to the target source code file through the front-end development scaffolding tool to obtain the static page to be detected; the second response unit is used to respond to the editing operation of the static page to be detected and modify the static page to be detected The content data associated with the static page is obtained to obtain the target static page, and the target source code file is updated according to the target static page.
可选地,在本申请实施例提供的静态页面的管理装置中,该装置还包括:判断单元,用于在更新单元503根据更新后的静态页面更新源码文件,得到更新后的源码文件之前,判断是否接收到对更新后的静态页面的确认指令;执行单元,用于在接收到确认指令的情况下,执行根据更新后的静态页面更新源码文件,得到更新后的源码文件的步骤。Optionally, in the static page management device provided in the embodiment of the present application, the device further includes: a judging unit, configured to update the source code file according to the updated static page before the updating unit 503 obtains the updated source code file, Judging whether a confirmation instruction for the updated static page is received; the execution unit is configured to execute the step of updating the source code file according to the updated static page to obtain the updated source code file when the confirmation instruction is received.
本申请实施例提供的静态页面的管理装置,通过第一获取单元501获取源码文件,通过前端开发脚手架工具将源码文件生成为静态页面,并展示静态页面,其中,静态页面关联了一份节点标志符和节点内容的键值对数据集;第一响应单元502响应对静态页面中的目标节点的编辑操作,修改目标节点关联的节点内容数据,得到更新后的静态页面;更新单元503根据更新后的静态页面更新源码文件,得到更新后的源码文件。解决了相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题,通过节点标志符关联节点内容数据的方式存储静态资源,可以对静态页面中的节点关联的节点内容数据进行修改达到修改静态页面的目的,进而达到了提高管理静态页面的灵活性、降低对数据模型依赖性的效果。The static page management device provided by the embodiment of the present application obtains the source code file through the first acquisition unit 501, generates the source code file as a static page through the front-end development scaffolding tool, and displays the static page, wherein the static page is associated with a node symbol The key-value pair data set of symbols and node content; the first response unit 502 responds to the edit operation of the target node in the static page, modifies the node content data associated with the target node, and obtains the updated static page; the update unit 503 according to the updated The source code file of the static page is updated to obtain the updated source code file. It solves the problem of high reliance on the data model when managing the content of static pages in related technologies, stores static resources through node identifiers associated with node content data, and can modify the node content data associated with nodes in static pages The purpose of modifying the static page is achieved, thereby achieving the effect of improving the flexibility of managing the static page and reducing the dependence on the data model.
上述静态页面的管理装置包括处理器和存储器,上述第一获取单元501、第一响应单元502和更新单元503等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The static page management device includes a processor and a memory, and the above-mentioned first acquisition unit 501, first response unit 502, and update unit 503 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to achieve the corresponding functions.
处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来解决相关技术中对静态页面的内容进行管理时对数据模型依赖过高的问题。The processor includes a kernel, and the kernel fetches corresponding program units from the memory. One or more kernels can be set, and the problem of excessive dependence on the data model in the management of static page content in related technologies can be solved by adjusting kernel parameters.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。Memory may include non-permanent memory in computer-readable media, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory including at least one memory chip.
本申请实施例还提供了一种非易失性存储介质,非易失性存储介质包括存储的程序,其中,程序运行时控制非易失性存储介质所在的设备执行一种静态页面的管理方法。The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute a static page management method .
本申请实施例还提供了一种电子装置,包含处理器和存储器;存储器中存储有计算机可读指令,处理器用于运行计算机可读指令,其中,计算机可读指令运行时执行一种静态页面的管理方法。本文中的电子装置可以是服务器、PC、PAD、手机等。The embodiment of the present application also provides an electronic device, including a processor and a memory; computer-readable instructions are stored in the memory, and the processor is used to run the computer-readable instructions, wherein, when the computer-readable instructions are running, a static page Management method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, and the like.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计 算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. The memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, 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, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (13)

  1. 一种内容管理系统,其特征在于,包括:A content management system, characterized by comprising:
    页面编辑器,用于获取源码文件,展示由所述源码文件生成的静态页面,并响应对所述静态页面中的目标节点的编辑操作,修改所述目标节点关联的节点内容数据,得到更新后的静态页面以及更新后的源码文件,其中,所述静态页面关联了一份节点标志符和节点内容的键值对数据集;The page editor is used to obtain the source code file, display the static page generated by the source code file, and respond to the editing operation on the target node in the static page, modify the node content data associated with the target node, and obtain the updated The static page and the updated source code file, wherein the static page is associated with a node identifier and a key-value pair data set of node content;
    版本管理系统,用于从代码仓库获取所述源码文件,并将所述源码文件发送至所述页面编辑器,还用于从所述页面编辑器获取所述更新后的源码文件,并将所述更新后的源码文件发送至所述代码仓库;The version management system is used to obtain the source code file from the code repository, and send the source code file to the page editor, and is also used to obtain the updated source code file from the page editor, and send the source code file to the page editor. Send the updated source code files to the code warehouse;
    前端开发脚手架工具,用于将所述页面编辑器获取的所述源码文件生成为所述静态页面;A front-end development scaffolding tool for generating the source code file obtained by the page editor as the static page;
    静态资源服务器,用于从所述页面编辑器获取所述更新后的静态页面,存储所述更新后的静态页面,并生成所述更新后的静态页面对应的访问链接。The static resource server is configured to obtain the updated static page from the page editor, store the updated static page, and generate an access link corresponding to the updated static page.
  2. 根据权利要求1所述的内容管理系统,其特征在于,The content management system according to claim 1, wherein:
    所述静态资源服务器为云服务器,所述云服务器存储所述更新后的静态页面,并生成所述更新后的静态页面对应的访问路径。The static resource server is a cloud server, and the cloud server stores the updated static page and generates an access path corresponding to the updated static page.
  3. 根据权利要求1所述的内容管理系统,其特征在于,The content management system according to claim 1, wherein:
    所述前端开发脚手架工具对所述源码文件进行以下至少之一处理,得到所述静态页面:打包处理、压缩处理、页面内容注入处理;The front-end development scaffolding tool performs at least one of the following processes on the source code file to obtain the static page: packaging processing, compression processing, and page content injection processing;
    其中,所述打包处理用于检测所述源码文件对应的公共代码,并将所述公共代码对应的可视化数据注入到所述静态页面的标记位置;Wherein, the packaging process is used to detect the public code corresponding to the source code file, and inject the visualization data corresponding to the public code into the marked position of the static page;
    所述压缩处理用于压缩所述源码文件中的空格数据和换行数据,并将大于预设长度的变量替换为目标长度的变量;The compression process is used to compress space data and newline data in the source code file, and replace variables larger than a preset length with variables of a target length;
    所述页面内容注入处理用于将所述源码文件中的数据注入预设页面模板中。The page content injection process is used to inject the data in the source code file into the preset page template.
  4. 一种静态页面的管理方法,其特征在于,包括:A method for managing static pages, characterized by comprising:
    获取源码文件,通过前端开发脚手架工具将所述源码文件生成为静态页面,并展示所述静态页面,其中,所述静态页面关联了一份节点标志符和节点内容的键值对数据集;Obtaining the source code file, generating the source code file as a static page through a front-end development scaffolding tool, and displaying the static page, wherein the static page is associated with a node identifier and a key-value pair data set of node content;
    响应对所述静态页面中的目标节点的编辑操作,修改所述目标节点关联的节点内容数据,得到更新后的静态页面;Responding to an editing operation on the target node in the static page, modifying node content data associated with the target node to obtain an updated static page;
    根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件。The source code file is updated according to the updated static page to obtain the updated source code file.
  5. 根据权利要求4所述的方法,其特征在于,在根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件之后,所述方法还包括:The method according to claim 4, characterized in that, after updating the source code file according to the updated static page and obtaining the updated source code file, the method further comprises:
    检测是否接收到针对所述更新后的静态页面的发布指令;Detecting whether a release instruction for the updated static page is received;
    在接收到所述发布指令的情况下,将所述更新后的静态页面同步至静态资源服务器。When the publishing instruction is received, the updated static page is synchronized to the static resource server.
  6. 根据权利要求5所述的方法,其特征在于,在接收到所述发布指令的情况下,将所述更新后的静态页面同步至所述静态资源服务器之后,所述方法还包括:The method according to claim 5, characterized in that, after receiving the release instruction, after synchronizing the updated static page to the static resource server, the method further comprises:
    接收所述发布指令对应的反馈信息,并根据所述反馈信息判断所述更新后的静态页面是否发布成功;receiving feedback information corresponding to the release instruction, and judging whether the updated static page is successfully released according to the feedback information;
    在发布失败的情况下,通过版本管理系统获取所述更新后的静态页面的上一版本的源码文件,得到目标源码文件;In the case of publishing failure, obtain the source code file of the previous version of the updated static page through the version management system to obtain the target source code file;
    通过所述前端开发脚手架工具生成所述目标源码文件对应的静态页面,得到待检测的静态页面;Generate the static page corresponding to the target source code file through the front-end development scaffolding tool to obtain the static page to be detected;
    响应对所述待检测的静态页面的编辑操作,修改所述待检测的静态页面关联的内容数据,得到目标静态页面,并根据所述目标静态页面更新所述目标源码文件。Responding to an editing operation on the static page to be detected, modifying content data associated with the static page to be detected to obtain a target static page, and updating the target source code file according to the target static page.
  7. 根据权利要求4所述的方法,其特征在于,在根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件之前,所述方法还包括:The method according to claim 4, wherein, before updating the source code file according to the updated static page and obtaining the updated source code file, the method further comprises:
    判断是否接收到对所述更新后的静态页面的确认指令;judging whether a confirmation instruction for the updated static page is received;
    在接收到所述确认指令的情况下,执行根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件的步骤。When the confirming instruction is received, execute the step of updating the source code file according to the updated static page to obtain an updated source code file.
  8. 一种静态页面的管理装置,其特征在于,包括:A management device for static pages, characterized by comprising:
    第一获取单元,用于获取源码文件,通过前端开发脚手架工具将所述源码文件生成为静态页面,并展示所述静态页面,其中,所述静态页面关联了一份节点标志符和节点内容的键值对数据集;The first obtaining unit is used to obtain the source code file, generate the source code file as a static page through the front-end development scaffolding tool, and display the static page, wherein the static page is associated with a node identifier and a node content key-value pair dataset;
    第一响应单元,用于响应对所述静态页面中的目标节点的编辑操作,修改所述目标节点关联的节点内容数据,得到更新后的静态页面;The first response unit is configured to respond to an editing operation on the target node in the static page, modify the node content data associated with the target node, and obtain an updated static page;
    更新单元,用于根据所述更新后的静态页面更新所述源码文件,得到更新后 的源码文件。An updating unit, configured to update the source code file according to the updated static page to obtain the updated source code file.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    检测单元,用于在所述更新单元根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件之后,检测是否接收到针对所述更新后的静态页面的发布指令;The detection unit is configured to detect whether a release instruction for the updated static page is received after the update unit updates the source code file according to the updated static page and obtains the updated source code file;
    同步单元,用于在所述检测单元检测出接收到所述发布指令的情况下,将所述更新后的静态页面同步至静态资源服务器。A synchronization unit, configured to synchronize the updated static page to a static resource server when the detection unit detects that the publishing instruction is received.
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:The device according to claim 9, wherein the device further comprises:
    接收单元,用于在所述同步单元将所述更新后的静态页面同步至所述静态资源服务器之后,接收所述发布指令对应的反馈信息,并根据所述反馈信息判断所述更新后的静态页面是否发布成功;a receiving unit, configured to receive feedback information corresponding to the release instruction after the synchronization unit synchronizes the updated static page to the static resource server, and judge the updated static page according to the feedback information Whether the page is published successfully;
    第二获取单元,用于在发布失败的情况下,通过版本管理系统获取所述更新后的静态页面的上一版本的源码文件,得到目标源码文件;The second obtaining unit is used to obtain the source code file of the previous version of the updated static page through the version management system to obtain the target source code file when the release fails;
    生成单元,用于通过所述前端开发脚手架工具生成所述目标源码文件对应的静态页面,得到待检测的静态页面;A generating unit, configured to generate a static page corresponding to the target source code file through the front-end development scaffolding tool, to obtain a static page to be detected;
    第二响应单元,用于响应对所述待检测的静态页面的编辑操作,修改所述待检测的静态页面关联的内容数据,得到目标静态页面,并根据所述目标静态页面更新所述目标源码文件。The second response unit is configured to respond to an editing operation on the static page to be detected, modify the content data associated with the static page to be detected, obtain a target static page, and update the target source code according to the target static page document.
  11. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    判断单元,用于在所述更新单元根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件之前,判断是否接收到对所述更新后的静态页面的确认指令;A judging unit, configured to judge whether a confirmation instruction for the updated static page is received before the updating unit updates the source code file according to the updated static page to obtain the updated source code file;
    执行单元,用于在接收到所述确认指令的情况下,执行根据所述更新后的静态页面更新所述源码文件,得到更新后的源码文件的步骤。The execution unit is configured to execute the step of updating the source code file according to the updated static page to obtain an updated source code file when the confirmation instruction is received.
  12. 一种非易失性存储介质,其特征在于,所非易失性存储介质用于存储程序,其中,所述程序运行时控制所述非易失性存储介质所在的设备执行权利要求4至7中任意一项所述的静态页面的管理方法。A non-volatile storage medium, characterized in that the non-volatile storage medium is used to store a program, wherein, when the program runs, the device where the non-volatile storage medium is located is controlled to execute claims 4 to 7 The management method of the static page described in any item.
  13. 一种电子装置,其特征在于,包含处理器和存储器,所述存储器中存储有计算机可读指令,所述处理器用于运行所述计算机可读指令,其中,所述计算机可读指 令运行时执行权利要求4至7中任意一项所述的静态页面的管理方法。An electronic device, characterized in that it includes a processor and a memory, the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions are executed when running The static page management method described in any one of claims 4 to 7.
PCT/CN2021/142611 2021-12-29 2021-12-29 Content management system, static page management method and device, and storage medium WO2023123089A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/142611 WO2023123089A1 (en) 2021-12-29 2021-12-29 Content management system, static page management method and device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/142611 WO2023123089A1 (en) 2021-12-29 2021-12-29 Content management system, static page management method and device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023123089A1 true WO2023123089A1 (en) 2023-07-06

Family

ID=86996886

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/142611 WO2023123089A1 (en) 2021-12-29 2021-12-29 Content management system, static page management method and device, and storage medium

Country Status (1)

Country Link
WO (1) WO2023123089A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032710A (en) * 2023-10-08 2023-11-10 思创数码科技股份有限公司 Flow form combination splitting method and system
CN117667076A (en) * 2023-12-06 2024-03-08 北京波士山信息技术有限公司 Cross-component message transfer method and system for dynamic page
CN118259891A (en) * 2024-05-31 2024-06-28 济南浪潮数据技术有限公司 VUE source code export method, equipment, program product and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155673A (en) * 2015-04-23 2016-11-23 阿里巴巴集团控股有限公司 Realize the method for content of pages editing machine, device, server and subscriber equipment
CN108694043A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 page decoration method and system
CN111414166A (en) * 2019-01-06 2020-07-14 阿里巴巴集团控股有限公司 Code generation method, device, equipment and storage medium
CN112416339A (en) * 2020-02-17 2021-02-26 上海哔哩哔哩科技有限公司 Page development method and device and computer equipment
US11119896B1 (en) * 2020-04-30 2021-09-14 Microsoft Technology Licensing, Llc Browser based visual debugging

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155673A (en) * 2015-04-23 2016-11-23 阿里巴巴集团控股有限公司 Realize the method for content of pages editing machine, device, server and subscriber equipment
CN108694043A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 page decoration method and system
CN111414166A (en) * 2019-01-06 2020-07-14 阿里巴巴集团控股有限公司 Code generation method, device, equipment and storage medium
CN112416339A (en) * 2020-02-17 2021-02-26 上海哔哩哔哩科技有限公司 Page development method and device and computer equipment
US11119896B1 (en) * 2020-04-30 2021-09-14 Microsoft Technology Licensing, Llc Browser based visual debugging

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032710A (en) * 2023-10-08 2023-11-10 思创数码科技股份有限公司 Flow form combination splitting method and system
CN117032710B (en) * 2023-10-08 2024-01-19 思创数码科技股份有限公司 Flow form combination splitting method and system
CN117667076A (en) * 2023-12-06 2024-03-08 北京波士山信息技术有限公司 Cross-component message transfer method and system for dynamic page
CN118259891A (en) * 2024-05-31 2024-06-28 济南浪潮数据技术有限公司 VUE source code export method, equipment, program product and medium

Similar Documents

Publication Publication Date Title
WO2023123089A1 (en) Content management system, static page management method and device, and storage medium
CN108984170B (en) H5 page multi-language rendering method and device
US8327351B2 (en) Application modification framework
US10901804B2 (en) Apparatus and method to select services for executing a user program based on a code pattern included therein
CN114329297A (en) Content management system, static page management method, device and storage medium
US10331423B1 (en) Utilizing cross platform streamable user interfaces to reduce software deployment frequency caused by user interface improvements
US9146841B2 (en) Proxy server assisted product testing
US11204789B2 (en) Graphical user interface for macro generation, modification, and verification
JP2011198354A (en) System and method for desktop application migration
US11119896B1 (en) Browser based visual debugging
US20230060787A1 (en) System and Method for Real-Time, Dynamic Creation, Delivery, and Use of Customizable Web Applications
JP2017504129A (en) Construction of a state expression represented in a web browser
US20120311522A1 (en) Repository based development using project development tools in enterprise management environment
CN118259906A (en) Multi-terminal page adaptation method, equipment and medium based on PaaS framework
Sarkis et al. A multi-screen refactoring system for video-centric web applications
CN113918198B (en) Model-code synchronization method
CN114168875A (en) Page program generation method and device, computer equipment and storage medium
US9858250B2 (en) Optimized read/write access to a document object model
CN111125565A (en) Method and equipment for inputting information in application
US20240361994A1 (en) System and Method for Real-Time, Dynamic Creation, Delivery, and Use of Customizable Web Applications
CN117251231B (en) Animation resource processing method, device and system and electronic equipment
US20240329983A1 (en) Development environment integrated with infrastructure cost estimation system
CN115509521A (en) Code generation method, device, equipment and readable storage medium
CA2872429A1 (en) An automated processor for web content to mobile-optimized content transformation
JP5673246B2 (en) Data store control device, data store control program, and data store control method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21969457

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE