SCRAP – Content Management System
Overview
SCRAP (Simple Core for Rendering Assets & Pages) is the CMS that powers this site. It is a simple mobile-responsive flat-file Content Management System, consisting of one short PHP file and a single stylesheet, with no Javascript, no dependencies, and no database.
SCRAP is styled to be simple. Basic HTML markup is used for content pages, with the overall site layout (header, logo, menu, and footer) added automatically by SCRAP. The basic configuration (site name, logo, site owner, and menu structure) may be changed by editing a short JSON configuration file. The look and feel may be further modified by changing the core HTML page or stylesheet, as you wish.
Features
- Flat File CMS. No database, so editing is possible with a text editor, and backups and migrations are as simple as copying files.
- Simple Configuration. Configuration uses small JSON files for easy editing and rapid deployment.
- HTML Markup. Minimal page markup is required, using familiar HTML tags.
- Page Type Options. SCRAP handles three distinct types of page layouts: Standalone Article Pages, Dropdown Menu Pages, and Dynamic (Blog-style) Index Pages.
- Subfolder Architecture. All website content is neatly centralised inside a core pages folder, with subfolder names matching URL paths, and subfolder structure matching the site structure.
- Self-Contained Bundles. Pages are modular. An individual page folder houses its layout text (
index.htm), local media assets (images, PDFs, Zip Files, etc), and optional JSON configuration files all in one place. - Base URL Detection. SCRAP automatically detects and adapts to its installation folder (web root or a subfolder), so it can be installed in a subfolder for testing or site development, and easily moved for immediate deployment.
- Secure Routing. URL parameters are dynamically parsed, with built-in security measures to strip directory traversal subversion attempts.
- Page Not Found Fallback. If a requested page does not exist, SCRAP gracefully falls back to a custom page-not-found layout.
- Site Map Generation. SCRAP will dynamically generate a site map page as well as create
sitemap.xmlandrobots.txtfiles.
Take a look at the documentation to get a better idea of what SCRAP does.
Presentation & Styling
SCRAP's visual theme is powered by a lightweight, single-file stylesheet designed with modern layout standards and fluid responsiveness, providing:
- Mobile Responsiveness The navigation dynamically adapts to mobile screens, swapping standard navigation for a CSS-driven hamburger menu (three-line stack) expanding into a clean, drop-down menu container, without requiring heavy external JavaScript frameworks.
- Asset Scalability. Standard content containers apply global width overrides on embedded content graphics to guarantee layouts never break width boundaries on mobile touch screens.
- Boolean Logic Representation. HTML
<not>tags are styled into a custom overbar dynamically positioned above text for Boolean not in technical or logic-focused copy. - Code Representation. HTML
<code>tags are styled into a monospaced bordered line of code, or if surrounded by<pre>…</pre>, a block of code.
License
SCRAP is free to use and is released under the terms of the GNU Affero General Public License (AGPL).
Download
Download SCRAP-v1.01.zip containing the main CMS files, documentation, and a sample configuration and web site.
Installation and Usage
- Installation. Extract the contents of the zip archive either to the root of your web space or to a folder for testing. The archive contains the core SCRAP CMS files (
index.phpandstyle.css) along with a routing file (.htaccess), example configuration file and logo (scrap.jsonandscrap.svg) and an example web site (the contents of thepagesfolder). - Routing. The
.htaccessfile contains the directives needed for Apache to re-write the page URLs to the files used by SCRAP. If Apache is configured to use.htaccessfiles, you can keep the file in your CMS installation folder alongside the PHP and CSS files. Otherwise, copy the directives from.htaccessinto a<Directory>section for the installation folder, in your Apache configuration file (httpd.conf) or virtual hosts configuration file (httpd-vhosts.conf). - Configuration. Edit the configuration file
scrap.jsonto set up the site name, logo, site owner, and menu structure. - Content. The
pagessubfolder holds the site content, with a subfolder for each page. Each subfolder holds anindex.htmfile for the page text, and any additional asset files needed (images, PDFs, Zip files, meta-files, etc). The structure of the folders here reflects the structure of the site. A sample web site is included in the download, which demonstrates the various options supported by SCRAP. See the documentation for more information. - File Editing. SCRAP does not contain a built-in file editor. If you want a self-hosted solution then Tiny File Manager is a very capable file manager and editor. A better and more secure solution for remote access is to connect to a remote SMB share over a WireGuard VPN, and edit your files using your editor of choice.