Configuration tutorial
So you've downloaded blockpress and installed the files in a web directory. You have the default site welcome message displaying. You will of course want to customise this.
First make a copy of the config.json
and rename it local_config.json
. Whilst you could just edit the default config.json
, any changes would be overwritten on upgrade, whereas changes in your local_config.json
will always be preserved.
So a first look at the file might be daunting, especially if you aren't familiar with JSON format. If you are there are some fields that are easy to edit, such as "sitetitle" and "tagline", but others are less obvious:
{
"sitetitle": "Blockpress.me",
"tagline":"The CMS with blockchains for its database...",
"palette": "chocorange",
"theme": "metaverse",
"themeoptions": {
"banner_image": "",
"site_image": ""
},
"modules": ["static","steem"],
"firstpage": {"type": "static", "args": ["content/default/welcome_to_blockpress.html"]},
"menu": [
{"label": "Home", "type": "static", "args": "content/default/welcome_to_blockpress.html"},
{"label": "Anton's Posts", "type": "steem", "args": {"show":"posts", "user":"antonchanning", "tag":"blockpress", "count":10}},
{"label": "Dana's Posts", "type": "steem", "args": {"show":"posts", "user":"dana-varahi", "tag":"blockpress", "count":10}}
],
"socialmenu": {
"steemit": "https://steemit.com/trending/blockpress",
"github": "https://github.com/blockpress/blockpress.me",
"linkedin": "",
"twitter": "",
"facebook": "",
"gplus": "",
"stackoverflow": "",
"link_url": "https://blockpress.me",
"email": ""
},
"dateformat": {"locale": "en-US", "options":{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }}
}
Let us go through all the fields. sitetitle
and tagline
are for the name of the site, plus an optional slogan or phrase. If you don't want a tagline, give it a blank value like this:
"sitetitle": "Your site title",
"tagline":"",
Next we come across the theme
and palette
options. Theme controls the layout,
and whilst you can create your own custom themes, BlockPress also comes with four
built in themes to get you started. These are metaverse, trollfell, fluxstate
and amber. Our naming convention for official themes is fictional and
mythological places. Our first four come from 'Snow Crash', 'Troll Fell',
'Shadowrun' and 'The Chronicles of Amber'. We should note that fluxstate
and amber are still under active development and are subject to change.
So far two of our themes, metaverse and trollfell also support palettes, which is to say the same layout can combine with a range of colour combinations. Whilst you can also create your own palettes, BlockPress comes with four predefined palettes that you can use with these themes. The names of the predefined palettes are cherrypie, chocorange, pumpkinpie and vanilla. Our naming convention for official palettes is themed on desserts and sweets.
If you chose a theme that supports palettes:
"palette": "vanilla",
"theme": "trollfell",
If you chose a theme that has a built in palette:
"palette": "",
"theme": "fluxstate",
Some themes will display a banner image and/or a site image if you provide a valid url for the images you want to use.
"themeoptions": {
"banner_image": "https://steemit-production-imageproxy-upload.s3.amazonaws.com/DQmUgGiwvvq39ig4UbY1GXYNboTjQtS4QiRiy5kEPanu4KZ",
"site_image": "https://anton.blockpress.me/theme/anton/img/anton.jpg"
},
Any modules you use on your site should be listed in this array. This includes custom modules that you create yourself. If you do not intend to use a module, it is best not to list it here as all modules listed will be loaded.
"modules": ["static","steem"],
If you want to load some static content as one of your pages you will need the
static
module. If you plan to pull content from the steem blockchain, you will
need the steem
module. BlockPress also comes with a third built in module,
link
. You will need to add this one if you want one of your menu items to take you
outside of your blockpress site.
BlockPress will not load any content when the page first loads unless you
instruct it to. You do that by providing a content object value to the firstpage
property.
"firstpage": {"type": "static", "args": ["content/default/welcome_to_blockpress.html"]},
These same content objects appear in the menu array, only with the addition of a label:
"menu": [
{"label": "Home", "type": "static", "args": "content/default/welcome_to_blockpress.html"},
{"label": "Anton's Posts", "type": "steem", "args": {"show":"posts", "user":"antonchanning", "tag":"blockpress", "count":10}},
{"label": "Dana's Posts", "type": "steem", "args": {"show":"posts", "user":"dana-varahi", "tag":"blockpress", "count":10}}
],
-
label
Used as the word that appears on the menu button. -
type
Name of the module that returns the content. -
args
An object containing the arguments that you will pass to the module. Can be a string if the module accepts a single argument.
The static
module accepts a single argument, a string with the relative path
to the content file you want it to load. Whilst this will likely be a html
file,
it will in fact not be a complete html file, as it will only define those tags
that are to appear inside the <div id="contentArea"></div>
(see contentArea reference).
The steem
module is a bit more complex and has its own properties:
-
show
Type of steem content you want to display. Valid values includeprofile
,post
andposts
. -
username
This is the steem username related to the content you wish to display. For now only a single username is supported and it is required. In future theposts
value for show will allow no username and multiple usernames. For a show type ofprofile
these are the only two arguments you need. -
tag
Only used with a show type ofposts
. Can be blank. If defined will limit the post listing to only those that match the specified tag. -
count
Only used with a show type ofposts
. Will limit the number of posts displayed in one listing to the number defined. -
permlink
Only used with a show type ofpost
. Basically the post id you wish to load.
Most of the themes support the concept of a social menu. Define relevant links to profiles, groups and pages on various social media platforms related to the content of your site, and they will appear in the social menu part of the theme you used. Often in the footer or side bar.
Defines how dates are displayed on your site.