sitemap 0.7.0

Sitemap #

A dart package to generate Sitemaps easily. View on pub

Example #

  final sitemap = new Sitemap();

  sitemap.entries.add(new SitemapEntry()
    ..location = 'http://foo.bar/baz'
    ..priority = 0.75
    ..addAlternate('en', 'http://foo.bar/baz')
    ..addAlternate('fr', 'http://foo.bar/fr/baz')
    ..addAlternate('de', 'http://de.foo.bar/baz')
    ..addAlternate('pt-Br', 'http://brazilianfoo.bar/baz'));

  print(sitemap.generate());

Changelog #

0.7 #

  • Added addAlternate(language, location) to SitemapEntry for specifying alternate urls for localised content
  • Dart 2.0 is now mandatory, if you require Dart 1 support then pin this package to 0.6

0.6 #

  • Added support for Dart 2.0
  • Updated dependencies & general tidy up
  • Added example for pub (example/)

example/example.dart

import 'package:sitemap/sitemap.dart';

void main() {
  final sitemap = new Sitemap();

  sitemap.entries.add(new SitemapEntry()
    ..location = 'http://foo.bar/baz'
    ..priority = 0.75
    ..addAlternate('en', 'http://foo.bar/baz')
    ..addAlternate('fr', 'http://foo.bar/fr/baz')
    ..addAlternate('de', 'http://de.foo.bar/baz')
    ..addAlternate('pt-Br', 'http://brazilianfoo.bar/baz'));

  print(sitemap.generate());
}

Use this package as a library

1. Depend on it

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


dependencies:
  sitemap: ^0.7.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:sitemap/sitemap.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
13
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
54
Overall:
Weighted score of the above. [more]
47
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (intl).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is getting outdated. (-15.62 points)

The package was last published 60 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.61.0 <3.0.0
intl ^0.15.0 0.15.8 0.16.0
xml ^3.0.0 3.5.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
meta 1.1.7
path 1.6.4
petitparser 2.4.0
typed_data 1.1.6