sawhney17/logseq-schrodinger
Fork: 38 Star: 332 (更新于 2024-11-18 22:40:39)
license: MIT
Language: TypeScript .
A plugin to export pages in Logseq to Hugo.
最后发布版本: 1.3.1 ( 2023-04-04 02:06:07)
logseq Schrödinger
An awesome Logseq plugin to jumpstart your digital garden 🌱!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
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.
Installation
Preparation
- Click the 3 dots in the righthand corner and go to Settings.
- Go to Advanced and enable Plug-in system.
- Restart the application.
- Click 3 dots and go to Plugins (or
Esc t p
).
Install plugin from the Marketplace (recommended)
- Click the
Marketplace
button and then clickPlugins
. - Find the plugin and click
Install
.
Install plugin manually
- Download a released version assets from Github.
- Unzip it.
- Click Load unpacked plugin, and select destination directory to the unzipped folder.
Configuration
- Click the 3 dots in the righthand corner and go to Settings.
- Go to Plugin Settings.
- Select correct plugin.
Meta-data
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
Configuring Hugo
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="{{ .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="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
</ul>
{{ end -}}
</aside>
Admonitions
Logseq has several built-in adminitions, namely:
- caution
- example
- important
- note
- pinned
- tip
- quote
- warning
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>
Website templates
There are some basic website templates you can take it as a reference.
-
logseq-hugo-template, by sawhney17.
- You can host your personal website with your favorite web hosting providers.
-
Logseq-Hugo-Template, by CharlesChiuGit.
- Host your personal website with free GitHub pages.
Issues
See the open issues for a full list of proposed features (and known issues).
What works
- Local Hugo links (but Logseq uses one folder for everything, so Hugo does too)
- Block refs(!) — On conversion the block is pulled from the other location
- Images
- Basic Markdown styling (including highlighting!)
What is known to not work
- Indentation Logseq ➡ Hugo is still a work-in-progress
Contributing
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Aryan Sawhney - @Aryan Sawhney
Project Link: https://github.com/sawhney17/logseq-schrodinger
Acknowledgments
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 😁!
最近版本更新:(数据更新于 2024-08-28 01:32:14)
2023-04-04 02:06:07 1.3.1
2022-08-29 17:19:54 1.3.0
2022-08-11 20:02:58 1.5.5
2022-07-15 15:55:19 1.2.5
2022-07-15 15:52:27 1.2.4
2022-05-23 15:05:04 1.2.3
2022-05-20 23:19:59 1.2.2
2022-04-26 15:27:41 1.2.1
2022-04-19 22:51:51 1.2.0
2022-04-17 16:07:04 1.1.9
主题(topics):
hugo, logseq
sawhney17/logseq-schrodinger同语言 TypeScript最近更新仓库
2024-11-22 01:36:46 twentyhq/twenty
2024-11-21 22:40:05 LLOneBot/LLOneBot
2024-11-21 20:34:48 CopilotKit/CopilotKit
2024-11-21 16:58:07 labring/FastGPT
2024-11-21 16:14:54 RSSNext/Follow
2024-11-21 16:12:23 x-extends/vxe-table