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

Blog related links with Attachments usable #4637

Closed
4 tasks done
strausmann opened this issue Nov 14, 2022 · 8 comments
Closed
4 tasks done

Blog related links with Attachments usable #4637

strausmann opened this issue Nov 14, 2022 · 8 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@strausmann
Copy link
Sponsor

strausmann commented Nov 14, 2022

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

Currently it seems that only external links and .md files can be linked to in Related Links. We would also be able to provide e.g. PDF, Word or other files via the Related Links.

Use Cases

In the blog, it would be generally useful to place attached documents present by means of the Related Links. In texts with sometimes 5-6 A4 pages, the links to attachments would simply get lost.

We have already tried to link the attachments in the documents, then to link them via the assets URI in the Related Links. But this is quite complicated.

Screenshots / Mockups

No response

@squidfunk
Copy link
Owner

squidfunk commented Nov 14, 2022

Thanks for suggesting. Please provide some more information of how you imagine to use this feature. External, fully-qualified links should already work. Otherwise we need to know what configuration you're using.

A self-contained example would be great.

@squidfunk squidfunk added the needs input Issue needs further input by the reporter label Nov 14, 2022
@strausmann
Copy link
Sponsor Author

We use MkDocs Material Insider for an internal system for Company Information.

The posts are called Circulars and can have attachments. These attachments can be linked in the blog area of MkDocs Material currently only in the content of the post.

With Related Links we cannot link the documents, here only external links or other pages from MkDocs are possible.

image

So we have the following requirement. In a blog post files like PDF, Word, Excel etc. should be linked. Files can be included via the Related Links. The attachments are located in the project directly next to the post file (*.md) itself.

@strausmann
Copy link
Sponsor Author

Ahso, because with an attachment probably no meaningful name for the Related Link is possible. Currently there would always be "None". Would be a similar integration as required for external links.

image

@squidfunk squidfunk added needs investigation Issue must be investigated by the maintainers and removed needs input Issue needs further input by the reporter labels Nov 15, 2022
@squidfunk
Copy link
Owner

I'm not sure what you're doing, but I can't reproduce the problem – linking files works perfectly for me. For example, take the following configuration:

links:
  - setup/setting-up-site-search.md#built-in-search-plugin
  - insiders/index.md#how-to-become-a-sponsor
  - PDF: blog/posts/test.pdf

Results in:

Bildschirmfoto 2022-11-15 um 19 24 42

Clicking on the PDF opens it. I suspect that the path is wrong – the path must start at the root of your docs_dir.

@squidfunk squidfunk added resolved by config change Issue can be mitigated by the reporter and removed needs investigation Issue must be investigated by the maintainers labels Nov 15, 2022
@squidfunk
Copy link
Owner

Okay, so the case where you don't specify the title for the PDF doesn't work correctly. That wasn't apparent for me from what you wrote. I'll reopen the issue and investigate.

@squidfunk squidfunk added bug Issue reports a bug and removed resolved by config change Issue can be mitigated by the reporter labels Nov 15, 2022
@squidfunk
Copy link
Owner

squidfunk commented Nov 15, 2022

Fixed in squidfunk/mkdocs-material-insiders@606c88cc3. Non-Markdown links now correctly resolve to the assets destination paths after copying. Additionally, it no title is set, the filename is used.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Nov 15, 2022
@squidfunk squidfunk reopened this Nov 15, 2022
@squidfunk
Copy link
Owner

Released as part of 8.5.10+insiders-4.26.3.

@strausmann
Copy link
Sponsor Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants