Configuration File



As you have possibly already learnt, a Bestatic site can be configured using a config.yaml file. You cannot rename it to anything else; you cannot put it anywhere other than the root directory of your site; also, toml/json/etc. cannot be used here.

A sample config.yaml file is first provided below. This file was used to generate this website.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
siteURL: "https://example.org"  # Replace with the URL of your site; Please do not add a trailing slash
title: "Bestatic | The Best Static Site Generator!"
description: "A simple but powerful static-site generator that transforms markdown texts to webpages and blog"
theme: Simple
number_of_pages: 4  # Enter the number of blog pages to paginate blog posts
comments:
  enabled: true
  system: giscus # Enter "disqus" or "giscus" here.
  comment_system_id: "tatsatb/giscus-test"
rss_feed: true
homepage_type: default # Enter "default" or "list"
enable_inject_tag: true


Notes on config file:
  1. siteURL: Provide full base URL of your site; it can be https://example.org or https://example.github.io or https://example.netlify.app. Do NOT add a trailing slash. This siteURL parameter is important - Bestatic uses it to generate sitemap (sitemap.xml file; helpful for search engines to crawl your site), RSS feed (index.rss file), and search index (index.json file).

  2. title: Necessary field. As you should understand, you need to have a title for your website! This will go into site's metadata. If you have used bestatic quickstart, you had to input it on command line. You can always change it here (you have to surround with double quotation mark) and rebuild the site.

  3. description: Necessary field. As you should understand, you need to have a short description for your website! This will also go into site's metadata. If you have used bestatic quickstart, you had to input it on command line. You can always change it here (you have to surround it with double quotation mark) and rebuild the site.

  4. theme: Specify your theme name. This is also a necessary field (default theme value is "Amazing"). Bestatic cannot build your website properly (or at all) if a proper theme is not present at the themes folder. You can change the name of the active theme here or you can supply it with -t (or --theme) flag while building the website. For example, bestatic -t Simple will try to build website with "Simple" theme. You can download the themes from a GitHub repo, or simply create your own Bestatic theme.

  5. number_of_pages: Specify the number of list pages for your blog. You can skip this if your website does not have blog posts and contains only static pages.

  6. comments: You can use this to specify the comment system in your blog. Support for Disqus and Giscus are available by default, as mentioned before.

    To enable comments, under comments section of config.yaml, put enabled: true (You can also put enabled: false or delete the comments section altogether, if you prefer not to have comments in your blog, or prefer some other commenting system). Next, mention system: giscus or system: disqus and put comment_system_id: "GitHubUsername/repo" or comment_system_id: "DisqusShortName" accordingly there to enable commenting on your blog.

  7. rss_feed: You can set the value to "true" or "false", depending on whether you want Bestatic to generate an RSS feed for your blog. By default, if you have a blog, Bestatic generates RSS feed (served at siteURL/index.rss). To disable this, you should have rss_feed: false in your config.yaml file.

  8. homepage_type: You can set the value to "default" or "list". As the name suggest, default value is "default". If you have just a blog (like Wordpress/Blogger style blog), you may want your homepage to be just a list of blog posts. To achieve that, set homepage_type: list in your config.yaml file. To set a specific static page as homepage, keep the value to default and follow the instruction provided earlier.

  9. enable_inject_tag: This injects the meta name="generator" content="Bestatic" tag in the head section of your homepage (if not already provided by your theme). Default value is true and we request you to keep that.