Closed ChrisFiola closed 2 years ago
Thank you for using this plugin. Have you tried custom templates? You can add a template file where the line is removed.
@ChrisFiola Let me close this issue. If the custom template feature couldn't solve your problem, feel free to reopen it.
Hey ysk, love the plugin.
I'm looking to do the exact same thing here as Chris but when using custom templates, I end up with just lines of text instead of the proper preview output.
For example:
linkpreview.html:
{{ link_title }}
{{ link_image }}
{{ link_description }}
{{ link_domain }}
Result:
How Secure Is My Password? | Password Strength Checker https://www.security.org/app/uploads/2020/10/How-Secure-is-My-Password_.jpg Data breaches and identity theft are on the rise, and the cause is often compromised passwords. After stealing credentials, cybercriminals can use passwords to www.security.org
Am I writing the linkpreview.html incorrectly? Would appreciate any insight, thanks!
@tayjaf Thank you for reporting this. Could you open a new issue as this one was created for a different purpose? In the new issue, could you provide
@ChrisFiola v0.6.0 which deleted the line 245 has been released. Feel free to try it out.
https://github.com/ysk24ok/jekyll-linkpreview/issues/30#issuecomment-1407755417
Hey @tayjaf, in case you did not catch the news, please try v0.6.0 to get rid of the URL before the preview.
Regarding the issue you reported, that is what jekyll-linkpreview (and Jekyll) is supposed to do; all the values ({{ link_* }}
) are supposed to be strings, and whatever goes inside _includes
are treated as parts of HTML.
For them to be an actual preview, you need to write a snippet of HTML using the values given, like so:
<h2>{{ link_title }}</h2>
<p>{{ link_description }}</p>
<img src="{{ link_image }}" alt="Preview Image" />
<code>{{ link_domain }}</code>
This is minimal implementation; to use linkpreview.css as is, you need to consult the default template, which can be found here: https://github.com/ysk24ok/jekyll-linkpreview/blob/edd7909e94b3d394155f898b7a3a19aa109f7351/lib/jekyll-linkpreview.rb#L238-L273
and translate what's going on here to the Liquid template.
@Clpsplug Thanks so much, fixed my issues. Appreciate the help and insight.
First of all great job on the plugin this is exactly what I needed and super simple. Only thing I need is to not have the URL show up on top of the preview.
When I build my website locally I just remove line 245 from jekyll-linkpreview.rb but when building though github-actions I cannot modify the ruby files since they are fetched from the source here.
Do you know how I could fix this without manually modifying my html after the website is deployed?