Sha256: 9e5b9972a7237078b6954e399902b6f45aa60dc156c92c3081d089e40c7f9dda

Contents?: true

Size: 867 Bytes

Versions: 4

Compression:

Stored size: 867 Bytes

Contents

# encoding: utf-8

usage       'validate-links [options]'
aliases     :validate_links, :vlink
summary     'validate links in site'
description <<-EOS
Validates the site’s links. By default, both internal and external links will be checked.
EOS

flag   :i, :internal, 'validate internal links only'
flag   :e, :external, 'validate external links only'

module Nanoc::CLI::Commands

  class ValidateLinks < ::Nanoc::CLI::CommandRunner

    def run
      require_site

      dir             = site.config[:output_dir]
      index_filenames = site.config[:index_filenames]

      validator = ::Nanoc::Extra::Validators::Links.new(
        dir,
        index_filenames,
        :internal => (options[:external] ? false : true),
        :external => (options[:internal] ? false : true))
      validator.run
    end

  end

end

runner Nanoc::CLI::Commands::ValidateLinks

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-3.4.3 lib/nanoc/cli/commands/validate-links.rb
nanoc-3.4.2 lib/nanoc/cli/commands/validate-links.rb
nanoc-3.4.1 lib/nanoc/cli/commands/validate-links.rb
nanoc-3.4.0 lib/nanoc/cli/commands/validate-links.rb