tavern 2.0.2

  • README.md
  • Installing
  • Versions
  • 0

Build Status

A static site generator for blogs, written in Dart.


  • [x] Markdown and Mustache templating
  • [x] Support for tags and a tag index page.
  • [x] Compatibility with dart2js
  • [x] Compatibility with other Dart transformers (e.g. Polymer, SASS)
  • [x] Support for including a tag list in any page
  • [ ] Base URL configuration (similar to how it works in Jekyll)
  • [ ] Site, post, and template generation tool
  • [ ] Support for configuring post metadata in a separate YAML file
  • [x] Support for sitemap.xml and rss/atom
  • [ ] Support for multiple languages
  • [ ] Support for archived posts


See the examples folder.

Getting Started

Start with a normal dart project with the following structure:


and in your pubspec:

name: my_awesome_blog
  browser: any
  tavern: any
- tavern

In index.md, add some metadata and markdown:

title: Hello World!
category: Random
tags: ['code', 'dart']
template: index


the templates/index.html will be associated your page. Templates use Mustache bindings and can use any metadata specified in the markdown file. For example:

    <link rel="stylesheet" href="/style.css">
<div class="content">
    <div id="content">

Running and Building

Tavern uses Pub; simply use pub serve and pub build to test and deploy your blog.


Tavern supports tagging articles and viewing articles associated with that tag:

For an index of tags, add a tag_index.html template and use the tags metadata in your template:

        <li><a href="{{url}}">{{name}}</a></li>

For "tag pages" (To list all pages associated with a tag) add a tag_page.html template and use the posts metadata:

        <li><a href="{{url}}">{{name}}</a></li>

Other Transformers (e.g. Polymer)

Tavern leverages Dart's asset transformer, and can be used with other transformers. It is recommended that other transformers be run after Tavern:

- tavern
- polymer:
      - web/index.html

Relative Paths / baseurl

Tavern desn't yet have support for configuring and updating the base url. For now it is recommended to use relative and absolute paths:

<a href="/tags/index.html"</a>
<a href="../../styles.css"</a>

Any templates that should assume they are at their final position when referencing CSS, Dart, JS. For example, web/templates/index.html should assume it has been already moved to the location of the markdown file using it (e.g. web/index.md)



  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  tavern: ^2.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:tavern/tavern.dart';
Version Uploaded Documentation Archive
2.0.2 Jan 5, 2017 Go to the documentation of tavern 2.0.2 Download tavern 2.0.2 archive
2.0.1 Jan 4, 2017 Go to the documentation of tavern 2.0.1 Download tavern 2.0.1 archive
2.0.0 Jan 1, 2017 Go to the documentation of tavern 2.0.0 Download tavern 2.0.0 archive
1.0.2 Oct 25, 2016 Go to the documentation of tavern 1.0.2 Download tavern 1.0.2 archive
1.0.1 Sep 15, 2016 Go to the documentation of tavern 1.0.1 Download tavern 1.0.1 archive
1.0.0 Aug 12, 2016 Go to the documentation of tavern 1.0.0 Download tavern 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0.
 Because tavern depends on markdown >=0.3.5 <2.0.2 which requires SDK version <2.0.0 or >=2.0.0-dev <2.0.0, version solving failed.

Health suggestions

Format lib/src/cleanup.dart.

Run dartfmt to format lib/src/cleanup.dart.

Format lib/src/metadata.dart.

Run dartfmt to format lib/src/metadata.dart.

Format lib/src/metadata_aggregator.dart.

Run dartfmt to format lib/src/metadata_aggregator.dart.

Format lib/src/tag_pages.dart.

Run dartfmt to format lib/src/tag_pages.dart.

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is getting outdated. (-95.07 points)

The package was released 101 weeks ago.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use tavern.dart. Packages with multiple examples should use example/readme.md.