#resource.asset_path_typeSymbol

Indicates whether the asset is located in the :locale, the :global, the :convention, or an :other_dir folder. This can be useful to sort assets in a comparitor by priority if there are assets of the same name.

Returns:

  • (Symbol)

    :locale, :global, :convention, or :other_dir (in the event that it’s not expected).

#resource.breadcrumbsArray<Sitemap::Resource>

Returns an array of resources leading to this resource.

Returns:

  • (Array<Sitemap::Resource>)

    An array of resources.

#resource.brethrenArray<Sitemap::Resource>

Returns an array of all of the siblings of this page, taking into account their eligibility for display.

  • is not already the current page.
  • has a sort_order.
  • is not ignored.

The returned array will be sorted by each item’s sort_order.

Returns:

  • (Array<Sitemap::Resource>)

    An array of resources.

#resource.brethren_nextSitemap::Resource

Returns the next sibling based on order, or nil if there is no next sibling.

Returns:

  • (Sitemap::Resource)

    The resource instance of the next sibling.

#resource.brethren_previousSitemap::Resource

Returns the previous sibling based on order, or nil if there is no previous sibling.

Returns:

  • (Sitemap::Resource)

    The resource instance of the previous sibling.

#resource.group_countInteger

Returns the quantity of pages in the current page’s group, including this current page, i.e., the number of brethren + 1.

Returns:

  • (Integer)

    The total number of pages in the this page’s current group.

#resource.hb_localeString

Returns the locale for the current resource, based on which language.lproj directory it’s in, or nil if it’s not in one.

Returns:

  • (String)

    The locale.

#resource.hb_NavIdString

Returns the navigation ID suitable for use in the modern Help’s navigation.json file. It is either a topicId or sectionId, depending on whether the resource is a topic, or a section metadata resource.

Returns:

  • (String)

    The navigation ID of the current resource.

#resource.hb_PathString

Returns the path as it should be used in the help book navigation.json file, i.e., relative to the language.lproj directory. Note that this is incomplete for use in href attributes, which require this path to be accessed via a javascript value, e.g., #/hb_path.

Returns:

  • (String)

    The navigation ID of the current resource.

#resource.hb_redirect_pathString

Returns a path to this resource via the main file index.html file that runs the entire helpbook. Useful for redirecting naked pages in the site to index file for proper display in a meta refresh tag. For example, ../../index.html?localePath=en.lproj#/topic-sample_group_number_one-page_one Note that in this case, the link must be relative, because the Apple Help Viewer doesn’t seem to work with book-absolute paths.

Returns:

  • (String)

    Absolute path of this resource via index.html.

#resource.hb_Section?Boolean

Indicates whether or not a resource is a section entry for a modern Apple HelpBook.

Returns:

  • (Boolean)

    True if the resource represents a section heading.

#resource.legitimate?Boolean

Indicates whether or not a page is “legitimate” in terms of automatic navigation, based in:

  • The resource has a sort order and isn’t zero.
  • The resource isn’t ignored.

Returns:

  • (Boolean)

    Returns true if this pages participates in automatic navigation features.

#resource.legitimate_childrenArray<Sitemap::Resource>

Returns an array of all of the children of this resource, taking into account their eligibility for display. Each child is legitimate if it:

  • has a sort_order.
  • is not ignored.

The returned array will be sorted by each item’s sort_order.

Returns:

  • (Array<Sitemap::Resource>)

    An array of resources.

#resource.page_groupString

Make page_group available for each resource. Useful for for assigning classes, and/or group conditionals. The page group is the enclosing folder; if it’s a content index.html alone in a folder, then it’s the grandfather folder, in order to preserve topics when carrot.html becomes carrot/index.html.

Returns:

  • (String)

    The page_group of the current page.

#resource.page_nameString

Make page_name available for each resource. This is the file’s base name after any renaming has occurred, unless the file is a content index.html, in which case the name is the name of the containing folder. This ensures we keep the same name for cases such as carrot.html or carrot/index.html. Useful for assigning classes, etc.

Returns:

  • (String)

    The page_name of the current page.

#resource.page_sequenceInteger, Nil

Returns the page sequence amongst all of the brethren, and can be used as a page number surrogate. The first page is 1. Pages without a sort order will have a nil page_sequence.

Returns:

  • (Integer, Nil)

    The current page sequence of this resource among its brethren.

#resource.parentSitemap::Resource

Return the parent of the resource. This implementation corrects a bug in Middleman as of 4.1.7 wherein Middleman doesn’t return the parent if the the directory has been renamed for output.

Returns:

  • (Sitemap::Resource)

    The resource instance of the resource’s parent.

#resource.sort_orderInteger

Returns the page sort order or 0 if no page sort order was applied.

Pages without a sort order can still be linked to; they simply aren’t brethren or legitimate children, and so don’t participate in any of the automatic navigation features.

Returns:

  • (Integer)

    The current resource’s sort order within its group, or 0 if no sort order was applied.

#resource.word_frequenciesHash

Returns the word frequency hash for the content of the resource.

Returns:

  • (Hash)

    The :word => frequency content of the resource.