Download the PHP package terdelyi/phanstatic without Composer

On this page you can find all versions of the php package terdelyi/phanstatic. 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 phanstatic

Phanstatic

Total Downloads Latest Stable Version License

Phanstatic is a simple, lightweight, CLI-based static site generator written in PHP, without additional frameworks or template engines.

You don't need to learn any new APIs or syntax: it's just basic PHP pages and Markdown files placed in a content directory, which will then be compiled into fast, portable HTML files, ready to deploy on any web server with minimal effort.

Install

To create a new project, run:

If you already have a project with a content folder, install Phanstatic with:

Build

To generate static files from the content in your content directory, run the following command from your project root:

The generated files will be placed in the dist folder.

Preview

To preview your site directly from the content folder in a browser, run:

In this mode, you can edit your PHP files, and changes will appear in the browser after refreshing the page.

To preview the built files from the dist folder, use:

You can also customise the host and port with the --host and --port options. The default values are localhost and 8080.

Configuration

Configuration is optional. You can create a configuration file at content/config.php, which must return a ConfigBuilder object, for example:

If no config.php file exists, Phanstatic will use the default settings. Your IDE can help you explore the available configuration options, showing the properties and their types.

Content basics

Organizing your content is simple. The content folder contains your pages, collections, and assets:

You can also use partials: any folder or file starting with an underscore _ will be ignored during the build. Include these partials in your pages using PHP's include() function.

Example project structure

If you create a folder under collections, you must register it in your configuration file. Otherwise, you will get a "Configuration for collection 'Collection' is missing" error.

Frontend

Phanstatic does not include frontend or theme support. You can add your CSS and other assets freely under the assets/ folder, and reference them in your pages using:

Available helpers

Function Description
assets() Link files from the assets folder. The base URL from the config is added automatically.
url() Generate links to any page on the site. . The base URL from the config is added automatically.
dd() Dump variables and stop execution during runtime or build.
source_dir() Link files from the source directory (default: content).
build_dir() Link files from the distribution directory (default: dist).

Contributions

The main goal of Phanstatic is to keep simple and fast for common use cases, such as simple sites and blogs.

If you find a bug, have a feature request, or want to suggest improvements, please contact me directly or start a discussion on GitHub. Contributions in the form of code, documentation, or examples are very welcome and greatly appreciated.


All versions of phanstatic with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
league/commonmark Version ^2.4
spatie/yaml-front-matter Version ^2.0
symfony/console Version ^7.1
symfony/filesystem Version ^7.0
symfony/finder Version ^7.0
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 terdelyi/phanstatic contains the following files

Loading the files please wait ...