Issue #449: Manual (external) links#511
Issue #449: Manual (external) links#511LisaFC merged 15 commits intogoogle:masterfrom narrenfrei:external-links
Conversation
| You can use `manualLink` also to add a additional cross reference to another existing page of your site. But especially for intern links you can also use the parameter `manualLinkRelref` instead of `manualLink` to use the build in Hugo function [relref](https://gohugo.io/functions/relref/ "External link to official Hugo Docs"). If `relref` can't find a unique page in your site, Hugo will throw a error message. | ||
|
|
||
| {{% alert title="Attention" color="warning" %}} | ||
| Although the link in the menu is set according to the parameters `manualLink` or `manualLinkRelref`, the corresponding HTML page is still generated by Hugo. It is therefore advisable to specify the URL for the external link in the normal content and / or page description. |
There was a problem hiding this comment.
Can you elaborate on this a bit - I can see that the placeholder page will be generated, but I'm not sure what you mean by specifying the URL in the normal content?
There was a problem hiding this comment.
My thought was, if somebody opens the URL of such a placeholder page (e.g.. http://docsy-dev-manual-link.narrenfrei.at/docs/external-links/internal-link/), he don't know where the menu item originally links to. So a little hint on the "normal page content" (which is shown, when the placeholder page get's opened) would be helpful.
But I have no problem to delete these paragraph, if you think it's not so important.
There was a problem hiding this comment.
No, that makes sense - let me see if I can rephrase it a bit.
The title attribut of a link in the section menu and section index will only get set, if manualLinkTitle is set or the shown link text devides from the title of a page.
|
This is looking good! I'm happy enough with it, we can always tweak the docs further if any users find them unclear. |
|
For me, it's also fine. |
|
Please, one more moment. I've seen a little thing to change. |
|
Now it should be OK. |
|
Where in the Docsy docs did the instructions for external links in the side bar end up? My guess would have been Navigation, or perhaps Look & Feel, but I didn't see anything there, nor did search turn up anything. |
Should be found here: https://www.docsy.dev/docs/adding-content/navigation/#add-manual-links-to-section-menu |
|
I see it now, thanks. Perhaps documentation for each of the options could be documented?
I'd like to use the 'hugo like link' to display the contents of a page within the Docsy site, but it's not clear how to accomplish that. A few examples would make it clearer. |
|
Hello @narrenfrei ! I am trying to use the 'externalLink' parameter, as you have shown here ('external link' to https://themes.gohugo.io/docsy/ in sidebar). I have externalLink in my frontmatter of a file within the content folder, with the url to the outside site I want to link it to. I also added the code from here to my config.yaml file, but it still isn't working. Are there any steps I'm missing? Thank you for your help! |
|
Hi @michelle-zymbit, Here (https://github.com/narrenfrei/docsy-dev/tree/master/content/en/docs/dev-test-content/external-links) is a link to my dev repo, where you can find the frontmatters for each kind of external links, as shown here: https://60f7d1bf27ca190008cd35fb--sad-volhard-b41b3b.netlify.app/docs/dev-test-content/external-links/ |
As already discussed in #449 this is my suggestion to add external links (and also manual internal links) to the sidebar menu. Also the links in section index get adopted. The PR also sets the title attribute of the link tags and gives the option to set these manually. Especially for external links there is a possibility to set the target for the link. If the target is set to "_blank" also the link attribute
rel=noopenerwill be set.Here you can find a preview: http://docsy-dev-manual-link.narrenfrei.at/docs/external-links/
I've also added a short how to: http://docsy-dev-manual-link.narrenfrei.at/docs/adding-content/navigation/#add-manual-links-to-section-menu
This PR is based on the PR #508 (icons for sidebar menu) and should merged after it.