From a859a3f3635865055bb79c843c529da260e2eea9 Mon Sep 17 00:00:00 2001 From: Edgar Date: Sun, 22 Nov 2020 15:47:10 +0100 Subject: [PATCH] upd --- README.md | 36 ++++++++++++++++++++++++++++++++++++ src/lib.rs | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d21526c..4658e0d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ To handle the `lastmod` tag it uses [chrono](https://docs.rs/chrono/) but it can ## Example +To run the examples use `cargo run --example gen_sitemap` + ```rust use chrono::prelude::*; use sitewriter::*; @@ -49,3 +51,37 @@ fn main() { println!("{}", result); } ``` + +Prints the following: +```xml + + + + https://edgarluque.com/projects + + + https://edgarluque.com/ + 2020-11-22T14:36:30Z + 1.0 + daily + + + https://edgarluque.com/blog + 2020-11-22T14:36:30Z + 0.8 + weekly + + + https://edgarluque.com/blog/sitewriter + 2020-11-22T15:10:15Z + 0.5 + never + + + https://edgarluque.com/blog/some-future-post + 2020-12-05T11:30:00Z + 0.5 + never + + +``` diff --git a/src/lib.rs b/src/lib.rs index 14af502..202fb6a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,7 +35,7 @@ impl Display for ChangeFreq { } } -/// Parent tag for each URL entry. +/// A sitemap url entry. #[derive(Debug)] pub struct Url<'a> { /// URL of the page.