Repository: sawhney17/logseq-schrodinger
Branch: main
Commit: 032fdd9409bf
Files: 16
Total size: 48.3 KB
Directory structure:
gitextract_vgv2rhpk/
├── .gitattributes
├── .github/
│ └── workflows/
│ └── publish.yml
├── .gitignore
├── .postcssrc
├── LICENSE
├── README.md
├── index.html
├── package.json
├── src/
│ ├── App.css
│ ├── App.tsx
│ ├── handleClosePopup.ts
│ ├── index.tsx
│ ├── tailwind.css
│ └── utils.tsx
├── tailwind.config.js
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
================================================
FILE: .github/workflows/publish.yml
================================================
name: Build plugin
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
env:
PLUGIN_NAME: logseq-hugo-plugin
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x' # You might need to adjust this value to your own version
- name: Build
id: build
run: |
npm i && npm run build
mkdir ${{ env.PLUGIN_NAME }}
cp README.md package.json icon.png ${{ env.PLUGIN_NAME }}
mv dist ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
ls
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref }}
with:
allowUpdates: true
draft: false
prerelease: false
- name: Upload zip file
id: upload_zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PLUGIN_NAME }}.zip
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
asset_content_type: application/zip
- name: Upload package.json
id: upload_metadata
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./package.json
asset_name: package.json
asset_content_type: application/json
================================================
FILE: .gitignore
================================================
.DS_Store
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env.production
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
package-lock.json
yarn.lock
================================================
FILE: .postcssrc
================================================
{
"plugins": {
"postcss-import": {},
"tailwindcss/nesting": {},
"tailwindcss": {}
}
}
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2022 sawhney17
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
## About The Project
[![Product Name Screen Shot][product-screenshot]](https://github.com/sawhney17/logseq-schrodinger/)
[Logseq](https://logseq.com) is a great PKM (personal knowledge management) tool, but keeping your knowledge for yourself only gets you so far. As [Erwin Schrödinger](https://simple.wikipedia.org/wiki/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 click `Plugins`.
- 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.
[![Configuration screen][configuration-screenshot]](##configuration)
### Meta-data
This plugin uses YAML for the Hugo [front-matter](https://gohugo.io/content-management/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.
```markdown
date:: 2012-04-06
```
Configuring Hugo
[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`.
```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 }}
{{ else }}
{{ end }}
```
### Admonitions
Logseq has several built-in adminitions, namely:
- caution
- example
- important
- note
- pinned
- tip
- quote
- warning
These get converted to:
```markdown
{{< 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/`:
```txt
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:
```html
## Website templates
There are some basic website templates you can take it as a reference.
1. [logseq-hugo-template](https://github.com/sawhney17/logseq-hugo-template/), by [sawhney17](https://github.com/sawhney17).
1. You can host your personal website with your favorite web hosting providers.
2. [Logseq-Hugo-Template](https://github.com/CharlesChiuGit/Logseq-Hugo-Template), by [CharlesChiuGit](https://github.com/CharlesChiuGit).
1. Host your personal website with free [GitHub pages](https://pages.github.com/).
## Issues
See the [open issues](https://github.com/sawhney17/logseq-schrodinger/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!
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