Closed jerryjrchen closed 6 years ago
Here's a quick fix I put together for the line in question:
{% if post.external-url %}
<a class="post-link" href="{{ post.external-url }}">{{ post.title | escape }} →</a>
{% else %}
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
{% endif %}
I intentionally used post.url
on the home layout. But, on the post layout, the title links to post.external-url
, so user can navigate to the both post.url
and post.external-url
. This theme hasn't a UI providing permalink of the post, so I just keep using post.url
on home.
Maybe we can add permalink for each post that has an external URL. SVG icons? How do you think?
I think having some sort of link on the home page as well would be good.
For example, Daring Fireball gets around the problem by having the title link to an external URL and providing a separate icon (a star) that links to the page of the post. This is kind of the opposite of having an SVG icon for the URL, but maybe that would be more intuitive.
Yes, if we add permalink icon, the post title should link to the external URL. But I haven't thought about what will be good for the icon. Also we can use just text link for permalinks, along with date and categories, I think?
Could you clarify what you mean by "use just text link for permalinks"?
I meant using [link](...)
instead of SVG icons like Daring Fireball.
Yeah, that sounds reasonable to me.
Hi @jerryjrchen, I've just released the version 1.6.0 for this. Now every post with external URL will be linked to that external URL directly. Also there will be additional link "Permalink" for such posts.
Hi there, I noticed that the about page offered the following information about creating a post that links directly to a URL:
But right now, it seems like all that happens is that the right arrow is added to the title. The anchor tag here still uses the
post.url
. Should it be usingpost.external-url
if it's present, or am I misunderstanding this feature? https://github.com/yous/whiteglass/blob/818695c7855e7de977d3ff4e0d34fc5132e4deb7/_layouts/home.html#L19