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

Make markdownify work as site.Home.RenderString #9538

Closed
bep opened this issue Feb 21, 2022 · 1 comment · Fixed by #9544
Closed

Make markdownify work as site.Home.RenderString #9538

bep opened this issue Feb 21, 2022 · 1 comment · Fixed by #9544
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Feb 21, 2022

While working on #9521 (basically render hook support for code blocks), I had to simplify the hook code (mainly to get support for a template per code language). This lead me to the simplification that I'm surprised I didn't think about the first time around: By making markdownify just a delegate for site.Home.RenderString I can remove a lot of superfluous code. And it it also removes some of the limitations of markdownify, mainly that render hooks now just works.

I will consider if we want/need to go the extra mile to be called from the "current page" and not always the home page (which probably be better template wise).

I'm assuming that this is all a good thing, but I'm creating this issue to track it.

/cc @jmooring

@bep bep added this to the v0.93.0 milestone Feb 21, 2022
@bep bep self-assigned this Feb 21, 2022
bep added a commit to bep/hugo that referenced this issue Feb 22, 2022
bep added a commit to bep/hugo that referenced this issue Feb 22, 2022
bep added a commit to bep/hugo that referenced this issue Feb 22, 2022
bep added a commit to bep/hugo that referenced this issue Feb 22, 2022
bep added a commit to bep/hugo that referenced this issue Feb 22, 2022
bep added a commit to bep/hugo that referenced this issue Feb 22, 2022
bep added a commit to bep/hugo that referenced this issue Feb 23, 2022
bep added a commit to bep/hugo that referenced this issue Feb 23, 2022
bep added a commit to bep/hugo that referenced this issue Feb 23, 2022
bep added a commit to bep/hugo that referenced this issue Feb 23, 2022
bep added a commit to bep/hugo that referenced this issue Feb 24, 2022
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`).

We also used this new hook to add support for diagrams in Hugo:

* Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams.
* Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information.

Updates gohugoio#7765
Closes gohugoio#9538
Fixes gohugoio#9553
Fixes gohugoio#8520
Fixes gohugoio#6702
Fixes gohugoio#9558
bep added a commit to bep/hugo that referenced this issue Feb 24, 2022
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`).

We also used this new hook to add support for diagrams in Hugo:

* Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams.
* Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information.

Updates gohugoio#7765
Closes gohugoio#9538
Fixes gohugoio#9553
Fixes gohugoio#8520
Fixes gohugoio#6702
Fixes gohugoio#9558
bep added a commit to bep/hugo that referenced this issue Feb 24, 2022
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`).

We also used this new hook to add support for diagrams in Hugo:

* Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams.
* Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information.

Updates gohugoio#7765
Closes gohugoio#9538
Fixes gohugoio#9553
Fixes gohugoio#8520
Fixes gohugoio#6702
Fixes gohugoio#9558
@bep bep closed this as completed in #9544 Feb 24, 2022
bep added a commit that referenced this issue Feb 24, 2022
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`).

We also used this new hook to add support for diagrams in Hugo:

* Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams.
* Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information.

Updates #7765
Closes #9538
Fixes #9553
Fixes #8520
Fixes #6702
Fixes #9558
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant