Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bowman2001/hugo-mod-open-in-vscode
Open the content file of the current Hugo page (local server-mode) in VSCode or VSCodium
https://github.com/bowman2001/hugo-mod-open-in-vscode
hugo vscode
Last synced: 3 months ago
JSON representation
Open the content file of the current Hugo page (local server-mode) in VSCode or VSCodium
- Host: GitHub
- URL: https://github.com/bowman2001/hugo-mod-open-in-vscode
- Owner: bowman2001
- License: apache-2.0
- Created: 2023-03-30T08:32:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-16T16:28:28.000Z (7 months ago)
- Last Synced: 2024-10-14T18:41:34.881Z (4 months ago)
- Topics: hugo, vscode
- Language: HTML
- Homepage:
- Size: 25.4 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hugo-mod-open-in
The module contains two partials, which can be placed before and after any HTML element in your templates that doesn't contain a link already.
## Prerequisites
- A local Hugo project
- A local VSCode or VSCodium installation
## Function
If the local Hugo project is rendered **in server-mode**, the two partials wrap a link around the HTML element. The link starts with `vscode://file` followed by the full path to the current content file (if it is available). In production mode, the partials don’t generate anything.
In case you would like to use VSCodium you need to reconfigure the name and the protocol in your parameter section:
```yaml
params:
modOpenIn:
name: VSCodium
protocol: vscodium
```## Security consideration
If and only if Hugo’s server-mode is configured to show the preview under a public IP address (by default it shows only on localhost), the full path to the project is visible in the link. Which may be a security concern.