Index file

This is BlaB! Pages and what you see is the default content file: blab-pages-content/index.md (CTRL+U to view-source). BlaB! Pages uses Parsedown to display markdown formatted content. Drop a bunch of markdown documents in blab-pages-content, set up a menu in blab-pages-content/menu.json and your website is ready to go!

What is markdown?


How to install


File/directory structure with the bare minimum of files for a working installation:


  πŸ“ public_html ← (your website root directory)
  β”œβ”€β”€ πŸ“ blab-pages-content
  β”‚   β”œβ”€β”€ πŸ“„ index.md
  β”‚   β”œβ”€β”€ πŸ“„ 404.md
  β”‚   └── πŸ“„ menu.json
  β”œβ”€β”€ πŸ“ blab-pages-parsedown
  β”‚   └── πŸ“„ parsedown.php
  β”œβ”€β”€ πŸ“ blab-pages-themes
  β”‚   └── πŸ“ [THEME]
  β”‚       └── πŸ“„ template.html
  └── πŸ“„ index.php


Dead simple JSON menu: blab-pages-content/menu.json


{
"?index"     : "BlaB! Pages",
"?markdown"  : "Markdown"
}


Any .md file from blab-pages-content can be displayed as a web page and you can link to it in the other markdown documents: [text](?name-of-the-markdown-file-without-md-extension).

A GET request ?page=name-of-the-md-file returns the content of the .md file as HTML (without template).

The names of the .md files can only contain digits, dashes & letters including UTF-8 letters.


Optional blab-pages-config.php (or change the config array in index.php directly)


<?php

$config=array();

$config['theme'] = '01-default'; // theme directory within /blab-pages-themes
$config['title'] = 'funky website'; // global title
$config['subti'] = 'The funkiest site on the internet!'; // fallback subtitle
$config['metad'] = 'Website dedicated to music!'; // META description
$config['metak'] = 'funk, jazz, samba'; // META keywords
$config['i6391'] = 'en'; // 2-letter language code
$config['b_url'] = 'chat/index.php'; // URL or relative path to BlabChat/index.php

?>


Optional subtitle can be set in the markdown document as an HTML comment:


<!-- SUBTITLE: This is the funkiest site on the Internet!  -->


A theme only requires a template.html file in blab-pages-themes/[THEME]/ and here is the default template file: blab-pages-themes/01-default/template.html (CTRL+U to view-source). How to load located in the [THEME] folder images, CSS & JavaScript in template.html? No problem at all:

<img src="blab-pages-themes/{{THEME}}/image.jpg" />

The following variables are dynamically replaced in template.html when loading the page:

Syntax Description
{{CONTENT}} the content of the .md file converted to HTML
{{SUBTITLE}} subtitle from the .md file (or fallback from config)
{{MENU_JSON}} blab-pages-content/menu.json untouhed
{{MENU_HTML}} blab-pages-content/menu.json converted to HTML links
{{EDITED}} .md file last edited: 2020-04-20
{{FSTGET}} GET request name (md file)
{{THEME}} config array: theme folder
{{TITLE}} config array: global title
{{METAD}} config array: META description
{{METAK}} config array: META keywords
{{I6391}} config array: language code
{{B_URL}} config array: URL/relative path to BlabChat/index.php

That's all!

 
funky website
The funkiest site on the Internet!
Radio
⬆
Chat