GithubHelp home page GithubHelp logo

carew-authors's Introduction

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.

Installation

Install it with composer:

composer require seiffert/carew-authors:dev-master

Then configure in config.yml

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

authors:
    ego:
        name: Paul
        email: [email protected]
    ego2:
        name: Paul
        email: [email protected]

Create a template authors.html.twig in your layouts directory with the following content:

{% 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.

Usage

In your posts: specify the post's author like this:

---
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.

When rendering a post in a template, you can access this information like this:

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

carew-authors's People

Contributors

seiffert avatar

Watchers

 avatar  avatar

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.