github.com/hashicorp/packer@v1.14.3/website/README.md (about)

     1  # Packer Documentation Website
     2  
     3  This subdirectory contains the content for the [Packer documentation website](https://developer.hashicorp.com/packer/docs).
     4  
     5  <!--
     6    This readme file contains several blocks of generated text, to make it easier to share common information
     7    across documentation website readmes. To generate these blocks from their source, run `npm run generate:readme`
     8  
     9    Any edits to the readme are welcome outside the clearly noted boundaries of the blocks. Alternately, a
    10    block itself can be safely "forked" from the central implementation simply by removing the "BEGIN" and
    11    "END" comments from around it.
    12  -->
    13  
    14  ## Table of Contents
    15  
    16  - [Contributions](#contributions-welcome)
    17  - [Running the Site Locally](#running-the-site-locally)
    18  - [Editing Markdown Content](#editing-markdown-content)
    19  - [Editing Navigation Sidebars](#editing-navigation-sidebars)
    20  - [Changing the Release Version](#changing-the-release-version)
    21  - [Link Validation](#link-validation)
    22  - [Redirects](#redirects)
    23  - [Browser Support](#browser-support)
    24  - [Deployment](#deployment)
    25  
    26  <!-- BEGIN: contributions -->
    27  <!-- Generated text, do not edit directly -->
    28  
    29  ## Contributions Welcome!
    30  
    31  If you find a typo or you feel like you can improve the HTML, CSS, or JavaScript, we welcome contributions. Feel free to open issues or pull requests like any normal GitHub project, and we'll merge it in 🚀
    32  
    33  <!-- END: contributions -->
    34  
    35  <!-- BEGIN: local-development -->
    36  <!-- Generated text, do not edit directly -->
    37  
    38  ## Running the Site Locally
    39  
    40  The website can be run locally through node.js or [Docker](https://www.docker.com/get-started). If you choose to run through Docker, everything will be a little bit slower due to the additional overhead, so for frequent contributors it may be worth it to use node.
    41  
    42  > **Note:** If you are using a text editor that uses a "safe write" save style such as **vim** or **goland**, this can cause issues with the live reload in development. If you turn off safe write, this should solve the problem. In vim, this can be done by running `:set backupcopy=yes`. In goland, search the settings for "safe write" and turn that setting off.
    43  
    44  ### With Docker
    45  
    46  Running the site locally is simple. Provided you have Docker installed, clone this repo, run `make`, and then visit `http://localhost:3000`.
    47  
    48  The Docker image is pre-built with all the website dependencies installed, which is what makes it so quick and simple, but also means if you need to change dependencies and test the changes within Docker, you'll need a new image. If this is something you need to do, you can run `make build-image` to generate a local Docker image with updated dependencies, then `make website-local` to use that image and preview.
    49  
    50  ### With Node
    51  
    52  If your local development environment has a supported version (v22+) of [node installed](https://nodejs.org/en/) you can run:
    53  
    54  - `npm install`
    55  - `npm start`
    56  
    57  ...and then visit `http://localhost:3000`.
    58  
    59  If you pull down new code from GitHub, you should run `npm install` again. Otherwise, there's no need to re-run `npm install` each time the site is run, you can just run `npm start` to get it going.
    60  
    61  <!-- END: local-development -->
    62  
    63  <!-- BEGIN: editing-markdown -->
    64  <!-- Generated text, do not edit directly -->
    65  
    66  ## Editing Markdown Content
    67  
    68  Documentation content is written in [Markdown](https://www.markdownguide.org/cheat-sheet/) and you'll find all files listed under the `/content` directory.
    69  
    70  To create a new page with Markdown, create a file ending in `.mdx` in a `content/<subdirectory>`. The path in the content directory will be the URL route. For example, `content/docs/hello.mdx` will be served from the `/docs/hello` URL.
    71  
    72  > **Important**: Files and directories will only be rendered and published to the website if they are [included in sidebar data](#editing-navigation-sidebars). Any file not included in sidebar data will not be rendered or published.
    73  
    74  This file can be standard Markdown and also supports [YAML frontmatter](https://middlemanapp.com/basics/frontmatter/). YAML frontmatter is optional, there are defaults for all keys.
    75  
    76  ```yaml
    77  ---
    78  title: 'My Title'
    79  description: "A thorough, yet succinct description of the page's contents"
    80  ---
    81  ```
    82  
    83  The significant keys in the YAML frontmatter are:
    84  
    85  - `title` `(string)` - This is the title of the page that will be set in the HTML title.
    86  - `description` `(string)` - This is a description of the page that will be set in the HTML description.
    87  
    88  > ⚠️ If there is a need for a `/api/*` url on this website, the url will be changed to `/api-docs/*`, as the `api` folder is reserved by next.js.
    89  
    90  ### Validating Content
    91  
    92  Content changes are automatically validated against a set of rules as part of the pull request process. If you want to run these checks locally to validate your content before committing your changes, you can run the following command:
    93  
    94  ```
    95  npm run content-check
    96  ```
    97  
    98  If the validation fails, actionable error messages will be displayed to help you address detected issues.
    99  
   100  ### Creating New Pages
   101  
   102  There is currently a small bug with new page creation - if you create a new page and link it up via subnav data while the server is running, it will report an error saying the page was not found. This can be resolved by restarting the server.
   103  
   104  ### Markdown Enhancements
   105  
   106  There are several custom Markdown plugins that are available by default that enhance [standard markdown](https://commonmark.org/) to fit our use cases. This set of plugins introduces a couple instances of custom syntax, and a couple specific pitfalls that are not present by default with markdown, detailed below:
   107  
   108  - > **Warning**: We are deprecating the current [paragraph alerts](https://github.com/hashicorp/remark-plugins/tree/master/plugins/paragraph-custom-alerts#paragraph-custom-alerts), in favor of the newer [MDX Inline Alert](#inline-alerts) components. The legacy paragraph alerts are represented by the symbols `~>`, `->`, `=>`, or `!>`.
   109  - If you see `@include '/some/path.mdx'`, this is a [markdown include](https://github.com/hashicorp/remark-plugins/tree/master/plugins/include-markdown#include-markdown-plugin). It's worth noting as well that all includes resolve from `website/content/partials` by default, and that changes to partials will not live-reload the website.
   110  - If you see `# Headline ((#slug))`, this is an example of an [anchor link alias](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-link-aliases). It adds an extra permalink to a headline for compatibility and is removed from the output.
   111  - Due to [automatically generated permalinks](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-links), any text changes to _headlines_ or _list items that begin with inline code_ can and will break existing permalinks. Be very cautious when changing either of these two text items.
   112  
   113    Headlines are fairly self-explanatory, but here's an example of how to list items that begin with inline code look.
   114  
   115    ```markdown
   116    - this is a normal list item
   117    - `this` is a list item that begins with inline code
   118    ```
   119  
   120    Its worth noting that _only the inline code at the beginning of the list item_ will cause problems if changed. So if you changed the above markup to...
   121  
   122    ```markdown
   123    - lsdhfhksdjf
   124    - `this` jsdhfkdsjhkdsfjh
   125    ```
   126  
   127    ...while it perhaps would not be an improved user experience, no links would break because of it. The best approach is to **avoid changing headlines and inline code at the start of a list item**. If you must change one of these items, make sure to tag someone from the digital marketing development team on your pull request, they will help to ensure as much compatibility as possible.
   128  
   129  ### Custom Components
   130  
   131  A number of custom [mdx components](https://mdxjs.com/) are available for use within any `.mdx` file. Each one is documented below:
   132  
   133  #### Inline Alerts
   134  
   135  There are custom MDX components available to author alert data. [See the full documentation here](https://developer.hashicorp.com/swingset/components/mdxinlinealert). They render as colored boxes to draw the user's attention to some type of aside.
   136  
   137  ```mdx
   138  ## Alert types
   139  
   140  ### Tip
   141  
   142  <Tip>
   143    To provide general information to the user regarding the current context or
   144    relevant actions.
   145  </Tip>
   146  
   147  ### Highlight
   148  
   149  <Highlight>
   150    To provide general or promotional information to the user prominently.
   151  </Highlight>
   152  
   153  ### Note
   154  
   155  <Note>
   156    To help users avoid an issue. Provide guidance and actions if possible.
   157  </Note>
   158  
   159  ### Warning
   160  
   161  <Warning>
   162    To indicate critical issues that need immediate action or help users
   163    understand something critical.
   164  </Warning>
   165  
   166  ## Title override prop
   167  
   168  <Note title="Hashiconf 2027">To provide general information.</Note>
   169  ```
   170  
   171  #### Tabs
   172  
   173  The `Tabs` component creates tabbed content of any type, but is often used for code examples given in different languages. Here's an example of how it looks from the Vagrant documentation website:
   174  
   175  ![Tabs Component](https://p176.p0.n0.cdn.getcloudapp.com/items/WnubALZ4/Screen%20Recording%202020-06-11%20at%2006.03%20PM.gif?v=1de81ea720a8cc8ade83ca64fb0b9edd)
   176  
   177  > Please refer to the [Swingset](https://react-components.vercel.app/?component=Tabs) documentation for the latest examples and API reference.
   178  
   179  It can be used as such within a markdown file:
   180  
   181  ````mdx
   182  Normal **markdown** content.
   183  
   184  <Tabs>
   185  <Tab heading="CLI command">
   186              <!-- Intentionally skipped line.. -->
   187  ```shell-session
   188  $ command ...
   189  ```
   190              <!-- Intentionally skipped line.. -->
   191  </Tab>
   192  <Tab heading="API call using cURL">
   193  
   194  ```shell-session
   195  $ curl ...
   196  ```
   197  
   198  </Tab>
   199  </Tabs>
   200  
   201  Continued normal markdown content
   202  ````
   203  
   204  The intentionally skipped line is a limitation of the mdx parser which is being actively worked on. All tabs must have a heading, and there is no limit to the number of tabs, though it is recommended to go for a maximum of three or four.
   205  
   206  #### Enterprise Alert
   207  
   208  This component provides a standard way to call out functionality as being present only in the enterprise version of the software. It can be presented in two contexts, inline or standalone. Here's an example of standalone usage from the Consul docs website:
   209  
   210  ![Enterprise Alert Component - Standalone](https://p176.p0.n0.cdn.getcloudapp.com/items/WnubALp8/Screen%20Shot%202020-06-11%20at%206.06.03%20PM.png?v=d1505b90bdcbde6ed664831a885ea5fb)
   211  
   212  The standalone component can be used as such in markdown files:
   213  
   214  ```mdx
   215  # Page Headline
   216  
   217  <EnterpriseAlert />
   218  
   219  Continued markdown content...
   220  ```
   221  
   222  It can also receive custom text contents if you need to change the messaging but wish to retain the style. This will replace the text `This feature is available in all versions of Consul Enterprise.` with whatever you add. For example:
   223  
   224  ```mdx
   225  # Page Headline
   226  
   227  <EnterpriseAlert>
   228    My custom text here, and <a href="#">a link</a>!
   229  </EnterpriseAlert>
   230  
   231  Continued markdown content...
   232  ```
   233  
   234  It's important to note that once you are adding custom content, it must be html and can not be markdown, as demonstrated above with the link.
   235  
   236  Now let's look at inline usage, here's an example:
   237  
   238  ![Enterprise Alert Component - Inline](https://p176.p0.n0.cdn.getcloudapp.com/items/L1upYLEJ/Screen%20Shot%202020-06-11%20at%206.07.50%20PM.png?v=013ba439263de8292befbc851d31dd78)
   239  
   240  And here's how it could be used in your Markdown document:
   241  
   242  ```mdx
   243  ### Some Enterprise Feature <EnterpriseAlert inline />
   244  
   245  Continued markdown content...
   246  ```
   247  
   248  It's also worth noting that this component will automatically adjust to the correct product colors depending on the context.
   249  
   250  #### Other Components
   251  
   252  Other custom components can be made available on a per-site basis, the above are the standards. If you have questions about custom components that are not documented here, or have a request for a new custom component, please reach out to @hashicorp/digital-marketing.
   253  
   254  ### Syntax Highlighting
   255  
   256  When using fenced code blocks, the recommendation is to tag the code block with a language so that it can be syntax highlighted. For example:
   257  
   258  ````
   259  ```
   260  // BAD: Code block with no language tag
   261  ```
   262  
   263  ```javascript
   264  // GOOD: Code block with a language tag
   265  ```
   266  ````
   267  
   268  Check out the [supported languages list](https://prismjs.com/#supported-languages) for the syntax highlighter we use if you want to double-check the language name.
   269  
   270  It is also worth noting specifically that if you are using a code block that is an example of a terminal command, the correct language tag is `shell-session`. For example:
   271  
   272  🚫**BAD**: Using `shell`, `sh`, `bash`, or `plaintext` to represent a terminal command
   273  
   274  ````
   275  ```shell
   276  $ terraform apply
   277  ```
   278  ````
   279  
   280  ✅**GOOD**: Using `shell-session` to represent a terminal command
   281  
   282  ````
   283  ```shell-session
   284  $ terraform apply
   285  ```
   286  ````
   287  
   288  <!-- END: editing-markdown -->
   289  
   290  <!-- BEGIN: editing-docs-sidebars -->
   291  <!-- Generated text, do not edit directly -->
   292  
   293  ## Editing Navigation Sidebars
   294  
   295  The structure of the sidebars are controlled by files in the [`/data` directory](data). For example, [data/docs-nav-data.json](data/docs-nav-data.json) controls the **docs** sidebar. Within the `data` folder, any file with `-nav-data` after it controls the navigation for the given section.
   296  
   297  The sidebar uses a simple recursive data structure to represent _files_ and _directories_. The sidebar is meant to reflect the structure of the docs within the filesystem while also allowing custom ordering. Let's look at an example. First, here's our example folder structure:
   298  
   299  ```text
   300  .
   301  ├── docs
   302  │   └── directory
   303  │       ├── index.mdx
   304  │       ├── file.mdx
   305  │       ├── another-file.mdx
   306  │       └── nested-directory
   307  │           ├── index.mdx
   308  │           └── nested-file.mdx
   309  ```
   310  
   311  Here's how this folder structure could be represented as a sidebar navigation, in this example it would be the file `website/data/docs-nav-data.json`:
   312  
   313  ```json
   314  [
   315    {
   316      "title": "Directory",
   317      "routes": [
   318        {
   319          "title": "Overview",
   320          "path": "directory"
   321        },
   322        {
   323          "title": "File",
   324          "path": "directory/file"
   325        },
   326        {
   327          "title": "Another File",
   328          "path": "directory/another-file"
   329        },
   330        {
   331          "title": "Nested Directory",
   332          "routes": [
   333            {
   334              "title": "Overview",
   335              "path": "directory/nested-directory"
   336            },
   337            {
   338              "title": "Nested File",
   339              "path": "directory/nested-directory/nested-file"
   340            }
   341          ]
   342        }
   343      ]
   344    }
   345  ]
   346  ```
   347  
   348  A couple more important notes:
   349  
   350  - Within this data structure, ordering is flexible, but hierarchy is not. The structure of the sidebar must correspond to the structure of the content directory. So while you could put `file` and `another-file` in any order in the sidebar, or even leave one or both of them out, you could not decide to un-nest the `nested-directory` object without also un-nesting it in the filesystem.
   351  - The `title` property on each node in the `nav-data` tree is the human-readable name in the navigation.
   352  - The `path` property on each leaf node in the `nav-data` tree is the URL path where the `.mdx` document will be rendered, and the
   353  - Note that "index" files must be explicitly added. These will be automatically resolved, so the `path` value should be, as above, `directory` rather than `directory/index`. A common convention is to set the `title` of an "index" node to be `"Overview"`.
   354  
   355  Below we will discuss a couple of more unusual but still helpful patterns.
   356  
   357  ### Index-less Categories
   358  
   359  Sometimes you may want to include a category but not have a need for an index page for the category. This can be accomplished, but as with other branch and leaf nodes, a human-readable `title` needs to be set manually. Here's an example of how an index-less category might look:
   360  
   361  ```text
   362  .
   363  ├── docs
   364  │   └── indexless-category
   365  │       └── file.mdx
   366  ```
   367  
   368  ```json
   369  // website/data/docs-nav-data.json
   370  [
   371    {
   372      "title": "Indexless Category",
   373      "routes": [
   374        {
   375          "title": "File",
   376          "path": "indexless-category/file"
   377        }
   378      ]
   379    }
   380  ]
   381  ```
   382  
   383  ### Custom or External Links
   384  
   385  Sometimes you may have a need to include a link that is not directly to a file within the docs hierarchy. This can also be supported using a different pattern. For example:
   386  
   387  ```json
   388  [
   389    {
   390      "name": "Directory",
   391      "routes": [
   392        {
   393          "title": "File",
   394          "path": "directory/file"
   395        },
   396        {
   397          "title": "Another File",
   398          "path": "directory/another-file"
   399        },
   400        {
   401          "title": "Tao of HashiCorp",
   402          "href": "https://www.hashicorp.com/tao-of-hashicorp"
   403        }
   404      ]
   405    }
   406  ]
   407  ```
   408  
   409  If the link provided in the `href` property is external, it will display a small icon indicating this. If it's internal, it will appear the same way as any other direct file link.
   410  
   411  <!-- END: editing-docs-sidebars -->
   412  
   413  ### Plugin Docs
   414  
   415  Plugin documentation may be located within the `packer` repository, or split out into separate `packer-plugin-` repositories. For plugin docs within the `packer` repository, the process for authoring files and managing sidebar data is identical to the process for other documentation.
   416  
   417  For plugins in separate repositories, additional configuration is required.
   418  
   419  #### Setting up remote plugin docs
   420  
   421  Some setup is required to include docs from remote plugin repositories on the [developer.hashicorp.com/packer/docs](https://developer.hashicorp.com/packer) site.
   422  
   423  1. The plugin repository needs to include a `docs.zip` asset in its release
   424  2. The `packer` repository must have a corresponding entry in `website/data/docs-remote-plugins.json` which points to the plugin repository.
   425  
   426  The `docs.zip` release asset is expected to be generated as part of the standard release process for `packer-plugin-*` repositories. Additional details on this process can be found in [the `packer-plugin-scaffolding` `README`](https://github.com/hashicorp/packer-plugin-scaffolding#registering-documentation-on-packerio).
   427  
   428  The `docs-remote-plugins.json` file contains an array of entries. Each entry points to a plugin repository. The `{ title, path, repo, version }` properties are required for each entry.
   429  
   430  ```json5
   431  [
   432    {
   433      // ALL FIELDS ARE REQUIRED.
   434      // "title" sets the human-readable title shown in navigation
   435      title: 'Scaffolding',
   436      // "path" sets the URL subpath under the component URL (eg `docs/builders`)
   437      path: 'scaffolding',
   438      // "repo" points to the plugin repo, in the format "organization/repo-name"
   439      // if the organization == hashicorp, the plugin docs will be labelled "official".
   440      // for all other organizations or users, plugin docs will be labelled "community".
   441      repo: 'hashicorp/packer-plugin-scaffolding',
   442      // "version" is used to fetch "docs.zip" from the matching tagged release.
   443      // version: "latest" is permitted, but please be aware that it
   444      // may fetch incompatible or unintended versions of plugin docs.
   445      // if version is NOT "latest", and if "docs.zip" is unavailable, then
   446      // we fall back to fetching docs from the source "{version}.zip"
   447      version: 'v0.0.5',
   448    },
   449  ]
   450  ```
   451  
   452  #### Updating remote plugin docs
   453  
   454  Documentation from plugin repositories is fetched and rendered every time the Packer website builds. So, to update plugin documentation on the live site:
   455  
   456  1. In the plugin repository, publish a new release that includes a `docs.zip` release asset
   457  2. In the `packer` repository, update `website/data/docs-remote-plugins.json` to ensure the corresponding entry points to the correct release `version` (which should correspond to the release's tag name). This may not be necessary if the `version` is set to `"latest"`.
   458  3. Rebuild the website. This will happen automatically on commits to `stable-website`. In exceptional cases, the site can also be [manually re-deployed through Vercel](https://vercel.com/hashicorp/packer).
   459  
   460  <!-- BEGIN: releases -->
   461  <!-- Generated text, do not edit directly -->
   462  
   463  ## Changing the Release Version
   464  
   465  To change the version displayed for download on the website, head over to `data/version.js` and change the number there. It's important to note that the version number must match a version that has been released and is live on `releases.hashicorp.com` -- if it does not, the website will be unable to fetch links to the binaries and will not compile. So this version number should be changed _only after a release_.
   466  
   467  ### Displaying a Prerelease
   468  
   469  If there is a prerelease of any type that should be displayed on the downloads page, this can be done by editing `pages/downloads/index.jsx`. By default, the download component might look something like this:
   470  
   471  ```jsx
   472  <ProductDownloader
   473    product="<Product>"
   474    version={VERSION}
   475    downloads={downloadData}
   476    community="/resources"
   477  />
   478  ```
   479  
   480  To add a prerelease, an extra `prerelease` property can be added to the component as such:
   481  
   482  ```jsx
   483  <ProductDownloader
   484    product="<Product>"
   485    version={VERSION}
   486    downloads={downloadData}
   487    community="/resources"
   488    prerelease={{
   489      type: 'release candidate', // the type of prerelease: beta, release candidate, etc.
   490      name: 'v1.0.0', // the name displayed in text on the website
   491      version: '1.0.0-rc1', // the actual version tag that was pushed to releases.hashicorp.com
   492    }}
   493  />
   494  ```
   495  
   496  This configuration would display something like the following text on the website, emphasis added to the configurable parameters:
   497  
   498  ```
   499  A {{ release candidate }} for <Product> {{ v1.0.0 }} is available! The release can be <a href='https://releases.hashicorp.com/<product>/{{ 1.0.0-rc1 }}'>downloaded here</a>.
   500  ```
   501  
   502  You may customize the parameters in any way you'd like. To remove a prerelease from the website, simply delete the `prerelease` parameter from the above component.
   503  
   504  <!-- END: releases -->
   505  
   506  <!--
   507  
   508  NOTE: The "Redirects" section is forked from redirects.
   509  
   510  There are minor changes related to sidebar navigation format changes.
   511  
   512  We plan on rolling these changes back into our "readme partials" source once all docs sites
   513  have been transitioned to the JSON navigation format. See MKTG_032 for details:
   514  
   515  https://docs.google.com/document/d/1kYvbyd6njHFSscoE1dtDNHQ3U8IzaMdcjOS0jg87rHg/
   516  
   517  -->
   518  
   519  ## Link Validation
   520  
   521  The Packer GitHub repository is configured to run a [Markdown Link Check](https://github.com/gaurav-nelson/github-action-markdown-link-check#github-action---markdown-link-check-%EF%B8%8F) on a nightly basis to check for potential broken links within the Packer documentation. All checks on master will be executed using the BASE_URL set to https://developer.hashicorp.com.
   522  
   523  There is also a GitHub action that will check any modified `website/content/**/*.mdx` files on new pull-requests. The link checker action for pull-requests will only run when there is a new Vercel deployment; checks will be executed against the Vercel deployment URL. If no deployment is made the check will run but will timeout after 3 minutes since it needs a valid Vercel deployment URL.
   524  
   525  The master configuration file for the markdown-link-checker is called `mlc_config.json` and is located under the project's root directory.
   526  The configuration helps with relative links in the documentation that will be valid once deployed, and configures a few ignored URLs which are valid but may not return a valid 200 HTTP response code due to permissions or DDoS protection settings on the domain.
   527  
   528  **Potential False Negatives**
   529  The link checker will prepend the BASEURL `https://developer.hashicorp.com` to any relative links found within the documentation, which can be an issue when adding new `/packer/docs` or `/packer/guides` documents as the pages have not been deployed. To help mitigate this issue check the site preview to ensure newly added documentation pages work as expected.
   530  
   531  ## Redirects
   532  
   533  This website structures URLs based on the filesystem layout. This means that if a file is moved, removed, or a folder is re-organized, links will break. If a path change is necessary, it can be mitigated using redirects.
   534  
   535  To add a redirect, head over to the `_redirects` file - the format is fairly simple. On the left is the current path, and on the right is the path that should be redirected to. It's important to note that if there are links to a `.html` version of a page, that must also be explicitly redirected. For example:
   536  
   537  ```
   538  /foo       /bar   301!
   539  /foo.html  /bar   301!
   540  ```
   541  
   542  This redirect rule will send all incoming links to `/foo` and `/foo.html` to `/bar`. For more details on the redirects file format, [check out the docs on netlify](https://docs.netlify.com/routing/redirects/rewrites-proxies). Note that it is critical that `301!` is added to every one-to-one redirect - if it is left off the redirect may not work.
   543  
   544  There are a couple important caveats with redirects. First, redirects are applied at the hosting layer, and therefore will not work by default in local dev mode. To test in local dev mode, you can use [`netlify dev`](https://www.netlify.com/products/dev/), or just push a commit and check using the deploy preview.
   545  
   546  Second, redirects do not apply to client-side navigation. By default, all links in the navigation and docs sidebar will navigate purely on the client side, which makes navigation through the docs significantly faster, especially for those with low-end devices and/or weak internet connections. In the future, we plan to convert all internal links within docs pages to behave this way as well. This means that if there is a link on this website to a given piece of content that has changed locations in some way, we need to also _directly change existing links to the content_. This way, if a user clicks a link that navigates on the client side, or if they hit the url directly and the page renders from the server side, either one will work perfectly.
   547  
   548  Let's look at an example. Say you have a page called `/docs/foo` which needs to be moved to `/docs/nested/foo`. Additionally, this is a page that has been around for a while and we know there are links into `/docs/foo.html` left over from our previous website structure. First, we move the page, then adjust the docs sidenav, in `data/docs-nav-data.json`. Find the category the page is in, and move it into the appropriate subcategory. Next, we add to `_redirects` as such:
   549  
   550  ```
   551  /foo       /nested/foo  301!
   552  /foo.html  /nested/foo  301!
   553  ```
   554  
   555  Finally, we run a global search for internal links to `/foo`, and make sure to adjust them to be `/nested/foo` - this is to ensure that client-side navigation still works correctly. _Adding a redirect alone is not enough_.
   556  
   557  One more example - let's say that content is being moved to an external website. A common example is guides moving to `learn.hashicorp.com`. In this case, we take all the same steps, except that we need to make a different type of change to the `docs-nav-data` file. If previously the structure looked like:
   558  
   559  ```json
   560  [
   561    {
   562      "name": "Docs",
   563      "routes": [
   564        {
   565          "title": "Foo",
   566          "path": "docs/foo"
   567        }
   568      ]
   569    }
   570  ]
   571  ```
   572  
   573  If we no longer want the link to be in the side nav, we can simply remove it. If we do still want the link in the side nav, but pointing to an external destination, we need to slightly change the structure as such:
   574  
   575  ```json
   576  [
   577    {
   578      "name": "Docs",
   579      "routes": [
   580        {
   581          "title": "Foo",
   582          "href": "https://learn.hashicorp.com/<product>/foo"
   583        }
   584      ]
   585    }
   586  ]
   587  ```
   588  
   589  As the majority of items in the side nav are internal links, the structure makes it as easy as possible to represent these links. This alternate syntax is the most concise manner than an external link can be represented. External links can be used anywhere within the docs sidenav.
   590  
   591  It's also worth noting that it is possible to do glob-based redirects, for example matching `/docs/*`, and you may see this pattern in the `_redirects` file. This type of redirect is much higher risk and the behavior is a bit more nuanced, so if you need to add a glob redirect, please reach out to the website maintainers and ask about it first.
   592  
   593  <!-- END: redirects -->
   594  
   595  <!-- BEGIN: browser-support -->
   596  <!-- Generated text, do not edit directly -->
   597  
   598  ## Browser Support
   599  
   600  We support the following browsers targeting roughly the versions specified.
   601  
   602  | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome.svg) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge.svg) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera.svg) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.svg) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari.svg) |
   603  | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
   604  | **Latest**                                                                                  | **Latest**                                                                            | **Latest**                                                                               | **Latest**                                                                                     | **Latest**                                                                                  |
   605  
   606  <!-- END: browser-support -->
   607  
   608  <!-- BEGIN: deployment -->
   609  <!-- Generated text, do not edit directly -->
   610  
   611  ## Deployment
   612  
   613  This website is hosted on Vercel and configured to automatically deploy anytime you push code to the `stable-website` branch. Any time a pull request is submitted that changes files within the `website` folder, a deployment preview will appear in the GitHub checks which can be used to validate the way docs changes will look live. Deployments from `stable-website` will look and behave the same way as deployment previews.
   614  
   615  <!-- END: deployment -->