Site Setup


Required and optional configuration

Required and optional configuration
Required and optional configuration
On this Page:
Content Directories
yBlog Directories
yBlog Directories
TheyBlog.php File
Theconfig.php File
Thefoot.php File
(Click the images for a lightbox slideshow)

Content Directories

Created: Nov 2020
Modified: July 7, 2021
Beta .33: July 7, 2021

Content pages may be in the root directory and any directory besides the yBlog directories. By convention, image files are kept in an./img/ subdirectory in the same directory as the content files. PDF files and ZIP files for download must be in theSITE_ROOT/inc/ directory for the plugins to work.

yBlog Directories

Content pages are in the root directory any desired folders except those reserved for yBlog, LIB, and INC. There are a few more support files in the root directory:

yBlog Directories

TheyBlog.php File

In the page template, theREQUIRE_ONCE ./lib/yBlog.php statement calls the maikn script to generate the page head, nav bar, responsive body header, TOC, plugin insertion, and footer. This file need not be edited, but you can change the top-of-page layout and other such features in this file.

Theconfig.php File

  • The./lib/yBlog.php file first calls a small site variable file,./lib/config.php. The./lib/config.php file sets the site's name, base URL, and options. This file then generates one set of variables for the public server, and another for localhost at http://127.0.0.1 which is selected automatically, depending where the directory resides. This file also sets site options, such as the logo, default stylesheet, and ID's for Google and Adobe integration. Additionally it provides default page values for any variables not set on individual content pages.


    Specifications for the variables are in preparation

    • To set upGoogle Analytics, visit its site and obtain an ID for this config file.
    • To set up Adobe DC Reader, visit its site and obtain an ID for this config file.
      • The./lib/yBlog.php file then generates all the metadata for the page's HEAD element from the page and site variables. It also includes the site stylesheet and all scripts needed for Google Analytics and plugins.

        The./lib/yBlog.php file then closes the HEAD element and adds an opening <BODY> tag. At the top of the BODY element, yBlog inserts a HEADER element which contains the responsive header. A NAV element inside the HEADER element containing the site menu. The menu contents generated automatically.

        The./lib/head.php file then parses the page and replaces the PHP plugin snippets with HTML andJavaScript, generated by the./lib/plugins.php file.

        Thefoot.php File

        After an article's content, the./lib/yBlog.php file adds footer content from the./lib/foot.phpfile. Each blog site will prefer a different footer, which is edited just like a standard Web page. The.lib/yBlog.php file then performs any necessary parsing on the whole page and sends it to the browser client.