Module: Yuzu::Core

Included in:
Filters
Defined in:
lib/yuzu/core/config.rb,
lib/yuzu/core/layout.rb,
lib/yuzu/core/updater.rb,
lib/yuzu/core/visitor.rb,
lib/yuzu/core/siteroot.rb,
lib/yuzu/core/template.rb,
lib/yuzu/core/website_base.rb,
lib/yuzu/core/website_file.rb,
lib/yuzu/core/paginated_file.rb,
lib/yuzu/core/website_folder.rb

Defined Under Namespace

Classes: Config, FileProperties, HamlTemplate, Layout, PageLayout, PaginatedWebsiteFile, SiteRoot, Template, TemplateMethods, Updater, Visitor, WebsiteBase, WebsiteFile, WebsiteFolder

Constant Summary collapse

BOLD =
"\033[1m"
WHITE =
"\033[37m"
ENDC =
"\033[0m"

Class Method Summary collapse

Class Method Details

.get_paginated_path(original_path, page) ⇒ Path

Calculate the page of this file, assuming it’s a file produced from pagination.

Parameters:

  • original_path (Path)

    The path of the original seed file being paginated.

  • page (Fixnum)

    The page of the new file.

Returns:

  • (Path)

    The new path in the format path/to/file_N.ext where N is the page number.



59
60
61
62
63
64
65
66
# File 'lib/yuzu/core/paginated_file.rb', line 59

def get_paginated_path(original_path, page)
  new_path = original_path.dup
  new_path.make_file!
  tr = new_path.add_suffix(page)
  raise "New path is nil!" if tr.nil?
  tr.make_file!
  tr
end