Enter Content Management > Sites Menu, click Create Select the button, fill in the basic information of the website, and click. Confirm Press the button to complete site creation.
Field Description: - Site Directory: The directory where site files are stored. This directory is created based on the chestnut.cms.resourceRoot configuration.
For example, if the configuration is set as follows: chestnut.cms.resourceRoot=D:/chestnut/wwwroot_release/, then the directories will be created during site creation: D:/chestnut/wwwroot_release/demo/.

Switch to our newly created site in the upper right corner. Double-click on the demo site we just created, or select it and click "OK" to switch sites.

Enter Content Management > Publishing Channels Menu, click Create Button, create a publishing channel. (Must be created after switching to the correct site.)
Explanation: The ârelease channelsâ refer to the directories where static files of the website are stored. Multiple release channels can be created in order to meet the requirements of different display formats on various devices. For example, one set of templates can be used for PC desktops, another set for mobile phones, and yet another set for mobile tablets. Additionally, a set of static files in JSON format can be created, which can be used by native apps to retrieve content data.

When creating a publishing channel, the system will chestnut.cms.resourceRoot Create a site publishing channel directory in the configuration directory to store publishing channel templates and related static resource files. Let's proceed. Content Management > Files Menu. To view information related to the siteâs files, please refer to the figure below:

Currently, there are 2 top-level directories related to this site: - The ChestnutCMS is a content management system for websites. It mainly stores files uploaded to the site within this directory. - The âdemo_pcâ is the directory we have created for storing the release channels. Within this directory, there are already some directories that are automatically created by the system. 1. template The directory is a fixed location for storing page templates. All page templates for the publishing channels must be placed in this directory. When creating a publishing channel, the system will create a default homepage template in this directory. index.template.htmlďź 2. include The directory is a fixed location where static files generated by the template are stored; 3. There are no strict requirements for the remaining directories. Generally, we place the static page files in the html directory, and the corresponding JavaScript, CSS, and image files in their respective directories.
We tried to do this. Content Management > Resources Upload an image under the menu. As shown in the following figure:

And then, we return back. Content Management > Files Let's take a look at the file directory structure in the menu. It can be seen that there are... demo More items have been added to the directory. resources/image/2023/07/16/ The directory contains the images that we just uploaded.

Enter Content Management > Sites Menu. Please go to the demo site we just created. You can see the configuration options for the publishing channel are displayed there. Desktop Regarding the configuration information, we have assigned a URL to the publishing channel. This serves as the access domain name for the publishing channel (specified in the template). ${Prefix} Obtain it.)
Parameter instructions: - URL: The domain name associated with the publishing channel. - Static File Types: The file extensions for static files generated during the publishing process, such as shtml. Default value: shtml. - Homepage Template: This is the template used to generate the static pages for the published channels. The static pages will be created based on this template and stored in the corresponding directory under the published channel. Default value: index.template.html
After setting the domain name URL for the publishing channel, click Save Save site information by clicking the button. Then click. Preview Click the button to view the site preview.

Since we are conducting local testing, the domain names of the sites cannot be resolved directly. Therefore, we need to configure the mapping relationships in the hosts file, so that we can perform local debugging more easily.
Take the Windows system as an example. Open the file. C:\Windows\System32\drivers\etc\hosts Please add the content shown in the red box below to the system:
Among them, www.demo.com is the domain name used for accessing the PC desktop publishing channel, while static.demo.com is the domain name used for accessing site resource files.

After the configuration is completed, we open the CMS command window and send a ping to www.demo.com and staticdemo.com. It can be seen that the IP addresses used in the pings are now 127.0.0.1.

For installing Nginx, please refer to the official documentation. Add the following Server configuration to the nginx.conf file. After making the changes, restart Nginx.
server {
listen 80;
server_name www.demo.com;
# Configure the PC site with the domain name www.demo.com to access the demo_pc directory.
location / {
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
root D:/dev/wwwroot_release/demo_pc;
index index.shtml index.html index.htm;
}
location ~ ^/(images|img|fonts|assets|js|css)/ {
root D:/dev/wwwroot_release/demo_pc;
expires 1d;
}
}
server {
listen 80;
server_name static.swikoon.com;
# The resource files uploaded in the backend should be accessed through a unified proxy to the demo directory.
location ~ ^/(resources)/ {
root D:/dev/wwwroot_release/demo;
expires 1d;
}
}
Click on the site editing page. Publish Homepage Buttons indicate successful publishing. We can check the publishing channel directory in the file management menu to see the directory where the content has been published. demo_pc The static files for the homepage have been generated. index.shtml

After the publication is completed, we open our browser and access the site. http://www.demo.com/
