Home

Awesome

<div id="top"></div> <!-- PROJECT SHIELDS -->

Contributors Forks Stargazers Issues MIT License

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/sawhney17/logseq-schrodinger"> <img src="icon.png" alt="Logo" width="80" height="80"> </a> <h3 align="center">logseq Schrödinger</h3> <p align="center"> An awesome <a href="https://logseq.com">Logseq</a> plugin to jumpstart your digital garden 🌱! <br /> <a href="https://github.com/sawhney17/logseq-schrodinger"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="https://aryansawhney.com/">View Demo</a> · <a href="https://github.com/sawhney17/logseq-schrodinger/issues">Report Bug</a> · <a href="https://github.com/sawhney17/logseq-schrodinger/issues">Request Feature</a> </p> </div> <!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol> <li><a href="#about-the-project">About The Project</a></li> <li><a href="#installation">Installation</a></li> <li><a href="#configuration">Configuration</a> <ul> <li><a href="#meta-data">Meta-data</a></li> <li><a href="#configuring_hugo">Configuring Hugo</a></li> <li><a href="#admonitions">Admonitions</a></li> </ul> </li> <li><a href="#issues">Issues</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#acknowledgments">Acknowledgments</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

About The Project

Product Name Screen Shot

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 <a href="#issues">issues</a> and questions.

<p align="right">(<a href="#top">back to top</a>)</p> <!-- GETTING STARTED -->

Installation

Preparation

Install plugin from the Marketplace (recommended)

Install plugin manually

<p align="right">(<a href="#top">back to top</a>)</p> <!-- Configuration -->

Configuration

Configuration screen

<p align="right">(<a href="#top">back to top</a>)</p>

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
<h3 id="configuring_hugo">Configuring Hugo</h3>

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>
<img src="./images/backlinks.png" width="200px">

Admonitions

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>
<p align="right">(<a href="#top">back to top</a>)</p>

Website templates

There are some basic website templates you can take it as a reference.

  1. logseq-hugo-template, by sawhney17.
    1. You can host your personal website with your favorite web hosting providers.
  2. Logseq-Hugo-Template, by CharlesChiuGit.
    1. Host your personal website with free GitHub pages.
<p align="right">(<a href="#top">back to top</a>)</p> <!-- Issues -->

Issues

See the open issues for a full list of proposed features (and known issues).

What works

What is known to not work

<p align="right">(<a href="#top">back to top</a>)</p> <!-- CONTRIBUTING -->

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
<p align="right">(<a href="#top">back to top</a>)</p> <!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE.txt for more information.

<p align="right">(<a href="#top">back to top</a>)</p> <!-- CONTACT -->

Contact

Aryan Sawhney - @Aryan Sawhney

Project Link: https://github.com/sawhney17/logseq-schrodinger

<p align="right">(<a href="#top">back to top</a>)</p>

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 😁!

<!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->