-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Add markdown template hooks for links and images #6545
Comments
Yes please. Pretty please with sugar on top! This is a feature that I really-really want... Having the ability to control markdown syntax images from the templates will make content editing in Hugo much more intuitive and portable. Just closed #6505 in favor of this issue. |
Very great! Currently i'm doing this by pre-regexing Might be helpful to have some custom syntax interface? (so that we aren't limited to just ahref / img / or other pre-backed ones?) |
Very exciting indeed. Would this be limited to the |
I was thinking about |
I guess we strictly don't must have it, but it would be nice. We could and probably should make it optional, so you need to do
|
I agree. |
As for naming, I think we should stay away from HTML tags so 👍 for
|
I agree with the link vs href, but |
Also, the dir is being called |
I wonder if anywhere the |
Ideally there is an agreed upon list somewhere of markdown "function/feature" names we could use when expanding this to more than images and links. But not sure where to look... |
I can see this feature being used to generate a sitemap file with images... |
My first very rough implementation of this tells me that this is a great idea. |
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
This commit also revises the change detection for templates used by content files in server mode. Fixes gohugoio#6545 Fixes gohugoio#4663 Closes gohugoio#6043
@bep this is awesome! Playing with it now and have a quick question though, not sure if this is a full bug/regression – if so I can repost. I have links where the inner text includes code styling (via markdown, single tildes) but <a href="{{ .Destination | safeURL }}" target="_blank" rel="noopener">{{ .Text }}</a> [`should be code`](https://gohugo.io) ...returns Same with bold text ( This is still a HUGE feature for me though, especially with images, so thanks!!! 👍 |
@jakejarvis can you create a separate issue. This may be related to a similar issue we fixed in the ToC extension earlier. |
I have already tested the new functionality and I also think that this is such an amazing update that will simplify my workflow a lot. Now every Markdown editor out there can be used as a CMS for Hugo, even on mobile. Thank you so much! 🥇 |
Yes, it's pretty great. |
Awesome! This would allow to bypass Goldmark's stripping non Unicode characters from anchors (6616) without the need of an extension, but maybe an extension would make more sense I don't know (I guess an extension would indeed feel more "native" than a custom template). |
How is I've created both |
Hey I have problem with amp output format. I have two files like this:
The one should be used is |
Hi |
Please use https://discourse.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation. |
The documentation is inadequate. |
Hey guys I hope we can keep a positive attitude here :) I think I managed to solve my problem by looking at this page here If I create the file
The documentation says to put this in the file: <p class="md__image">
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
</p> I changed the line to: <p class="md__image">
<img src="../{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
</p> and it let me put my images in |
Please use https://discourse.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation. |
This is the number one pain point left vs rendering of content files, and I will do a fast implementation for this for Hugo 0.61.**
Common issues that are currently very hard/impossible to do:
target=_blank
on external links..GetPage
We may do improved (and faster) plugin interfaces for this (re. Starlight discussion in another thread), but what I suggest we do very short term is outlined in the below:
render-link
andrender-image
are predefined hook macros that will be responsible for producing the markup for links and img tags./cc @regisphilibert @onedrawingperday @kaushalmodi and gang.
** I know people are waiting "Pages for data", and it's in the pipeline. I have a branch where I'm working on it, so it's coming ... eventually.
The text was updated successfully, but these errors were encountered: