Options
All
  • Public
  • Public/Protected
  • All
Menu

Creates a full URL from a URL fragment by matching the values in the sitemap. If multiple values are found, the closet one is selected.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private absoluteUrl

absoluteUrl: string

The absolute url to the page to be used in links.

Private anchors

anchors: string

Anchors found in the fragment url as separated by the symbol #.

Protected config

config: YassbConfig

Full config options

Protected directiveFullString

directiveFullString: string

Directive full string found in the file

Protected fileContents

fileContents: string

File contents there the yassb directive was found

Protected fileFullPath

fileFullPath: string

Full path to the file being processed

Private foundUrl

foundUrl: string

The full path found in the sitemap.

Private kebabFragment

kebabFragment: string

Url fragment in kebab case (kebab-case) to more easily match filenames.

Protected lang

lang: string

Lang being processed

Private sitemap

sitemap: XmlSitemap

The sitemap used to match the url fragment.

Private snakeFragment

snakeFragment: string

Url fragment in snake case (kebab_case) to more easily match filenames.

Private urlFragment

urlFragment: string

Url fragment passed to the variable. It can be the full url or just few characters.

Static regex

regex: RegExp = /{{\s*url-to\s*=\s*".*?"\s*\s*}}/g

Regex to match the comments to invoke the directive.

Methods

Private error

  • error(text: string): string
  • On error removes the directive from the fileContents to avoid issues.

    Parameters

    • text: string

      text of the error to be displayed in console.

    Returns string

    the fileContent cleaned from the directiveFullString.

Private findUrl

  • findUrl(): void
  • Looks for the url fragment in the sitemap. If multiple results are found selects the first. If nothing is found it returns without setting the value of foundUrl.

    Returns void

init

Private pickTheFullUrl

  • pickTheFullUrl(finds: Array<string>): void

Private setAbsoluteUrl

  • setAbsoluteUrl(): void

Private setAnchors

  • setAnchors(): void

Private setKebab

  • setKebab(): void

Private setSitemap

  • setSitemap(): void

Private setSnake

  • setSnake(): void

Private setUrlFragment

  • setUrlFragment(): void

Object literals

Private options

options: object

Options for url-to. Warning: deafult true. If false, the warning of multiple matches is suppressed.

warning

warning: true = true