Airship\Cabin\Hull\Landing\IndexPage::index PHP 메소드

index() 공개 메소드

The homepage for an Airship.
public index ( )
    public function index()
    {
        $this->blog = $this->blueprint('Blog');
        if (!\file_exists(ROOT . '/public/robots.txt')) {
            // Default robots.txt
            \file_put_contents(ROOT . '/public/robots.txt', "User-agent: *\nAllow: /");
        }
        $blogRoll = $this->blog->recentFullPosts((int) ($this->config('homepage.blog-posts') ?? 5));
        $mathJAX = false;
        foreach ($blogRoll as $i => $blog) {
            $blogRoll[$i] = $this->blog->getSnippet($blog);
            if (Binary::safeStrlen($blogRoll[$i]['snippet']) !== Binary::safeStrlen($blog['body'])) {
                $blogRoll[$i]['snippet'] = \rtrim($blogRoll[$i]['snippet'], "\n");
            }
            $mathJAX |= \strpos($blog['body'], '$$') !== false;
        }
        $args = ['blogposts' => $blogRoll];
        $this->config('blog.cachelists') ? $this->stasis('index', $args) : $this->lens('index', $args);
    }