mirror of
https://github.com/edg-l/sitewriter.git
synced 2024-11-09 17:48:24 +00:00
upd
This commit is contained in:
parent
11dc59ff46
commit
a859a3f363
36
README.md
36
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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://edgarluque.com/projects</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://edgarluque.com/</loc>
|
||||
<lastmod>2020-11-22T14:36:30Z</lastmod>
|
||||
<priority>1.0</priority>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://edgarluque.com/blog</loc>
|
||||
<lastmod>2020-11-22T14:36:30Z</lastmod>
|
||||
<priority>0.8</priority>
|
||||
<changefreq>weekly</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://edgarluque.com/blog/sitewriter</loc>
|
||||
<lastmod>2020-11-22T15:10:15Z</lastmod>
|
||||
<priority>0.5</priority>
|
||||
<changefreq>never</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://edgarluque.com/blog/some-future-post</loc>
|
||||
<lastmod>2020-12-05T11:30:00Z</lastmod>
|
||||
<priority>0.5</priority>
|
||||
<changefreq>never</changefreq>
|
||||
</url>
|
||||
</urlset>
|
||||
```
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue