hubspot-cms-vscode icon indicating copy to clipboard operation
hubspot-cms-vscode copied to clipboard

[public suggestion] Offer path shorthands in templates

Open jsines opened this issue 1 year ago • 0 comments

from: https://github.com/HubSpot/hubspot-cms-vscode/pull/146#issuecomment-1741752285

I don't really know where else to submit my idea, so i'll do it here, since it is a little bit on the same vibe. Feel free to point me in the right direction if there is a better place to discuss that!

I am currently building a CMS Theme starting from the wonderful cms-theme-boilerplate and the experience is mostly awesome! Congrats to HubSpot team for this btw!

Here is an idea I got and would love to see implemented :

Common paths shorthand/alias a bit like the @hubspot/module-name functionality and inspired by the SvelteKit $lib alias (see doc for details).

The possibility to use custom aliases like @theme/module-name or @modules/module-name in templates would be amazing instead of the current ../../modules/module-name. At least predefined aliases for common paths like "modules" or "sections" would be good enough and probably easier to manage on your end (if the project structure follows a standard pattern, of course).

I also understand that paths like @hubspot/module-name seems to be absolute paths to HubSpot built-in modules, so it might not be just "add another alias" but rather adding a completely new alias feature.

Anyway, just wanted to start the discussion and see where it would go! 😄

jsines avatar Oct 02 '23 15:10 jsines