GithubHelp home page GithubHelp logo

blog's Introduction

Blog

How it works

Content goes in /content (by default) as markdown files.

Supports the following YAML front matter options in content files

---
title: My Post/Page Title
date: 1970-01-01
updated: 1970-01-02
exclude_from_blog: false
---

The site will be generated from those files, the filenames being their slugs. Nested directories will generate files, but they will not currently be included in the front page posts list.

Property Use Format/Type Required
title It's the title string โœ…
date Shown as published date on individual pages. Also used to sort the front page posts list string (yyyy-mm-dd) โœ…
updated Shown as updated at on individual pages. string (yyyy-mm-dd)
exclude_from_blog Exclude from front page posts list if set to true. bool

Config

There are a few configuration options, they're all optional.

Any of the options can be overwritten by setting them in a config.php file in the root directory of the project. An example of this file is below with all the default values:

<?php
return [
    'site_title'            => 'Website',
    'base_url'              => '',
    'layout_file'           => '/src/layout.php',
    'content_template_file' => '/src/content.php',
    'routes_dir'            => '/src/routes',
    'content_dir'           => '/content',
    'static_dir'            => '/static',
    'out_dir'               => '/docs',
    'image_manager_driver'  => 'gd',
    'image_font_file'       => null,
];

Additionally, specific values may be set for builds run in the local environment:

<?php
return [
    // ... Primary configuration (Used for production builds)
    
    'environments' => [
        'local' => [
            'base_url' => 'http://blog.test'
        ]
    ]
];

Support for other environments may be added in the future

Building the site

Run the build with production config:

./build

Run the build with local config:

./build --env=local

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.