All Projects → breakroom → sitemapper

breakroom / sitemapper

Licence: MIT license
Fast, stream based XML Sitemap generator in Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to sitemapper

sitemap
A simple sitemap generator for Laravel Framework.
Stars: ✭ 32 (+0%)
Mutual labels:  seo, sitemap-generator
seomate
SEO, mate! It's important. That's why SEOMate provides the tools you need to craft all the meta tags, sitemaps and JSON-LD microdata you need - in one highly configurable, open and friendly package - with a super-light footprint.
Stars: ✭ 31 (-3.12%)
Mutual labels:  seo, sitemaps
Sitemap Generator Cli
Creates an XML-Sitemap by crawling a given site.
Stars: ✭ 214 (+568.75%)
Mutual labels:  seo
Python For SEO
A 16-Part Free Course Demonstrating All Of The Different Ways That You Can Use Python To Improve Your SEO Processes.
Stars: ✭ 116 (+262.5%)
Mutual labels:  seo
Angular11 App
Angular 11 ,Bootstrap 5, Node.js, Express.js, CRUD REST API, PWA, SSR, SEO, Angular Universal, Lazy Loading, PostgreSQL, MYSQL
Stars: ✭ 233 (+628.13%)
Mutual labels:  seo
React Pwa
An upgradable boilerplate for Progressive web applications (PWA) with server side rendering, build with SEO in mind and achieving max page speed and optimized user experience.
Stars: ✭ 2,433 (+7503.13%)
Mutual labels:  seo
Next Seo
Next SEO is a plug in that makes managing your SEO easier in Next.js projects.
Stars: ✭ 4,149 (+12865.63%)
Mutual labels:  seo
Next Blog
基于react(ssr)服务端框架next.js和antd-design搭建的个人博客
Stars: ✭ 214 (+568.75%)
Mutual labels:  seo
svelte-seo
Optimize your website for search engines and social media with meta tags, Open Graph, and JSON-LD.
Stars: ✭ 257 (+703.13%)
Mutual labels:  seo
Redirect Module
No more cumbersome redirects!
Stars: ✭ 235 (+634.38%)
Mutual labels:  seo
ultimate-seo-checklist
The ultimate SEO Checklist made by people all around the globe
Stars: ✭ 31 (-3.12%)
Mutual labels:  seo
Laravelmetatags
The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project
Stars: ✭ 226 (+606.25%)
Mutual labels:  seo
Asqatasun
Mirror of Asqatasun ---> we've moved to GITLAB https://gitlab.com/asqatasun/Asqatasun - Opensource web site analyser, used for web accessibility "a11y"
Stars: ✭ 217 (+578.13%)
Mutual labels:  seo
Laravel Link Checker
Check all links in a Laravel application
Stars: ✭ 253 (+690.63%)
Mutual labels:  seo
Statamic Peak
Statamic Peak is an opinionated starter kit for all your Statamic sites.
Stars: ✭ 212 (+562.5%)
Mutual labels:  seo
seo-audits-toolkit
SEO & Security Audit for Websites. Lighthouse & Security Headers crawler, Sitemap/Keywords/Images Extractor, Summarizer, etc ...
Stars: ✭ 311 (+871.88%)
Mutual labels:  seo
Web Launch Checklist
📋 A simple website launch checklist to keep track of the most important enrichment possibilities for a website.
Stars: ✭ 214 (+568.75%)
Mutual labels:  seo
Vue Headful
Set document title and meta tags with Vue.js
Stars: ✭ 229 (+615.63%)
Mutual labels:  seo
Polyglot
🔤 Multilingual and i18n support tool for Jekyll Blogs
Stars: ✭ 242 (+656.25%)
Mutual labels:  seo
ngx-scully-blog
A simple blog made for developers that is easy to setup, supports SEO, Google Adsense, Google Analytics, Facebook Pixel, and many more
Stars: ✭ 36 (+12.5%)
Mutual labels:  seo

Sitemapper

Hex pm

Sitemapper is an Elixir library for generating XML Sitemaps.

It's designed to generate large sitemaps while maintaining a low memory profile. It can persist sitemaps to Amazon S3, disk or any other adapter you wish to write.

Installation

def deps do
  [
    {:sitemapper, "~> 0.6"}
  ]
end

Usage

  def generate_sitemap() do
    config = [
      store: Sitemapper.S3Store,
      store_config: [bucket: "example-bucket"],
      sitemap_url: "http://example-bucket.s3-aws-region.amazonaws.com"
    ]

    Stream.concat([1..100_001])
    |> Stream.map(fn i ->
      %Sitemapper.URL{
        loc: "http://example.com/page-#{i}",
        changefreq: :daily,
        lastmod: Date.utc_today()
      }
    end)
    |> Sitemapper.generate(config)
    |> Sitemapper.persist(config)
    |> Sitemapper.ping(config)
    |> Stream.run()
  end

Sitemapper.generate receives a Stream of URLs. This makes it easy to stream the contents of an Ecto Repo into a sitemap.

  def generate_sitemap() do
    config = [
      store: Sitemapper.S3Store,
      store_config: [bucket: "example-bucket"],
      sitemap_url: "http://example-bucket.s3-aws-region.amazonaws.com"
    ]

    Repo.transaction(fn ->
      User
      |> Repo.stream()
      |> Stream.map(fn %User{username: username, updated_at: updated_at} ->
        %Sitemapper.URL{
          loc: "http://example.com/users/#{username}",
          changefreq: :hourly,
          lastmod: updated_at
        }
      end)
      |> Sitemapper.generate(config)
      |> Sitemapper.persist(config)
      |> Sitemapper.ping(config)
      |> Stream.run()
    end)
  end

To persist your sitemaps to the local file system, instead of Amazon S3, your config should look like:

[
  store: Sitemapper.FileStore, 
  store_config: [
    path: sitemap_folder_path
  ]
]

Note that Sitemapper.ping/1 is not eager and you'll need to finish on Stream.run/1 or Enum.to_list/1 to execute the stream and return the result.

Todo

  • Support extended Sitemap properties, like images, video, etc.

Benchmarks

sitemapper is about 50% faster than fast_sitemap. In the large scenario below (1,000,000 URLs) sitemapper uses ~50MB peak memory consumption, while fast_sitemap uses ~1000MB.

$ MIX_ENV=bench mix run bench/bench.exs
Operating System: macOS
CPU Information: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.9.1
Erlang 22.0.4

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 10 s
memory time: 0 ns
parallel: 1
inputs: large, medium, small
Estimated total run time: 1.20 min

Benchmarking fast_sitemap - simple with input large...
Benchmarking fast_sitemap - simple with input medium...
Benchmarking fast_sitemap - simple with input small...
Benchmarking sitemapper - simple with input large...
Benchmarking sitemapper - simple with input medium...
Benchmarking sitemapper - simple with input small...

##### With input large #####
Name                            ips        average  deviation         median         99th %
sitemapper - simple          0.0353        28.32 s     ±0.00%        28.32 s        28.32 s
fast_sitemap - simple        0.0223        44.76 s     ±0.00%        44.76 s        44.76 s

Comparison:
sitemapper - simple          0.0353
fast_sitemap - simple        0.0223 - 1.58x slower +16.45 s

##### With input medium #####
Name                            ips        average  deviation         median         99th %
sitemapper - simple            0.35         2.85 s     ±0.57%         2.85 s         2.87 s
fast_sitemap - simple          0.23         4.28 s     ±0.46%         4.28 s         4.30 s

Comparison:
sitemapper - simple            0.35
fast_sitemap - simple          0.23 - 1.50x slower +1.43 s

##### With input small #####
Name                            ips        average  deviation         median         99th %
sitemapper - simple           32.00       31.25 ms     ±8.01%       31.20 ms       37.22 ms
fast_sitemap - simple         21.55       46.41 ms     ±6.96%       46.26 ms       56.36 ms

Comparison:
sitemapper - simple           32.00
fast_sitemap - simple         21.55 - 1.49x slower +15.16 ms
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].