tavern 2.0.2

  • README.md
  • Installing
  • Versions
  • 37

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

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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


We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
85 / 100
Reflects how tidy and up-to-date the package is. [more]
55 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:tavern/tavern.dart.


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 errors 22 hints.

    Strong-mode analysis of lib/tavern.dart failed with the following error:

    line: 29 col: 6
    The element type 'MetadataAggregator' can't be assigned to the list type 'Transformer'.

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

    Similar analysis of the following files failed:

    • lib/src/markdown.dart (hint)
    • lib/src/metadata.dart (hint)
    • lib/src/metadata_aggregator.dart (hint)
    • lib/src/sitemap.dart (hint)
    • lib/src/tag_metadata.dart (hint)
    • lib/src/tag_pages.dart (hint)
    • lib/src/template.dart (hint)
    • lib/src/template_cleanup.dart (hint)
  • Package is getting outdated.

    The package was released 74 weeks ago.

  • The description is too short.

    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.


Package Constraint Resolved Available
Direct dependencies
barback >=0.15.0 <0.16.0 0.15.2+16
markdown >=0.11.0 <0.12.0 0.11.4 2.0.0
mustache >=0.2.0 <0.3.0 0.2.5+1 1.0.1
source_gen >=0.5.0 <0.6.0 0.5.10+1 0.8.1+3
yaml >=2.1.0 <3.0.0 2.1.14
Transitive dependencies
analyzer 0.30.0+4 0.32.1
args 1.4.3
async 2.0.7
build 0.9.3 0.12.6
charcode 1.1.1
cli_util 0.1.3
convert 2.0.1
crypto 2.0.3
csslib 0.14.4
dart_style 1.0.9+1 1.0.14
front_end 0.1.0-alpha.4.1 0.1.1
glob 1.1.5
html 0.13.3+1
isolate 1.1.0 2.0.1
kernel 0.3.0-alpha.1.1 0.3.1
logging 0.11.3+1
meta 1.1.5
package_config 1.0.3
path 1.6.0
plugin 0.2.0+2
pool 1.3.5
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+8
Dev dependencies
collection any 1.14.10
polymer any
polymer_elements any
test any