public static function files(\Twig_Environment $environment, $files, $current, $sortOrder = null, $sortBy = null, $filter = null, $userAgentEnabled = false)
    {
        $pagelist = [];
        foreach ($files as $file) {
            if (!strpos($file, $current)) {
                $relativePath = Page::generateRelativePath($file);
                $template = $environment->load($relativePath);
                $page = new Page($template, [], $userAgentEnabled);
                $pagelist[] = $page;
            }
        }

        // apply filter
//        $pagelist = self::applyFilter( $pagelist, $filter );

        if (isset($sortBy)) {
            $pagelist = self::applySorting($pagelist, $sortOrder, $sortBy);
        }

        return new ArrayIterator($pagelist);
    }