File: console

package info (click to toggle)
ruby-jekyll-sitemap 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 384 kB
  • sloc: ruby: 365; xml: 39; sh: 19; makefile: 9
file content (35 lines) | stat: -rwxr-xr-x 697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /usr/bin/env ruby
# frozen_string_literal: true

def relative_to_root(path)
  File.expand_path(path, File.dirname(__dir__))
end

require "jekyll"
require relative_to_root("lib/jekyll-sitemap.rb")
require "pry-debugger"

SOURCE_DIR = relative_to_root("spec/fixtures")
DEST_DIR   = relative_to_root("spec/dest")

def source_dir(*files)
  File.join(SOURCE_DIR, *files)
end

def dest_dir(*files)
  File.join(DEST_DIR, *files)
end

def config(overrides = {})
  Jekyll.configuration(
    "source"      => source_dir,
    "destination" => dest_dir,
    "url"         => "http://example.org"
  ).merge(overrides)
end

def site(configuration = config)
  Jekyll::Site.new(configuration)
end

binding.pry