forked from cockroachdb/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversions.rb
45 lines (42 loc) · 2.39 KB
/
versions.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This plugin manages docs versioning based on the following conventions. Docs
# for each non-patch release of CockroachDB--that is, each release of
# CockroachDB that has its own release branch in the cockroachdb/cockroach
# repository--are expected to be stored in a top-level directory named after
# that version. For example, docs for CockroachDB v19.1 are expected to be stored
# in a directory named `v19.1`. Docs which do not logically belong to one
# version, like release notes, are instead stored at the root of the repository.
#
# The name mappings under the `version` key in config.yml are used to build
# additional aliased versions (currently a `stable` and `dev` version).
# These are implemented as directory symlinks. For example, if `stable: v19.1`
# is specified, a symlink `stable -> v19.1` will be written to the
# build directory. The `stable` mapping is special and must exist, as
# `docs/FOO.html` will be automatically redirected to `docs/stable/FOO.html` for
# every FOO.md in the stable directory. Other name mappings are optional and can
# be added and removed at will.
#
# If a page is renamed, set `key: original-file-name.html` in its front matter
# so the version switcher can find its old versions.
#
# Each page has the following variables injected:
# `version` — the raw (non-logical) version of the page, like `v1.0`
# `release_info` — a hash with information about the latest release
# `versions` — a list of versions in which this page exists
# This list powers the version switcher. Each entry in the list has a
# human-friendly `name`, like "v19.1 (Stable)", a raw `version`, like
# "v19.1", and a `url` to the page in that version.
# `sidebar_data` — the name of the file containing the page's sidebar data
# Non-versioned pages use the `STABLE_VERSION`'s sidebar data.
# `canonical` — the relative URL of the stable version of the page, if any
Jekyll::External.require_with_graceful_fail('jekyll-redirect-from')
require_relative 'versions/symlink'
require_relative 'versions/version'
require_relative 'versions/versioned_page'
require_relative 'versions/generator'
# Silence annoying "directory is already being watched" warning due to harmless
# symlink usage.
# See: https://github.com/guard/listen/wiki/Duplicate-directory-errors
require 'listen/record/symlink_detector'
class Listen::Record::SymlinkDetector
def _fail(_, _); end
end