2017 © Pedro Peláez
 

library carew-authors

Authors plugin for carew

image

seiffert/carew-authors

Authors plugin for carew

  • Tuesday, July 30, 2013
  • by PSeiffert
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Authors plugin for Carew

This plugin enables you to use Carew with multiple authors. In every article, you can set the author in the article's metadata. When you execute Carew's build command, special author index documents will be generated for every author., (*1)

Installation

Install it with composer:, (*2)

composer require seiffert/carew-authors:dev-master

Then configure in config.yml, (*3)

engine:
    extensions:
        - Carew\Plugin\Authors\AuthorsExtension

authors:
    ego:
        name: Paul
        email: paul.seiffert@gmail.com
    ego2:
        name: Paul
        email: paul.seiffert@gmail.com

Create a template authors.html.twig in your layouts directory with the following content:, (*4)

{% extends 'vendor/seiffert/carew-authors/Carew/Plugin/Authors/layouts/authors.html.twig' %}

In this template, you can customize the rendering of the author's index document., (*5)

Usage

In your posts: specify the post's author like this:, (*6)

---
layout: post
title:  This is pure awesomeness!
author: seiffert
---

Now, when you build your blog using Carew's build command, a index file authors/seiffert.html will be generated listing all posts of that author. Also, the post Documents that have an author in their metadata, will be extended with an Author object that holds all information configured in the config.yml as described above (in the example this are the keys name and email., (*7)

When rendering a post in a template, you can access this information like this:, (*8)

<a href="/authors/{{ document.metadatas.author.handle }}.html">
    {{ document.metadatas.author.name }}
</a>

The Versions

30/07 2013

dev-master

9999999-dev

Authors plugin for carew

  Sources   Download

MIT

The Requires

 

The Development Requires

by Paul Seiffert

carew