Awesome
<h1 align="center"> Logseq-Hugo-Template </h1> <p align="center"> <a href="https://github.com/CharlesChiuGit/Logseq-Hugo-Template/stargazers"> <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/CharlesChiuGit/Logseq-Hugo-Template?color=957FB8&logo=starship&style=for-the-badge"> </a> <a href="https://github.com/CharlesChiuGit/Logseq-Hugo-Template/issues"> <img alt="GitHub issues" src="https://img.shields.io/github/issues-raw/CharlesChiuGit/Logseq-Hugo-Template?color=DCA561&logo=gitbook&logoColor=d9e0ee&style=for-the-badge"> <a href="https://github.com/CharlesChiuGit/Logseq-Hugo-Template/contributors"> <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/CharlesChiuGit/Logseq-Hugo-Template?color=%2398BB6C&logo=opensourceinitiative&logoColor=d9e0ee&style=for-the-badge"> </a> <img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/CharlesChiuGit/Logseq-Hugo-Template?color=%237E9CD8&logo=gitlfs&logoColor=d9e0ee&style=for-the-badge"> </p> <p align="center"> <img alt="HTML" src="https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white"> <a href="https://logseq.com/#/"> <img alt="Logseq" src="https://img.shields.io/static/v1?label=&message=LOGSEQ&color=002B35&style=for-the-badge"> </a> </a>Description
This is a HUGO website template for Logseq users who want their published posts to look more like a personal website, using GitHub Pages to host the website and logseq-schrodinger to export your Logseq pages.
<p align="center"> <img src="./src/thanos_logseq_hugo.svg" style="width:50%"/> </p>Credits
Credits to Alex QWxleA and Aryan Sawhney for inspiring this template.
Why use Logseq-Hugo-Template to build a website?
Although the native publish function in Logseq is very convenient, it's output result is more like a read-only Logseq, rather than a personal website.
Why HUGO?
You can use Markdown to write your posts/contents in HUGO.
Why GitHub Pages?
You can host your website directly from your GitHub repo, and it cost you nothing.
š§± Template Structure
āāā archetypes/ # A piece of content that's common to all of the content on your website.
ā āāā default.md
āāā content/ # Where you store all the content for your website.
ā āāā assets/ # Things from LogseqGraph/assets, used in posts.
ā ā āāā test.png
ā āāā pages/ # Revised Logseq pages with metadata sections for Hugo.
ā ā āāā random page from logseq.md
ā āāā archives.md
ā āāā search.md
āāā .github/ # Define GitHub action to help deploy in one click.
ā āāā workflows/
ā āāā publish.yml
āāā layouts/ # Where you define your layout for your website.
ā āāā partials/
ā ā āāā backlinks.html # Simulate backlinks function in Hugo.
ā āāā shortcodes/
ā āāā logseq/ # Translation between Logseq and Hugo.
ā ā āāā mark.html
ā ā āāā orgCAUTION.html
ā ā āāā orgEXAMPLE.html
ā ā āāā orgIMPORTANT.html
ā ā āāā orgNOTE.html
ā ā āāā orgPINNED.html
ā ā āāā orgQUOTE.html
ā ā āāā orgTIP.html
ā ā āāā orgWARNING.html
ā āāā contact.html
ā āāā hint.html
ā āāā search.html
āāā themes/ # Where you can apply pre-build themes or your own theme.
ā āāā random-theme/ # In this repo, PaperMod is the default theme.
āāā config.yml # The main settings page for your website.
āāā .gitignore # This is to prevent unwanted files be tracked by Git.
šŖ Workflow
This workflow assumes your know something about GitHub.
- Click the green
Use this template
button to fork this template repo. - Rename the forked repo to
{your-GitHub-username}.github.io
, e.g. GitHubUser.github.io. - Clone the repo.
- Configure
config.yml
. - Export your Logseq pages to
content/pages
, using logseq-schrodinger. - Push it to
git@github.com:{username}/{username}.github.io.git
. - After it's pushed, go to "Settings" > "Pages" > "Source" > Choose "gh-pages" branch. (auto-created by GitHub actions)
- Wait few minutes for GitHub to deploy.
- You should now see your website in
https://{username}.github.io/
, e.g.https://githubuser.github.io/
! š»
āØ Things you MUST modify
In config.yml
baseURL: https://githubuser.github.io # 1. All lowercase. 2. Don't put `/` after `.io`.
languageCode: en-us
title: Linus Torvalds # Your name or the website title.
theme: 'PaperMod'
params:
homeInfoParams:
Title: Sup bruh š # homepage title.
Content: This is something shows in your homepage. # homepage content.
socialIcons: # optional
- name: 'github'
url: 'https://github.com/XXX'
# - name: "youtube"
# url: "https://www.youtube.com/channel/XXX"
- name: 'twitter'
url: 'https://twitter.com/XXX'
# - name: "kofi"
# url: "https://buymeacoffee.com/XXX"
# - name: "rss"
# url: "https://XXX.github.io/index.xml"
ShowReadingTime: true
author: 'Linus Torvalds' # Your name.
contact: 'LinusT@example.com' # Your email.
feedlinks: true
copyright: '<!--Creative Commons License-->This site is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).<!--/Creative Commons License-->'
mobileMenu: true
#Google Analytics 4 optional
env: #production
GoogleAnalytics: "G-00000XXXXX"
sitemap:
changefreq: daily
filename: sitemap.xml
priority: 0.5
In content/pages
and content/assets
- Make pages public.
- Click on the three dots in the top right corner in Logseq and click
Export public pages to hugo
, via logseq-schrodinger. - Unzip the file and move the contents into
content/
.
ā» Noted: The marketplace version of logseq-schrodinger might have some file permission issues. Use the GitHub version one instead.
How to set the Google Analytics 4?
- Apply Google Analytics 4
- Write the GA4-ID to config.yml
- SetGoogle Search Consoleand add sitemap
How to change theme?
HUGO provides lots of prebuild themes.
ā» Noted: Structure and configurations might vary from theme to theme.
ā ļø Limitations
logseq-schrodinger is very much a work-in-progress. Please check if there's anything wrong about your post after exported. File an issue if you think something is a bug.
What works on logseq-schrodinger so far
- 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
- Notice that the uppercase filenames might be transformed to lowercase, making the remote images invalid, please double-check that.
- Basic Markdown styling (including highlighting!)
Issues
Sample Sites
License
Distributed under the MIT License. See LICENSE
for more information.