Code Monkey home page Code Monkey logo

bcms_seo_sitemap's Introduction

#Sitemaps Module for BrowserCMS

This is a simple module that generates a basic xml Sitemap for BrowserCMS projects. For each published page, it generates the loc tag according to the Sitemap protocol, but no metadata.

To determine which pages should be included in the Sitemap, it leverages BrowserCMS' menu_items helper. This means that hidden or unpublished pages will not be included. Empty sections are also ignored.

The xml document is exposed at /sitemaps/google.xml

Installation

The Seo Sitemap module installs like most other BrowserCMS modules. You'll also need to install the Settings module which Seo Sitemap uses to write configuration values. Setting up both modules at once is easy though:

gem install bcms_seo_sitemap # This will install the settings gem as well.

Set up your application to use the module

1. Edit config/environment.rb

config.gem "browsercms"
config.gem "bcms_settings"
config.gem "bcms_seo_sitemap"

2. Run the following commands

script/generate browser_cms
rake db:migrate

3. Edit config/routes.rb

Make sure the routes.rb loads the sitemap routes.

map.routes_for_bcms_seo_sitemap
map.routes_for_browser_cms

4. Add the following line to the browsercms.rb initializer

Cms::Settings.synchronize

##Configuration

The module adds a new entry under Administration > Tools labeled "Google Sitemap" where the module can be configured.

At the moment, only the "depth" option is available, which is passed to the menu_items helper method. Setting a depth of 2 will result in a call to menu_items like this:

menu_items(:depth => 2, :show_all_siblings => true, :page => Page.find_by_path('/')

The module's configuration (currently just one value) is written to a global key value store provided by the Settings module.

A depth value of 0 (the default) will include all published pages.

bcms_seo_sitemap's People

Contributors

alce avatar

Stargazers

 avatar

Watchers

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