WHAT'S
"SiteContainer"?
FEATURES
With many features, we will support you to build a site quickly and easily.
Lightweight
Because it is lightweight, it does not put pressure on the environment.
Fast building
The structure is created from scratch.
Therefore, it can be created quickly.
Easy cusomizing
Simple structure and easy to customize.
You can add the features you want yourself.
No database
Since it does not use a database, it is suitable for any environment.
INSTALL
Setup is easy.
Just download the Zip file from the link, unzip it, and place it in the DocumentRoot of the server.
FILE SYSTEM
Filesystems are easy.
A description of the content.
・DocumentRoot
│ index.php
├─pages
│ ├─example
│ │ example.php
│ │ etc.jpg
│ │ example.pdf
│ └─top
│ top.php
├─common
│ ├─partials
│ │ pageButton.php
│ │ head.php
│ │ navigation.php
│ │ footer.php
│ │ 404.php
│ │ baseHtml.php
│ └─classes
│ common.php
├─js
│ bootstrap.min.js
├─css
│ bootstrap.min.css
│ top.css
└─media
thumbnail.jpg
"pages"directry
Add articles to the "pages" directory.
You can also put media files such as images.
"common"directry
The "partials" directory contains commonly used parts.
Go ahead and customize it.
"classes"directry
The "classes" directory contains classes that manage pages.
"js"directry
The "css" directory has bootstrap5 css.
You can also place Css referenced from each page.
"media"directry
Place multimedia files such as image files and video files in the "media" directory.
ADD PAGE
How to add a page, it's
- Create a directory under "page"
- Create *.php
File name must be same as directory name - Edit a "*.php"
Edit a "*.php" example
$pageInformation = array(
"title" => "BlogTop",
"description" => "Tools for building sites quickly",
"keywords" => "keyword, key, hoge, piyo",
"summary" => "page summary",
"thumbnail" => "thumbnail.jpg",
"url" => "/blog",
"canonical" => null,
"publish_datetime" => "2023/07/12 12:53:00",
"on_publish" => "1",
"category" => "page",
"tags" => ["blog", "bbbb", "cccc"],
"page_type" => "blog_item",
"extension_css" => ["bootstrap-icons.min.css"],
"extension_js" => array(
"top" => null,
"bottom" => null
),
);
title | Page title. It is automatically set in HTML. |
description | Page description. It is automatically set in HTML. |
keywords | Page keywords. It is automatically set in HTML. |
summary | Specify the page summary. |
thumbnail | Specify a thumbnail image. |
url | Specify the URL. However, "example.com/sitemap.xml", "example.com/rss", and "example.com/atom.atom" cannot be specified. |
canonical | Specifying canonical tags. It is automatically set in HTML. |
publish_datetime | Publication date and time. It does not affect the display/hide of articles. |
on_publish | Disclosure or not. Specified as int(0 or 1) type. |
category | Page category. In common.php, it is used to narrow down pages. |
tags | tag. Multiple specifications are possible. Specify an array. |
page_type | page type. Specify from "fixed_page", "blog_page", and "blog_item". |
extension_css | Specifying external CSS. Multiple can be specified, and specify an array. |
extension_js | Specifying external JS. Multiple can be specified, and specify an array. |
CUSTOMIZE
Customize the template file to get started.
The template files are located in the "common > partials" directory.
Originally written to use Bootstrap5. If you want to change it, change head.php and footer.php.
common/classes/common.php | This class handles request information, page information, etc. Customization is required, for example if you want a customized list of pages. |
common/partials/pageButton.php | Part of page turn button. |
common/partials/head.php | Define the head element. |
common/partials/navigation.php | Defines navigation elements. Since the sample menu is prepared, change it when operating. |
common/partials/footer.php | Defines footer elements. Since the sample menu is prepared, change it when operating. |
common/partials/404.php | This template is automatically loaded when the page does not exist. Customize as needed. |
common/partials/baseHrml.php | Template for configuring HTML. It supports fixed pages, blog pages, and blog child pages. You can freely customize your design. |
VARIABLE and METHOD
Variables that can be used on each page
$pageInformation | array | Show "ADD PAGE" section. |
$targetPage | array | Current display page information |
$hasPage | boolean | Presence or absence of the requested URL |
$baseUrl | string | Server URL |
$softwareVersion | string | This software version |
$mediaUrl | string | media file URL |
$mediaUrl | string | media file URL |
$pageUrl | string | page file URL |
$params | array | Request parameters |
Functions available on each page
name | argument | return | description |
---|---|---|---|
getFilterPages("categoryName", "tagName", "yearMonth") | string | array | Get articles for the indicated category or tagname |
getMonthArray("categoryName") | string or null | array | Get a list of articles in a specified category with their month and year |
getTagArray("categoryName") | string or null | array | Get a list of tags for articles in a specified category |
getPrevPage("currentUrl", "blog") | string | array | Get the information of the previous page seen from the current page |
getNextPage("currentUrl", "blog") | string, string | array | Get the information of the next page seen from the current page |
SITEMAP
Get or send a simple sitemap by accessing sitemap.xml
http(s)://example.com/sitemap.xml
cation!
Only "loc", "lastmod" and "priority" are supported.
Others are handled by customizing common.php.
"lastmod" uses the timestamp of the file.
"priority" is fixed at 0.5.
See schema.org for details
schema.orgFEED
Supports RSS2.0 and ATOM feed output.
The URL is "example.com/rss" for RSS.
ATOM is "example.com/atom.atom"
SPECIAL THANKS
Thanks to everyone who created the library I used to create this feature.
thank you.