crazko / statie-web Goto Github PK
View Code? Open in Web Editor NEW📖 [deprecated] Documentation site for Statie - PHP Static Site Generator
📖 [deprecated] Documentation site for Statie - PHP Static Site Generator
Regarding Getting Started
You don't specify that the example code needs to be in gulpfile.js
, which new users may not know (I didn't).
While running gulp
gulpfile.js
file described, I get this after every file change:
Description:
Generate a site from source
Usage:
generate [options] [--] <source>
Arguments:
source Directory to load page FROM.
Options:
--output=OUTPUT Directory to generate page TO. [default: "/home/alex/repos/statie/output"]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-c, --config=CONFIG Path to config file. [default: "statie.(yml|yaml)"]
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
EDIT: #2 is solved by adding source
to lines 11 and 21. I'll submit a PR to fix.
Update https://www.statie.org/docs/headline-anchors/ to cover new logic and add some code on how to display anchor on hover in both cases.
Originally posted by @crazko in deprecated-packages/symplify#1500 (comment)
Asking here since https://github.com/Symplify/Statie doesn't accept issues.
If I'm building a site that has unsorted static pages (docs), how can I avoid needing to add an id
value to each one?
Moved from Symplify repo
Add this section, e.g. on index.latte
:
Got one too? Send a PR and share it with others.
The Symfony 4.2 and PHP 7.3 release is comming in these days, so it's time to clean old posts :)
I think it's the best to keep all source to one topic at one place, rather spread all over the internet.
Few posts are already on Statie.org, but most isn't.
I've already deprecated:
https://www.tomasvotruba.cz/blog/2017/12/11/new-in-symplify-3-statie-generators/ →
https://www.statie.org/docs/generators/
This posts needs to be moved:
Could you help me by moving them here so I could deprecated them and redirect on my blog?
The documentation on statie.org for Generators says that you can create your own object file and the example shows the class extending Symplify\Statie\Renderable\File\AbstractFile
.
However, when trying to do that, you will get this build error:
"MyWebsite\Statie" must inherit from "Symplify\Statie\Generator\Renderable\File\AbstractGeneratorFile"
I wasn't sure if this restriction was supposed to be imposed or not. If so, here is a working skeleton for a custom generator. It's basically the PostFile with some of the Post stuff stripped out.
<?php
declare(strict_types=1);
namespace MyWebsite\Statie;
use ArrayAccess;
use DateTimeInterface;
use Nette\Utils\ObjectHelpers;
use Symplify\Statie\Exception\Renderable\File\AccessKeyNotAvailableException;
use Symplify\Statie\Exception\Renderable\File\UnsupportedMethodException;
use Symplify\Statie\Generator\Renderable\File\AbstractGeneratorFile;
final class CustomFile extends AbstractGeneratorFile implements ArrayAccess
{
/**
* @return int|string|null
*/
public function offsetGet($offset) {
$this->ensureAccessExistingKey($offset);
return $this->configuration[$offset];
}
public function offsetExists($offset): bool {
return isset($this->configuration[$offset]);
}
public function offsetSet($offset, $value): void {
throw new UnsupportedMethodException(__METHOD__ . ' is not supported');
}
public function offsetUnset($offset): void {
throw new UnsupportedMethodException(__METHOD__ . ' is not supported');
}
private function ensureAccessExistingKey($offset): void {
if (isset($this->configuration[$offset])) {
return;
}
$availableKeys = array_keys($this->configuration);
$suggestion = ObjectHelpers::getSuggestion($availableKeys, $offset);
if ($suggestion) {
$help = sprintf('Did you mean "%s"?', $suggestion);
} else {
$help = sprintf('Available keys are: "%s".', implode('", "', $availableKeys));
}
throw new AccessKeyNotAvailableException(sprintf(
'Value "%s" was not found for "%s" object. %s',
$offset,
self::class,
$help
));
}
}
composer update
npm install
➜ statie-web git:(symplify-4) gulp
[01:24:24] Using gulpfile /var/www/statie-web/gulpfile.js
/usr/local/lib/node_modules/gulp/bin/gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^
TypeError: Cannot read property 'apply' of undefined
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
$ npm -v
3.5.2
window.location.hostname
to disable tracking https://developers.google.com/analytics/devguides/collection/analyticsjs/user-opt-outVýzva pre ľudí, čo používajú Statie, aby pridali svoj projekt na stránku. Teda pridať podstránku "Built with Statie".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.