How to Create a Sitemap in ↓markdown↓ CMS
The ↓markdown↓ Content Management System (CMS) comes with an HTML website index and XML site map generator. Any pages added to a website built using markdown CMS are automatically seen in the full website index. This indexing includes functionality to generate the XML site map file (sitemap.xml). Note: The web server process must have write access to the website's document root directory to be able to create the XML site map file.
Terminology
Although site map is two words it is common to see it written without the space, i.e., sitemap because of the name of the data file, sitemap.xml. This XML site map file is used by web search providers, e.g., Google, Bing/Yahoo, and DuckDuckGo. They recommend you create a sitemap.xml file so that the structure of a website is correctly understood. This improves the site's listing in search results. In other words, making a site map data file is good for Search Engine Optimisation (SEO).
The default web page for a web address is called an index page. This is different from a full website index, which is used to display the full contents of a website, sometimes as an A to Z index listing. Entering a web address, e.g. example.com will cause the web server to look for an index.html file, this is an index page. But a full HTML website index would display all the contents available from example.com.
A sitemap.xml Generator and HTML Website Index for Free
The full HTML website index and sitemap.xml generator in ↓markdown↓ CMS is included for free. The indexing code automatically detects a new web page when it is created in, or added to, a ↓markdown↓ CMS-based website. To generate the HTML website index and sitemap.xml file the browser needs to be pointed at the md-sitemap.php file. The easiest way is a link from an existing web page.
In a Markdown text file use a Markdown/CommonMark link format to point to md-sitemap.php in the md directory of a ↓markdown↓ CMS website:
[Full Website Index](http://www.example.com/md/md-sitemap.php "All Our Pages")
Or:
[Full Website Index][1]
...
other text
...
[1]:http://www.example.com/md/md-sitemap.php "All Our Pages")
As an HTML anchor tag:
<a href="http://www.example.com/md/md-sitemap.php" title="All Our Pages">Full Website Index</a>
There is no restriction on the number of web pages listed in the HTML website index or sitemap.xml by the sitemap builder code. However, the possible unlimited pages are dependent upon the web server resources. For the sitemap.xml a new file is generated for each 50000 entries (named sitemap-x.xml where x starts at 1).
How to Create a Sitemap for a Website
For a newly installed ↓markdown↓ CMS website the sitemap.xml file will not exist. To generate sitemap.xml visit the md/md-sitemap.php page. This causes the full HTML website index to be displayed in the browser but also writes sitemap.xml to the root of the website. Once sitemap.xml has been generated it will not be generated again until it reaches a certain age. The default is one week old. To change the timescale for generating a new sitemap.xml edit the XML_SITEMAP_REFRESH setting in the *site-config.php file (default is -1 week, try -1 day, -1 month, etc.).
If the sitemap.xml needs to be updated before the automatic refresh simply log into the web server and delete it. Then visit the site index page (md/md-sitemap.php) to recreate a fresh sitemap.xml.
Write Permission for the Sitemap
The web page serving process on the web server may not have been set with write permissions for the website's directories. The website's files are normally stored in the website's public document directory on the web server. This public directory, also called the root folder, will be named something like public_html or httpdocs. Check with the hosting provider if it is not clear which folder is the website's root folder. If the site index or sitemap.xml file is not created then check the root folder has write permissions for the website serving application or process. This is normally done through the control panel of your website hosting package, e.g. Plesk or cPanel. In the control panel file manager, click on the root folder for the web files and check that write permission for the directory is enabled for the web-serving application. Your web hosting provider can provide help if required.
See Also
- For other articles on using ↓markdown↓ CMS see the post Build a Website from Scratch with ↓markdown↓ CMS.
- View the Tek Eye full Index for other articles.
Author:Daniel S. Fowler Published: Updated: