Git Product home page Git Product logo

friendly-sitemap's Introduction

Umbraco Friendly Sitemap

Umbraco Friendly Sitemap

NuGet release Our Umbraco project page

Friendly Sitemap makes adding a dynamic sitemap.xml file to your Umbraco 8 website easy!

Getting started

This package is supported on Umbraco 8.1+.

Installation

Friendly Sitemap is available from Our Umbraco, NuGet, or as a manual download directly from GitHub.

Our Umbraco repository

You can find a downloadable package on the Our Umbraco site.

NuGet package repository

To install from NuGet, run the following command in your instance of Visual Studio.

PM> Install-Package Our.Umbraco.FriendlySitemap

Usage

Once installed, the sitemap will be visible on the URL /sitemap.xml, such as https://www.yoursite.com/sitemap.xml. The items displayed in the sitemap will be specific to the current domain.

If a physical sitemap.xml file exists in your website, the dynamically generated sitemap will be disabled.

It is possible to disable the sitemap via an app setting in web.config file:

<add key="Umbraco.Sitemap.EnableSitemap" value="false" />

Controlling output

By default the sitemap will include all content items within the current site with a template assigned.

Adding a true / false (boolean) property to any doctype with the alias sitemapExclude makes it possible to hide specific items from the sitemap.

All of the XML Sitemap v0.9 tag definitions can be modified by adding properties with specific aliases to any doctype:

Attribute Property alias
url url
lastmod updateDate
changefreq sitemapChangeFreq
priority sitemapPriority

Advanced configuration

It is possible to override the default configuration of the package using dependency injection, by registering a new instance of SitemapConfiguration within an IUserComposer class.

This is helpful for advanced configuration needs, such as defining unique settings per site in a multi-site Umbraco installation.

Here's an example:

using Our.Umbraco.FriendlySitemap.Startup;

[ComposeAfter(typeof(SitemapComposer))]
public class CustomSitemapComposer : IUserComposer
{
    public void Compose(Composition composition)
    {
        composition.Register(factory => GetConfiguration(), Lifetime.Request);
    }

    private SitemapConfiguration GetConfiguration()
    {
        var configuration = new SitemapConfiguration
        {
            EnableSitemap = true
        };

        return configuration;
    }
}

Contribution guidelines

To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the library.

Who do I talk to?

This project is maintained by Callum Whyte and contributors. If you have any questions about the project please get in touch on Twitter, or by raising an issue on GitHub.

Credits

The package logo uses the Sitemap icon from the Noun Project by Adrien Coquet, licensed under CC BY 3.0 US.

A special #h5yr to our contributors

License

Copyright © 2019 Callum Whyte, and other contributors

Licensed under the MIT License.

friendly-sitemap's People

Contributors

callumbwhyte avatar karltynan avatar aaronsadleruk avatar imranhaidercogworks avatar jasonelkin avatar nikrimington avatar

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.