A sitemap is as crucial to planning a new website as a map is to planning a road trip. Without it, both your trip and the user's journey through your website could encounter unplanned and potentially unpleasant stops. A sitemap is a fundamental feature of your website’s search engine optimisation (SEO) strategy. So, whether you're building a website from scratch or planning an overhaul, a sitemap is essential, and this tool SitemapGen allows you to do the same without any hassle. If you are a techy, then you can use the programmable interface to generate sitemaps, or if not, the web version is always ready to help!
python setup.py install
.sitemapgen --help
. This command will show you the description of the library and the available options for using the command. For e.g.:sitemapgen --version
SitemapGen v0.9.5 - By Nalin Angrish.
sitemapgen --url <URL of website> --out <Path to output sitemap>
. The URL specified here should not be blocked by a firewall and should be a complete URL. For example:
localhost
would not be valid and you would have to use http://localhost
. If the output file specified does not exists, then it will be created. You can specify the output path as either a relative path to
the current working directory or even an absolute path.--url
would be specified as http://localhost:port
whereas, in the sitemap you might need to use a domain like http://www.example.com
. In such cases, you can provide another option to the command line arguments by adding: --disguise http://www.example.com
.
It is always prefered to use http
instead of https
to avoid any future issue with the SSL certificate installation. So, the tool will automatically use the http
versions of the sites.Generator
class that can be used to generate a sitemap of a given URL. This is an example of how to use the Generator class: