Code Monkey home page Code Monkey logo

blogprint's Introduction

blogprint - a blueprint for blogs with kirby

blogprint is a theme for the awesome kirby CMS, to kickstart a blog. It provides all basic features you need for a fully functional blog, but without any styling - only semantic markup is provided.

Features:

  • General
    • Pagination
    • Search (whole site or just the pages)
  • Posts:
    • Title
    • Date
    • Tags
    • Categories
    • Covereimage
    • Author
    • Avatar
    • next/prev links
  • Archive (each with count):
    • Years
    • Years and Month
    • Tags
    • Catgeories
    • Authors

If the archive is opened without any arguments, it will list all articles seperated by year without the text.

There is also a main menu which will show all visible first-level-pages and their visible children (except children for 'posts' - which is not visible on default) to add additional pages to the blog.

Configuration:

You can control some stuff in site/config/config.php:

c::set('pagination-posts', 10);: number of posts per page

c::set('pagination-archive', 30);: number of posts per archive page

c::set('pagination-search', 30);: number of posts per search page

Special snippets:

post-footer.php

Description:

This snippet can list all metadata like date, author, tags and categories for a given post.

Options:

  • post => $post
  • date => true/false (default: true)
  • author => true/false (default: false)
  • avatar => true/false (default: false)
  • tags => true/false (default: false)
  • category => true/false (default: false)
  • class => string/false (default: false)

Usage:

<?php snippet('post-footer', array('post'       => $post,
                                   'author'     => true,
                                   'avatar'     => true,
                                   'tags'       => true,
                                   'category'   => true,
                                   'class'      => 'my-class')) ?>

archives.php

Description:

This snippet can list archives for dates, authors, tags and categories for all posts.

Options:

  • dates => true/false (default: false)
  • authors => true/false (default: false)
  • tags => true/false (default: false)
  • categories => true/false (default: false)
  • class => string/false (default: false)

Usage:

<?php snippet('archives', array('dates'      => true,
                                'authors'    => true,
                                'tags'       => true,
                                'categories' => true,
                                'class'      => 'my-class')) ?>

helpful functions:

getPostUrl( $post )

Returns the wordpress-style-url for a given post.

getAuthorName( $username )

Returns the first- and lastname for a given username. If no firstname is available, then the username will be returned. The lastname will only be used, if a firstname is available.

getCoverImage( $post )

Returns the coverimage-img-tag for a given post, if a coverimage is available. If no coverimage is available, it will return false.

Routing:

All posts are located under /posts, but this folder will be ommited in all urls.

Post URLs:

All links are in Wordpress-style: /year/month/day/post-title (for example: http://blog.dev/2014/12/24/lorem-ipsum ) and will be automaticaly routed to /posts/post-title internaly.

Archive URLs:

Archive for:

  • year: /$year/
  • month: /$year/$month/
  • day: /$year/$month/$day/
  • tags: /tag/$tag/
  • categories: /category/$category/
  • authors: /author/$author/

TODO:

  • add feed
  • make translatable, when Bug getkirby/kirby#156 is fixed
  • add disqus
  • make blogprint foundation-ready
  • make blogprint bootstrap-ready

blogprint's People

Contributors

domicoeth avatar

Stargazers

André Philip avatar Rico Magnucki avatar  avatar Markus Ritzmann avatar Tina Keil avatar Digital-E avatar Paul Robert Lloyd avatar Marco Biedermann avatar Antoine avatar  avatar Bernhard avatar  avatar Joro Yordanov avatar  avatar Mattias Haal avatar Peter Siska avatar Introvert avatar Daniel J Bennett avatar Adam Rasheed avatar Chris Vasey avatar Magnus Nyquist avatar Jon Schuster avatar Nikolas Palm avatar  avatar Pascal Kuster avatar lx4r avatar Alex Bennett avatar Daniel Blatt avatar Grant Hutchinson avatar  avatar grin avatar  avatar Cody Keisler avatar Philip avatar Thomas Fanninger avatar  avatar Tobias Wolf avatar Dirk Schmid avatar Matt Gilbert avatar Dan Leatherman avatar Jonathan Baptistella avatar Mohammad Shiran avatar Régis Lutter avatar  avatar Ian Cox avatar Ivan Soria avatar Palash Mukhopadhyay avatar Thomas Gimesi avatar Jens Franke avatar  avatar Roman Horokhovatskyy avatar Florian Hammer avatar Kim Franken avatar sap avatar Jonathan Montesinos avatar Vitaliy Litvinenko avatar  avatar Kay Spiegel avatar Ryan D-C avatar Suleiman Leadbitter avatar dem avatar Christopher Boutillé avatar

Watchers

André Philip avatar Irena Romendik avatar Florian Hammer avatar Tobias Hartmann avatar  avatar William avatar Markus Ritzmann avatar Jan Hofmann avatar  avatar

blogprint's Issues

Should not use php echo shorttags

The Main Project is not using echo shorttags like <?= $post->title()->html() ?> so this plugin should stick to the convention of Kirby in order to have a consistent setup.

using folder other than posts for blog

It would be great if there were a configuration option to specify the folder that should be used for the blog. Not everyone wants to use the home folder for the blog.
Thanks for the code!

The Plugin overwrites many Starterkit files which feels wrong

So my Problem here, i had a Kirby Starterkit in place and wanted to build up from it, then i thought this blog plugin might be great to add, but it has overwritten mostly all of the FR output files, so the FE was kinda totally destroyed.

Guess a better approch would be, if it only adds new blueprint and template files, from which you can create FE Pages.

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.