sitemap 0.7.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 32

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]
0
Health:
Code health derived from static analysis. [more]
86
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
32
Overall:
Weighted score of the above. [more]
32
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21

Health suggestions

Fix lib/sitemap.dart. (-14.39 points)

Analysis of lib/sitemap.dart reported 31 hints, including:

line 13 col 27: Unnecessary new keyword.

line 15 col 18: Unnecessary new keyword.

line 15 col 33: Unnecessary new keyword.

line 16 col 7: Unnecessary new keyword.

line 17 col 11: Unnecessary new keyword.

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).

Package is getting outdated. (-37.81 points)

The package was last published 71 weeks ago.

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.

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.6.1
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
meta 1.1.8
path 1.6.4
petitparser 2.4.0
typed_data 1.1.6