Files
blogger-nodejs/docs/CONFIG.md
deadvey 23744f4000 Bug fix and Document fix
Removed the string object from config.json as it's now all in the locale.
and I fixed data.getdata() to return an error code if the index is out of bounds, it now returns a 1.

Signed-off-by: deadvey <deadvey@deadvey.com>
2025-09-24 20:57:47 +01:00

5.2 KiB
Executable File

Configuration Documentation

Introduction

The configuration file is stored in a file called config.json, for an example, copy example-config.json to config.json (cp example-config.json config.json) and modify from there.
Currently all values in example-config.json are required, however I plan to add support for default values in the case of no value being set.
All options show an example configuartion value and the variable type + an explaination below it.

Technical configuration

name example value variable type explanation
site_url "https://example.com" String This value defines the url of your site, this used for the RSS feed to link back to post.
port 8080 Integer This value defines the port that you run the blog on. Don't change this value if you don't know what that means.
allow_signup true Boolean Defines weather new people should be allowed to signup.
timeline_length 20 Integer How many posts will be shown on the timeline (home page).
enable_hitcount true Boolean Enabling the hitcount (a number that represents the amount of front page loads (stored in hitcount.txt)) can slightly slow down loading of the front page.
charset "UTF-8" String This is the value in the tag in the html of all pages, you should not change this unless you know why.
root_path "/path/to/root/of/website" String Anything in this directory will be in the webroot, so put favicon.ico and anything else here.
data_storage "json" String JSON is currently the only supported format, but SQL is going to be added/is a work in progress
cache_data true Boolean Not caching data means you can edit the posts, users, comments etc, maunally and not have to restart the server, however, for large instances this is not reccomended as it takes longer to load the required data. Note: config.json always needs a restart

Basic Customisation

name example value variable type explanation
locale "en-GB" String Your locale, see /locales for a list of all locales (you can open a PR for a new translation too)
seperator "<hr/>" String By default, this will go inbetween posts and generally to seperate out content on pages.
site_name "Pete's Blogging Site!" String It's the name of your blog site, a human readable string.
site_description "Read my blogs!" String This is what %W represents; it's the description of your instance, a human readable string.
default_commenter_username "Anon" String Default commenter username if no username is inputted in comment submission.

Syndication

name example value variable type explanation
rss true Boolean Enable or Disable RSS feeds.
atom true Boolean Enable or Disable ATOM feeds.

Dates

Read more at date-fns

name example value variable type explanation
date_format "yyyy-MM-dd" String The format of date's on the website.
time_zone "+0000" String Your offset from UTC

Advanced Customisation

  • /views/* files are EJS files (used for formatting HTML) and can be editted to your liking, you might want to read the EJS docs for help.
  • "css": "body { background: red; }"
    String. Custom CSS to be applied to all pages, if you want more complex css, you can edit custom.css.
    You can also edit the custom.css file in the webroot, as by default this is linked in the global header.
  • You can create a file called custom.css in the webroot and that will be loaded as a style onto every page.

Custom Strings

  • You can edit all the strings on the site in /locales/<your-locale>.json