Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added content/_static/public/hugo-explorer.vsix
Binary file not shown.
11 changes: 11 additions & 0 deletions content/community/contributing-docs/authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,14 @@ Also add `mermaid: true` to the top of your page to enable rendering.

> [!NOTE]
> You can use [Mermaid's playground](https://www.mermaidchart.com/play) to design diagrams and get the code

## Useful tools

We recommend that you use [Visual Studio Code](https://code.visualstudio.com/) as you authoring environment.
If you do, you may find the following publicly available extensions useful:

* [Harper - Grammar / Spell Checking](https://marketplace.visualstudio.com/items?itemName=elijah-potter.harper)
* [Hugo Shortcode Syntax Highlighting](https://marketplace.visualstudio.com/items?itemName=kaellarkin.hugo-shortcode-syntax)
* [Render Line Endings](https://marketplace.visualstudio.com/items?itemName=medo64.render-crlf)

In addition, Union.ai has developed the [**Hugo Explorer**](./hugo-explorer) extension that helps in viewing and navigating the Hugo site structure in source code.
62 changes: 62 additions & 0 deletions content/community/contributing-docs/hugo-explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Hugo Explorer
weight: 5
variants: +flyte +serverless +byoc +selfmanaged
---

# Hugo Explorer

A Visual Studio Code extension that provides a specialized file explorer for Hugo projects,
displaying content ordered by the `weight` parameter in markdown front matter while maintaining complete Explorer functionality.

## Features

* **Hugo Weight-Based Sorting**: Automatically orders files and directories based on the `weight` parameter in YAML front matter.
* **Complete Explorer Functionality**: All native VS Code Explorer features including context menus, drag-and-drop, and file operations.
* **Multi-Workspace Support**: Works seamlessly with multiple workspace folders.
* **Drag-and-Drop File Moving**: Move files and folders while maintaining Hugo ordering.
* **Native Context Menus**: Full right-click context menus identical to the native Explorer.
* **Hugo _index.md Support**: Recognizes `_index.md` files for directory weight ordering.
* **Fallback Alphabetical Sorting**: Items without weight are sorted alphabetically.

## Installation

1. Download the VSIX file from here: [Hugo Explorer VSIX](../../_static/public/hugo-explorer.vsix)
2. Install via the command `Extensions: Install from VSIX...`

## Usage

1. Open a Hugo project in VS Code
2. Look for the "Hugo Explorer" icon in the Activity Bar (left sidebar)
3. The extension automatically detects and orders your Hugo content by weight
4. Use most of the same operations as the native Explorer:
- Right-click for context menus
- Drag and drop to move files
- Create, rename, delete files and folders
- Copy/paste operations.
5. To add a Workspace folder to the Hugo Explorer, either
- Add it in the standard Explorer view (it will appear in the Hugo Explorer view automatically), or
- Click on the "..." menu at the top of the Hugo Explorer to add folders from the Hugo Explorer view.
6. To remove a Workspace folder from the Hugo Explorer, either
- Remove it from the standard Explorer view (it will be removed from the Hugo Explorer view automatically), or
- Right-click on the folder in the Hugo Explorer view and select "Remove Folder".

## How It Works

* The extension finds the `content` folder in the root of your Hugo project.
* It places that folder at the top of the Hugo Explorer view.
* Within that folder it orders all files and directories as follows:
- Directories are ordered by the `weight` parameter in the front matter of their `_index.md` file.
- Files are ordered by the `weight` parameter in their front matter.
- Items with lower (non-zero, positive) weights are placed before items with higher (non-zero, positive) weights.
- If no weight is specified, files and directories are assumed to have a zero weight and are placed after all other items with a weight.
- Items with the same weight are sorted alphabetically by their filename with directories sorted before files.
* Outside the `content` folder all files and folders are sorted as they are in the in the standard VS Code Explorer view, by their filename, with directories sorted before files.

The `weight` is defined in the front matter of the markdown files, which is a YAML block at the top of each file.

## Requirements

- Visual Studio Code 1.97.0 or higher
- Works with any Hugo project structure

2 changes: 1 addition & 1 deletion content/community/contributing-docs/shortcodes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Shortcodes
weight: 5
weight: 6
variants: +flyte +serverless +byoc +selfmanaged
---

Expand Down
1 change: 0 additions & 1 deletion content/user-guide/core-concepts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: Core concepts
weight: 4
sidebar_expanded: true
variants: +flyte +serverless +byoc +selfmanaged
sidebar_expanded: true
---

# Core concepts
Expand Down
1 change: 0 additions & 1 deletion content/user-guide/development-cycle/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: Development cycle
weight: 5
sidebar_expanded: true
variants: +flyte +serverless +byoc +selfmanaged
sidebar_expanded: true
---

# Development cycle
Expand Down