Pagefind (pagefind v0.1.0)

Pagefind is an installer and runner for Pagefind

It will always download the pagefind_extended release, which includes specialized support for indexing Chinese and Japanese pages.

Pagefind configuration

There are the global configurations for the pagefind application:

  • :version - the expected pagefind version, defaults to 1.3.0 the latest known version at the time of publishing this package.

  • :path - the path to find the pagefind executable at. By default, it is automatically downloaded and placed inside the _build directory of your current app

  • :target - the target architecture for the pagefind executable. For example "x86_64-unknown-linux-musl". By default, it is automatically detected based on system information.

  • :args - the default arguments to pass to the pagefind executable. By default, it is an empty list. Read the pagefind documentation for more information on the available arguments.

  • :env - optional environment variables to pass to the pagefind executable.

    config :pagefind,
      args: ~w(
        --site _site
      ),
      env: %{"PAGEFIND_OUTPUT_SUBDIR" => "pagefind"}

Overriding the :path is not recommended, as we will automatically download and manage pagefind for you. But in case you can't download it (for example, GitHub behind a proxy), you may want to set the :path to a configurable system location.

You can check the pagefind docs for more information on how to install it.

  config :pagefind, path: "/path/to/pagefind"

Summary

Functions

Returns the path to the executable.

Returns the version of the pagefind executable.

Returns the configured pagefind target. By default, it is automatically detected.

Returns the configured pagefind version.

The default URL to install Pagefind from.

Installs, if not available, and then runs pagefind.

Runs the given command with args.

Functions

bin_path()

Returns the path to the executable.

The executable may not be available if it was not yet installed.

bin_version()

Returns the version of the pagefind executable.

Returns {:ok, version_string} on success or :error when the executable is not available.

configured_target()

Returns the configured pagefind target. By default, it is automatically detected.

configured_version()

Returns the configured pagefind version.

default_base_url()

The default URL to install Pagefind from.

install(base_url \\ default_base_url())

Installs pagefind with configured_version/0.

install_and_run(args)

Installs, if not available, and then runs pagefind.

Returns the same as run/1.

run(extra_args)

Runs the given command with args.

The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.