Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontmatter: resemble documented shortcode style #672

Closed
postb99 opened this issue Oct 3, 2023 · 2 comments
Closed

frontmatter: resemble documented shortcode style #672

postb99 opened this issue Oct 3, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@postb99
Copy link

postb99 commented Oct 3, 2023

Hello,

Sorry for not being sure whether it's a bug or a regression over time, but in the following file https://github.com/McShelby/hugo-theme-relearn/blob/main/vscode-frontmatter/snippets.en.json and also snippets.de.json I noticed a typo: I see many "body" contents starting and ending with {{< and >}} rather than {{% and %}}.

Can you fix this?

Another (useful?) thing, the include snippet would uses shorter syntax, similar to your exampleSite :
{{% include "basics/CHANGELOG.md" true %}} rather than {{% include file="basics/CHANGELOG.md" hidefirstheading="true" %}}

Using Hugo Extended 0.119.

@McShelby McShelby changed the title Typos in frontmatter snippets? frontmatter: resemble documented shortcode style Oct 3, 2023
McShelby added a commit that referenced this issue Oct 3, 2023
@McShelby
Copy link
Owner

McShelby commented Oct 3, 2023

Thanks for pointing this out.

While the usage of < vs. % often depends on the use case, it should at least resemble the style used in the documentation.

I decided for not using positional parameters even for the simplest shortcode, because the snippets are used to auto generate the shortcode calls in your pages. If you later edit a page without the help of the VSCode front-matter extension, it should clearly communicate what each parameter does.

I also added the missing highlight shortcode with curated parameter from Hugo`s default implementation.

@McShelby McShelby self-assigned this Oct 3, 2023
@McShelby McShelby added the bug Something isn't working label Oct 3, 2023
@McShelby McShelby added this to the 5.23.0 milestone Oct 3, 2023
@McShelby McShelby closed this as completed Oct 3, 2023
@postb99
Copy link
Author

postb99 commented Oct 4, 2023

Thanks for every time you explain the internals, I don't know Hugo/Go language apart from playing with your theme but being a developer I love to understand things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants