-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support Wikilink Syntax #6
Comments
I love the idea, but in order for the links to work we need to know the route associated by it, for this template we know that one page = one document but that may not be the case for all websites using Nuxt Content. Have you tried https://github.com/landakram/remark-wiki-link ? |
@atinux side-note: I noticed that https://content.nuxtjs.org/api/configuration#markdown does a 302 redirect to https://content.nuxtjs.org/api/v1/getting-started/configuration#markdown with a "Page not found" message. |
Should be fixed for the redirection thanks @sig9 |
For Obsidian wiki-links with Absolute paths, you should follow these steps
By these steps,
|
Thanks a lot for that information. I tried to implement a custom remark plugin as you described and configured it in Nuxt-config. The plugin is super-simple:
The returned value is just a test here. However, the plugin is never invoked. Instead
is rendered as
If I use a different REGEX and a different input text, I can see that the plugin is involved. The plugin configuration therefore seems to work correctly. It looks like double square brackets are somehow treated before they arrive in the plugin. I will try to fiddle with the remark-wikilinks plugin, even though I have not seen a possibility to change the resulting tag-name in this plugin. |
RemarkUnless some other plugin is also installed that treats the Also, did you register it correctly inside Then, the EDIT: Hey, try converting your plugin to a rehype plugin, instead of remark, and then try. So, visit the RehypeYou can change the tagName of links even with remark-wikilink plugin, by having a custom rehype plugin. I think that plugin adds some classes like |
@ManasMadrecha
I have not configured any other plugin, therefore the behavior must be included in Nuxt-Standard. I have already found another solution using a Nitro plugin. Nitro-PluginCreate a file wikilinkPlugin.ts in the directory
and configure the plugin in 'nuxt.config.js`.
The code is still incomplete. Local links and transclusions are not handled to name only the problems I can see by now. But it may be a start. For some reason I don't understand, the final HTML will contain additional whitespace I did not produce. This may be a more complicated issue.
instead of
|
@henriette-einstein OMG, you have complicated it so much 😂 Issue with
|
@ManasMadrecha Thanks a lot for your guidance and solutions! I'll now write and refine the components to see how that works. After that, I'll try to implement a backlink component. Hope I don't have to bother you again then. |
I would like to use Nuxt Content to generate HTML form Obsidian files (see https://www.obsidian.md). Obsidian uses the Wikilink syntax to reference files.
e.g.
[[anotherfile]] references the file "anotherfile.md" in the current directory.
This syntax is (as far as I could see) not supported by nuxt content. I could do some preprocessing to convert that syntax to the standard markdown syntax. But that would not work if I use the content-directory directly as the root folder for the Obsidian vault.
Therefore it would be great if you could provide a remark plugin and a configuration example that handles that.
The text was updated successfully, but these errors were encountered: