This is a PHP utility for generating a static HTML website from simple PHP files. It makes use of a user provided template that needs to call certain functions from this class. The PHP files may use additional methods for communicating with the generation system (for example for selecting items matching a certain tag). Examples are in the "examples" folder. My website at https://ComputingMongoose.github.io is generated using this generator. The GitHub for my site is here.
This utility file makes use of SimpleSiteMapGenerator for producing site maps. A copy is included in this repo, but you should check for an updated version in its own GitHub.
Sets the source folder containing PHP files.
Sets the destionation folder for the HTML output.
Sets the template PHP file. This will be used for generating each page. The template should call different methods for generating the menu and special links as needed.
Sets the menu to be used on all pages. Depending on the template, the menu may be generated automatically, without using this method, by selecting all pages with a certain tag.
Sets the base URL for this website. This must be starting with http or https.
Parses all pages to determine the available tags, page titles, page mappings, etc. This is required before running the next steps.
This generates the HTML static files. It must be executed after runStep1().
Generates XML and TXT sitemaps. It must be executed after runStep1().
Returns the title of the current page.
Returns the HTML content of the current page. This is usually inserted inside a template element.
Returns an HTML representation of the menu. This is currently hardcoded to using ul and li elements with specific css classes.
Returns an array of menu items (title,link) corresponding to a specific tag. It may ignore the index page associated with the tag and/or the current page. This method may be useful also for pages.
Returns an array of files corresponding to a specific tag. It may ignore the index page associated with the tag and/or the current page. This method may be useful also for pages.
Returns an URL corresponding to a page specified by its associated PHP file.
Returns an URL corresponding to a resource specified by its associated file (image, css, script).
Forcefully sets the title associated with the current page. Usually the title is derived automatically by the system from h1 HTML tags.
Sets the tags associated with the current page.
Checkout my YouTube channel for interesting videos: https://www.youtube.com/@ComputingMongoose/
Checkout my website: https://ComputingMongoose.github.io