Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple_sitemap

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple_sitemap

  • 0.3.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SimpleSitemap

A simple sitemap generator

Basic Usage

Configure

SimpleSitemap.configure do |config|
  config.local_path = 'public/sitemaps/'
  config.default_path = 'http://yoursite.com'
  config.sitemap_location = 'http://yoursite.com/sitemaps'
end

Build your sitemap

SimpleSitemap.build do
  add_path 'home'
  add_path 'about'
  sitemap 'ryan' do
    6.times do |i|
      add_url i, priority: 0.5
    end
  end
  sitemap 'lower' do
    5.times do |i|
      add_url i
    end
  end
  sitemap 'ryan' do
    6.times do |i|
      add_path i, priority: 1.0
    end
  end
  add_url 'http://signup.yoursite.com'
  add_path 'login'
end

Hooks

SimpleSitemap gives you a after_write hook for easy access to sitemap files as they are written.

For example, to upload sitmaps to S3

require 'fog'
SimpleSitemap.after_write do |filename|
  s3 = Fog::Storage.new({
    provider: 'AWS',
    aws_access_key_id: 'YOUR_AWS_KEY',
    aws_secret_access_key: 'YOUR_AWS_SECRET'
  })
  bucket = s3.directories.first
  bucket.files.create(
    :key => File.basename(filename),
    :body => open(filename),
    :public => true
  )
end

FAQs

Package last updated on 06 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc