tavern 2.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 36

Build Status

A static site generator for blogs, written in Dart.

Features

  • [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

Examples

See the examples folder.

Getting Started

Start with a normal dart project with the following structure:

web/
  index.md
  templates/
    index.html
pubspec.yaml

and in your pubspec:

name: my_awesome_blog
dependencies:
  browser: any
  tavern: any
transformers:
- tavern

In index.md, add some metadata and markdown:

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

foo

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:

<html>
<head>
    <link rel="stylesheet" href="/style.css">
</head>
<body>
<div class="content">
    <h1>{{title}}</h1>
    <div id="content">
        {{{content}}}
    </div>
</div>
</body>
</html>

Running and Building

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

Tags

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:

<!--tag_index.html-->
<ul>
    {{#tags}}
        <li><a href="{{url}}">{{name}}</a></li>
    {{/tags}}
</ul>

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

<!--tag_page.html-->
<ul>
    {{#posts}}
        <li><a href="{{url}}">{{name}}</a></li>
    {{/posts}}
</ul>

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:

transformers:
- tavern
- polymer:
    entry_points:
      - 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)

Changelog

1.0.0

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  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
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
29
Overall:
Weighted score of the above. [more]
36
Learn more about scoring.

We analyzed this package on Aug 16, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.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.

Fix platform conflicts.

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Add SDK constraint in pubspec.yaml.

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

Package is getting outdated.

The package was released 84 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.

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.

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.