Download the PHP package thomas-redstone/site-build without Composer

On this page you can find all versions of the php package thomas-redstone/site-build. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package site-build

SiteBuild

SiteBuild is designed to build static websites, built in the same way as you would build a dynamic website.

It uses PHP, and the Plates PHP Template engine, which keeps things simple.

For each site, you create a directory structure like this:

- menus
- output
- pages
- resources
- themes

Installation

composer global require thomas-redstone/site-build

Add the following to your .bashrc, .zshrc or what ever is required to alter your path variable! For OSX or Linux, it will be something like this export PATH="$PATH:$HOME/.composer/vendor/bin"

The best resource I could find, which explains how to modify the path seems to be this help page from Oracle, for Java, but it still applies for PHP and composer, so if you're on Windows, or just about any Operating System under the Sun, this should tell you how to modify your path:

https://java.com/en/download/help/path.xml

Usage

First of all, you must ensure that there is an 'app.yml' configuration file containing the site name, inside the project folder e.g.:

name: ExampleSite

At present, this is not used, but it must exist, as SiteBuild uses it as confirmation that it is being run in the correct directory.

Next, run the sitebuild command:

sitebuild

At this point you should have a populated output directory. The directory output/latest will always contain the most recently generated site, and you can test it works locally as follows:

cd output/latest && php -S localhost:8080

At which point, you should be able to navigate to http://localhost:8080 and see your website.

Menus

Menus are defined as .yml files, at present there is only a main menu which will be used, but it is planned to support many menus in the future. For now, the main menu should exist in menus/main.yml, the format being as follows:

-
  url: "/"
  text: Home
-
  url: "/about"
  text: About

Output

This is where the generated website will be placed, at present each day gets a duplicate copy, this behaviour is likely to change soon, and keeping the websites in version control would be the preferred way to ensure there is always a way to roll back to a previous version.

Pages

The site content lives in the pages directory, these should all be .php files, with something along these lines at the beginning of each file, the template will use the data passed to it in order to populate the title, and the class provided will be applied to the body element, allowing any page specific styling to be handled. At present the tags and date fields are not used, but I plan to do something with them soon, and they are part of the reason that the $config is declared as a variable, and not simply an array declared as the layout function is called.

Resources

Any files placed in the resources directory will be copied directly into the output directory, with any folder structure preserved, so it's an ideal place to put any images, stylesheets, javascript or other assets.

Themes

Themes is where the templates themselves are, I generally call my main template 'template', and have a 'menu', which looks something like this:

<ul class="nav nav-pills">

        <li class='nav-item'><a class='nav-link' href='<?=$menuItem['url']?>'><?=$menuItem['text']?></a></li>

</ul>

Plans

I started this project around 3 years ago, and for much of that time, I've not done much with it, recently I've began to modernise it.

A few of the features I hope to add are:

I'd love to hear any feedback, bug reports, of feature suggestions, so please feel free to raise an issue on the issue tracker, or email [email protected].


All versions of site-build with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
symfony/console Version ~2.6
symfony/yaml Version ~2.6
league/plates Version 3.*
erusev/parsedown Version ^1.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thomas-redstone/site-build contains the following files

Loading the files please wait ....