Coder Social home page Coder Social logo

statie-web's Introduction

wakeup

statie-web's People

Contributors

celyes avatar crazko avatar dependabot[bot] avatar petrkle avatar tomasvotruba avatar xy2z avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

statie-web's Issues

Clarification for Gulp

Regarding Getting Started

  1. You don't specify that the example code needs to be in gulpfile.js, which new users may not know (I didn't).

  2. 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.

Deprecate and move posts from TomasVotruba.cz

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?

Custom Generator Object Incorrect

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
        ));
    }
}

gulp command fails on syntax error

Setup

composer update
npm install

Run

➜  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

Call to action

Výzva pre ľudí, čo používajú Statie, aby pridali svoj projekt na stránku. Teda pridať podstránku "Built with Statie".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.