An awesome Logseq plugin to jumpstart your digital garden 🌱!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Logseq is a great PKM (personal knowledge management) tool, but keeping your knowledge for yourself only gets you so far. As Erwin Schrödinger stated:
If a note is not published, does it really exist? — Erwin Schrödinger
Knowledge is meant to be treasured and expanded, but before all shared. This plugin helps to make that possible, or at least easier.
Note: This project is very much a work-in-progress. Please report issues and questions.
Esc t p
).Marketplace
button and then click Plugins
.Install
.This plugin uses YAML for the Hugo front-matter. It will convert Logseq page-properties to Hugo front matter.
Logseq keywords are lowercase converted to Hugo keywords, and category in Logseq is translated to categories for use with Hugo. Logseq links ([[like_this]]
) are stripped of [[
and ]]
.
All other keywords are just converted to Hugo keywords.
For now you must add date with the posts date in the form of "2012-04-06" to your Logseq page-properties.
date:: 2012-04-06
Hugo does not by default support backlinks. Use a snippet like the following to simulate backlinks. It will parse every page for local links. This snippet should be placed in ~yourhugo/layouts/partials/backlinks.html
.
{{ $re := $.File.BaseFileName }} {{ $backlinks := slice }} {{ range where
.Site.RegularPages "Type" "page" }} {{ if and (findRE $re .RawContent) (not (eq
$re .File.BaseFileName)) }} {{ $backlinks = $backlinks | append . }} {{ end }}
{{ end }} {{ if gt (len $backlinks) 0 }}
<aside>
<h3>Backlinks</h3>
<div class="backlinks">
<ul>
{{ range $backlinks }}
<li class="capitalize"><a href="https://github.com/sawhney17/logseq-schrodinger/blob/main/{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>
</aside>
{{ else }}
<aside>
<h4>No notes link to this note</h4>
</aside>
{{ end }}
<aside class="related">
{{ $related := .Site.RegularPages.Related . | complement $backlinks | first 3
-}} {{ with $related -}}
<h3>slightly related</h3>
<ul>
{{ range . -}}
<li class="capitalize"><a href="https://github.com/sawhney17/logseq-schrodinger/blob/main/{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
</ul>
{{ end -}}
</aside>
Logseq has several built-in adminitions, namely:
These get converted to:
{{< logseq/orgCAUTION >}}Caution here{{< / logseq/orgCAUTION >}}
{{< logseq/orgEXAMPLE >}}This is an example{{< / logseq/orgEXAMPLE >}}
{{< logseq/orgIMPORTANT >}}This is important{{< / logseq/orgIMPORTANT >}}
{{< logseq/orgNOTE >}}This is a note{{< / logseq/orgNOTE >}}
{{< logseq/orgPINNED >}}This is pinned{{< / logseq/orgPINNED >}}
{{< logseq/orgTIP >}}This is a tip{{< / logseq/orgTIP >}}
{{< logseq/orgQUOTE >}}This is a quote{{< / logseq/orgQUOTE >}}
{{< logseq/orgWARNING >}}This is a warning{{< / logseq/orgWARNING >}}
So Hugo needs those in ~yourhugo/layouts/shortcodes/logseq/
:
orgCAUTION.html
orgEXAMPLE.html
orgIMPORTANT.html
orgNOTE.html
orgPINNED.html
orgQUOTE.html
orgTIP.html
orgWARNING.html
And they should contain something along the lines of:
<div class="caution {{ .Get 0 }}">{{ .Inner | $.Page.RenderString }}</div>
There are some basic website templates you can take it as a reference.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE.txt
for more information.
Aryan Sawhney - @Aryan Sawhney
Project Link: https://github.com/sawhney17/logseq-schrodinger
I would like to thank Alex Qwxlea (@twitter_handle) for the idea to write this Logseq plugin. Also for breaking the plugin after I wrote it. And finally, thank him for adding this note: Qwxlea, you're the best 😁!