🚀
Stancy
  • Introduction
  • Issues
  • Changelog
  • Installation
  • Getting started
  • Basics
    • Content
    • PageData
    • Make Page Command
  • Advanced
    • Feed Atom/RSS
    • Sitemap
    • static export
  • Webserver
    • 🚧nginx
    • 🚧caddy
  • Services
    • GitHub Actions
    • 🚧GitHub Pages
    • Netlify
    • 🚧sitesauce
    • 🚧forestry
Powered by GitBook
On this page

Was this helpful?

  1. Basics

Make Page Command

The make:page command allows you to create a new page - including page data class and content file.

php artisan make:page Post --collection=blog

This command will create the following two files.

<?php

namespace App\Pages;

use Astrotomic\Stancy\Models\PageData;
use Astrotomic\Stancy\Traits\PageHasContent;
use Astrotomic\Stancy\Traits\PageHasDate;
use Astrotomic\Stancy\Traits\PageHasOrder;
use Astrotomic\Stancy\Traits\PageHasSlug;

class Post extends PageData
{

}
---
_pageData: \App\Pages\Post
_view: null
---

After this you can rename the created markdown file, add the view to use and your content.

The make:page command works with sheet collections with markdown, JSON or YAML content (.md, .json, .yaml, .yml). For all other extensions it will only create an empty file.

PreviousPageDataNextFeed Atom/RSS

Last updated 5 years ago

Was this helpful?