Code Monkey home page Code Monkey logo

simplesitemap's Introduction

SimpleSitemap

Build status codecov

NuGet
Production
Development

This simple package helps generate search engine sitemap's for ASP.NET web applications.


Installation

Package Name: SimpleSitemap
CLI: install-package SimpleSitemap


What is a Sitemap? Are sitemaps and robots.txt the same thing? Why do I need a sitemap at all?

The wiki has answers all these questions.

Code examples:


Output examples:

    <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
        <sitemap>
            <loc>http://www.myWebSite.com/sitemap/products/?page=1</loc>
            <lastmod>2014-11-24T09:22-08:00</lastmod>
        </sitemap>
        <sitemap>...</sitemap>
        ....
    </sitemapindex>

or

    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
        <url>
            <loc>http://www.myWebSite.com/products/1</loc>
            <lastmod>2014-11-21T06:31-08:00</lastmod>
            <changefreq>hourly</changefreq>
            <priority>1</priority>
        </url>
        <url>....</url>
        ....
    </urlset>

Robots will ❤️ you!


Lic: MIT

simplesitemap's People

Contributors

purekrome avatar benbristow avatar rpm1984 avatar terribledev avatar kolodoz avatar

Stargazers

 avatar Nat Korch avatar Joel Mitchell avatar Tim Jones avatar Marco Siccardi avatar Andy Bochmann avatar Valentin Anghel avatar Sajad Jalilian avatar  avatar Andrejs Agejevs avatar pedoc avatar Loren Paulsen avatar  avatar DAVID TIM avatar Gautham avatar Charlie Smith avatar Brian Chavez avatar AJ Tatum avatar Emre GULCAN avatar Evangelos Barmpas avatar Miguel Ángel Bueno Ferrer avatar erhan kocabuga avatar Abhith Rajan avatar  avatar Barış Akpunar avatar Scott Mencer avatar

Watchers

James Cloos avatar  avatar  avatar Andy Bochmann avatar DAVID TIM avatar

simplesitemap's Issues

Double-escape of URI strings

Looking at line 117 of SitemapService.cs, the service is calling Uri.EscapeUriString() to escape the AbsoluteUri. However, that doesn't seem necessary, because the AbsoluteUri property on a Uri is escaped already.

Escaping it again will break the URLs because the % will be escaped as %25.

var loc = new XElement(xmlns + "loc", Uri.EscapeUriString(node.Url.AbsoluteUri));

For example:

var original = "http://example.com/test-®-test";
Console.WriteLine(original); 
// http://example.com/test-®-test

var uri = new Uri(original, UriKind.Absolute);
Console.WriteLine(uri.AbsoluteUri);
// http://example.com/test-%C2%AE-test

var escaped = Uri.EscapeUriString(uri.AbsoluteUri);
Console.WriteLine(escaped);
// http://example.com/test-%25C2%25AE-test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.