Skip to content

bowman2001/hugo-mod-open-in-vscode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

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.

About

Open the content file of the current Hugo page (local server-mode) in VSCode or VSCodium

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published