How to Create Your First PHP Twig Static Website under 2 Minutes with Statie
Why?
Statie was deprecated with last version 7, because 99 % of features are covered in Symfony application.
To create static content, migrate to Symfony app and SymfonyStaticDumper.
Do you like to write or create micro-sites? This post is for you.
Statie is now the most downloaded PHP Twig static site generators, even surpassing 7-years old Sculpin by 200 downloads a month. On the other hand, Sculpin is about to release version 3 creating healthy competition.
As you can see, Static websites are on the rise in PHP and they were never used more than now. It's time to make creating a new static website simple for everyone.
Until today, to create and understand static website basics, you had to learn:
- Statie - part 1: How to run it Locally
- Statie - part 2: How to add Contact Page With Data
- Statie - part 3: How to Add Reusable Parts of Code
- Statie - part 4: How to Create The Simplest Blog
Don't read it! It's an utter waste of time.
Documentation is Dead, Long Live Automatization
In recent years, there is a trend towards embodied knowledge:
- Do you understand semver and compare package dependencies? - No, you use Composer.
- Do you test your code against every PHP type? - No, you use PHPStan.
- Do you type manually method names or class names? - No, you use PHPStorm (or any other IDE).
- Do you upgrade your code manually? - No, you use Rector.
In other words, the knowledge is shifting from human brain storage to tool's abilities.
Not the smart knowledge that helps us create algorithms, but the dummy knowledge like "what is the 3rd most largest river in the USA" that I can Google in 2-3 seconds (depending on internet connection in the train). We don't become retarded, we become more powerful to use our brains for what they're best at.
Your First Statie in 2 minutes
composer require symplify/statie
Statie 5.3 brings 1 new command:
vendor/bin/statie init
See how it works:
Do you prefer Latte over Twig?
vendor/bin/statie init --templating latte
Explore the files to find hints on how to use templates, even if you never used Twig or Latte ever before ( ← embodied knowledge).
Great job! You're up and running locally.
Do you want to finish the Travis → Github Pages deployment? Just follow the official documentation.
Happy coding!
Have you find this post useful? Do you want more?
Follow me on Twitter, RSS or support me on GitHub Sponsors.