Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ _site
.jekyll-cache
pages/.DS_Store
pages/tags.md
_notes/.obsidian
_notes/.obsidian
_notes/Public/.obsidian
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
gem 'jekyll-sitemap'
gem 'kramdown-math-katex'

gem "webrick", "~> 1.7"
gem "webrick", "~> 1.7"
13 changes: 12 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ GEM
sassc (> 2.0.1, < 3.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-target-blank (2.0.0)
jekyll (>= 3.0, < 5.0)
nokogiri (~> 1.10)
jekyll-tidy (0.2.2)
htmlbeautifier
htmlcompressor
Expand All @@ -60,9 +63,16 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
nokogiri (1.13.3-x64-mingw32)
racc (~> 1.4)
nokogiri (1.13.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.3-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
racc (1.6.0)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down Expand Up @@ -93,6 +103,7 @@ DEPENDENCIES
jekyll (~> 4.0.0)
jekyll-feed (~> 0.12)
jekyll-sitemap
jekyll-target-blank
jekyll-tidy
kramdown-math-katex
tzinfo (~> 1.2)
Expand All @@ -101,4 +112,4 @@ DEPENDENCIES
webrick (~> 1.7)

BUNDLED WITH
2.2.24
2.2.32
56 changes: 2 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
# Jekyll Garden v 0.3 (Stable)
# Working Notes of Hiran Venugopalan

This is a simple Jekyll theme created for building a digital garden with Obsidian and Github Pages. You have to fork this theme to your Github account, configure Github pages, and start using the `_notes` folder as the Obsidian vault. Check out [the demo](https://jekyll-garden.github.io/).

<img align="center" src="./assets/img/screenshot-mixed.png">

## Installation (Github pages)
_Detailed Installation how-to, with screenshots available [here](https://jekyll-garden.github.io/posts/how-to)_

Building a Jekyll website on Github Page is simple and seamless.

- Step 1: Sign-In to Github, visit the theme page and click on 'Use this Template'
- Step 2: Name the forked repo as `yourusername.github.io`
- Step 3: Go to your repo's settings > pages and set the source to your main branch.
- Step 4 (Optional): If you have a custom domain, set CNAME.

Claps! The Jekyll website with a Note Garden theme is ready. Visit `yourusername.github.io` to see that.
_If it's not working, edit this readme (add something and commit) to trigger static page generation._

### Part 2, setting Github Repo with Obsidian.

- Step 1: Go to `yourusername.github.io`, and clone your repository to your machine. For this, you can use git-commands or install Github for desktop.
- Step 2: Once you have successfully cloned the repository to your machine, Open the Obsidian app, and set the folder `_notes` inside the repository as your vault.
- Step 3: You can start adding notes to this vault and add frontmatter to support. Read about YAML at `Welcome to the garden`.
- Step 4: Once you have enough notes, got to the Github Desktop app, commit the changes to main, and push the changes to Github. Github will update the pages!


## Credits & Thanks
- [rgvr](https://github.com/rgvr), who created [Simply Jekyll theme](https://github.com/rgvr/simply-jekyll). This theme is a fork of Simply Jekyll and 90% code is by Raghu.
- [Asim K T](https://github.com/asimkt), who coded the base HTML.
- [Santosh Thottingal](https://github.com/santhoshtr), [Binny V A](https://github.com/binnyva), Puttalu who introduced me to Digital Garden, Zettelkasten, Org Mode etc. :)
- Team [Obsidian](https://obsidian.md/) for making obsidian a [markdown](https://daringfireball.net/projects/markdown/) based product
- Dark Mode Switch by [Derek Kedziora](https://github.com/derekkedziora) - [Source link](https://github.com/derekkedziora/jekyll-demo/blob/master/scripts/mode-switcher.js)

## Contribution

To set up your environment to develop this theme, run `bundle install` after cloning this repository in your local machine.

Your theme is set up just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. `_notes` contain all atomic notes. If you want to use this for blog, add posts inside `_posts` folder, following standard Jekyll frontamtter.

### Hosting in a Docker Container
For hosting on your local network, inside a docker container, install `docker` and `docker-compose` and run,
```Terminal
$ docker-compose up -d
```
> **Note**:-
>
> This container is built upon on alpine based ruby image. There's an official Jekyll image available in docker hub which only support `amd64` images. You can opt to use that if you are running the container on an 64bit PC. If you want to run this on an ARM based system like Raspberry Pi, this would be a better option.
>
> The directories which will be frequently modified, are mapped as local volumes so that any changes made to those will be immediately picked up by the server and built. If you fancy changing content in other folders regularly, feel free to add them to the `volumes` section in `docker-compose.yml` before deploying.


## License

The theme is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Powered using [Jekyll Garden](https://github.com/Jekyll-Garden/jekyll-garden.github.io) Theme.
6 changes: 3 additions & 3 deletions assets/js/SearchData.json → SearchData.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
permalink: /assets/js/SearchData.json
permalink: /SearchData.json
---

{
Expand All @@ -10,8 +10,8 @@ permalink: /assets/js/SearchData.json
"doc": {{ note.title | strip_html | escape | jsonify }},
"title": {{ note.title | strip_html | escape | jsonify }},
"content": {{ note.content | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '<ul', ' . <ul' | replace: '</ul', ' . </ul' | replace: '<ol', ' . <ol' | replace: '</ol', ' . </ol' | replace: '</tr', ' . </tr' | replace: '<li', ' | <li' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | replace: '<td', ' | <td' | replace: '</th', ' | </th' | replace: '<th', ' | <th' | strip_html | remove: 'Table of contents' | normalize_whitespace | replace: '. . .', '.' | replace: '. .', '.' | replace: '| |', '|' | append: ' ' | strip_html | strip_newline | strip | escape | jsonify }},
"url": "{{ note.url }}"
"url": "{{ site.baseurl }}{{ note.url }}"
}{%- unless forloop.last -%},{%- endunless -%}{%- assign i = i | plus: 1 -%}

{% endfor %}
}
}
91 changes: 31 additions & 60 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,66 +18,39 @@
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

# URL is the base hostname with protocol for your site, eg http://example.com
url: "" # the base hostname & protocol for your site, e.g. http://example.com

baseurl: "/" # the subpath of your site, e.g. /blog
url: "https://jekyll-garden.github.io/" # the base hostname & protocol for your site, e.g. http://example.com
# If you want to install this jekyll in a subpath (eg /digitalgarden) set it here.
# Else keep it Empty (DON'T PUT /; Keep it empty)
baseurl: ""

#######################################################################
# Settings related to the Header and your About page go here,such as
# your name, site name, profile pic, site tagline, your bio,
# your social media links etc
#######################################################################

heading: Digital Garden # Change this
# Website Header, Description, Footer year and text.
# If you are deleting this, make sure you remove it from HTML files too
heading: Jekyll Garden # Change this
content: Obsidian ready Jekyll Theme
copyright:
year: 2021
msg: Your Name # This is a mandatory attribute for copyright to be displayed ; If deleting this, edit at footer layout.
year: © 2022
msg: Contents under CC-BY-NC

# Set title and content for private & broken link tooltop
privatelinks:
title: Private or Broken Links
msg: The page you're looking for is either not available or private!

#####################################################################
# Settings related to your preferences go here, such as the
# search results, wiki-style-links, sidenotes, marginnotes,
# transclusion, pagepreview, backlinks, related posts, highlighting,
# context menu, flashcards, sliding window, wrapping
#####################################################################
# Theme level preferences
# To enable set "enabled : true" else, use "enabled:false"
preferences:
search:
enabled: true
shortcut_hint:
enabled: true
wiki_style_link: # This property handles wiki style links '[['
enabled: true
sidenotes:
enabled: true
transclusion:
enabled: true
image:
wiki_style_link:
enabled: true
pagepreview:
pagepreview:
enabled: true
highlighting:
enabled: true
color: DAEDFF # Takes hexadecimal and basic names like white, red, etc.
# Do not add '#'(the pound symbol) before the hexadecimal number.
# In yml, it is considered as a comment
backlinks:
enabled: true
related:
enabled: false # This enables the posts that are related to each other by tags
wrapping:
enabled: true
contextmenu:
enabled: false #Not supported in NotesGadern theme
copylink:
enabled: false
newtab:
enabled: false
backlinks:
enabled: false
related:
enabled: false
flashcards:
enabled: false #Not supported in NotesGadern theme
# To enable a homepage, change the value to true and add content to _includes/Homepage.html
# If enable : false, notes feed will be as homepage.
homepage:
enabled: true ##If you need a homepage, change this to true and edit _includes/Homepage.html

Expand All @@ -89,18 +62,13 @@ plugins:
- jekyll-feed
- jekyll-sitemap
- jekyll-tidy

## Enable _notes Collection

## Enable Collections
## Suggested collects are "notes" "lists" and "blog"
collections:
notes:
output: true
permalink: /notes/:title
# Disqus Comments
disqus:
# Leave shortname blank to disable comments site-wide.
# Disable comments for any post by adding `comments: false` to that post's YAML Front Matter.
## Disabled for NotesGarden Theme.
shortname:
permalink: /note/:title

markdown: kramdown

Expand All @@ -120,7 +88,7 @@ defaults:
type: posts
values:
layout: Post
permalink: /posts/:title
permalink: /post/:title
content-type: post
- scope:
path: ""
Expand All @@ -138,7 +106,10 @@ defaults:
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
exclude:
- _notes/000 Inbox
- _notes/200 Private
- _notes/300 Templates
# - .sass-cache/
# - .jekyll-cache/
# - gemfiles/
Expand All @@ -148,4 +119,4 @@ defaults:
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
# - vendor/ruby/
Binary file added _includes/.DS_Store
Binary file not shown.
18 changes: 12 additions & 6 deletions _includes/Backlinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,34 @@
{%- assign display_class = 'show' -%}
{%- endif -%}
<div class="related {{display_class}}" id="jekyll-seamless-backlinks">
<h5 class="block-title">Links to this note</h5>
<h5 class="meta-title centre-title">Links to this note</h5>
<div class="related-wrapper">
{%- for note in site.notes -%}
{%- if note.url != page.url -%}
{%- if note.content contains wiki_link_title -%}
<div class="related-group"><a href="{{note.url}}">
<h4>{{ note.title }}</h4>
<p class="related-excerpt" style="margin: 0px;">{{ note.content | markdownify | strip_html | truncate: 100 }}</p>
<div class="related-group"><a href="{{ site.baseurl }}{{note.url}}">
<h6>{{ note.title }}</h6>
<p class="excerpt" style="margin: 0px; color: var(--color-text-main) !important;">{{ note.content | strip_html | strip | remove: "[[" | remove: "]]" | remove: "-" | escape | truncate: 100 }}</p>
</a></div>
{%- endif -%}
{%- endif -%}
{%- endfor -%}
<!--
This code is to show other pages (note under collection) as Backlink.
Disabled as I don't see a need for this right now.

{%- for note in site.pages -%}
{%- if note.url != page.url -%}
{%- if note.content contains wiki_link_title -%}
<div class="related-group"><a href="{{note.url}}">
<h4>{{ note.title }}</h4>
<p class="related-excerpt" style="margin: 0px;">{{ note.content | markdownify | strip_html | truncate: 100 }}</p>
<h6>{{ note.title }}</h6>
<p class="excerpt" style="margin: 0px;">{{ note.content | strip_html | strip | remove: "[[" | remove: "]]" | escape | truncate: 100 }}</p>
</a></div>
{%- endif -%}
{%- endif -%}
{%- endfor -%}

-->
</div>
<br/>
</div>
Expand Down
52 changes: 0 additions & 52 deletions _includes/Comments.html

This file was deleted.

8 changes: 4 additions & 4 deletions _includes/Content.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
{%- for title in internal_link_array -%}
{%- assign url = internal_url_array[forloop.index0] -%}
{%- if url == nil -%}
{%- assign link_text = '<a class="stale-link" href="' | append: 'javascript:void(0)' | append: '">' | append: title | append: '</a>' -%}
{%- assign link_text = '<span class="tooltip"><a class="stale-link" href="' | append: 'javascript:void(0)' | append: '">' | append: title | append: '</a> <span class="right bottom"> <span class="tooltip-title">' | append: {{site.privatelinks.title}} | append: '</span><br/><span class="tooltip-excerpt">' | append: {{site.privatelinks.msg}} | append : ' <br/></span> </span></span>' -%}
{%- elsif url == empty -%}
{%- assign link_text = '<a class="stale-link" href="' | append: 'javascript:void(0)' | append: '">' | append: title | append: '</a>' -%}
{%- assign link_text = '<span class="tooltip"><a class="stale-link" href="' | append: 'javascript:void(0)' | append: '">' | append: title | append: '</a> <span class="right bottom"> <span class="tooltip-title">' | append: {{site.privatelinks.title}} | append: '</span><br/><span class="tooltip-excerpt">' | append: {{site.privatelinks.msg}} | append : ' <br/></span> </span></span>' -%}
{%- else -%}
{%- assign post = site.notes | where: 'title',title -%}
{%- if post[0].title == nil -%}
{%- assign post = site.posts | where: 'title',title -%}
{%- endif -%}
{%- assign excerpt = post[0].content | markdownify | strip_html | truncate: 200 | newline_to_br -%}
{%- if site.preferences.pagepreview.enabled -%}
{%- assign link_text = '<span class="tooltip"><a href="' | append: url | append: '">' | append: title | append: '</a><span class="right bottom"><span class="tooltip-title">' | append: title | append: '</span><br/><span class="tooltip-excerpt">' | append: excerpt | append: '</span><i></i></span></span>' -%}
{%- assign link_text = '<span class="tooltip"><a href="' |append: {{site.baseurl}} | append: url | append: '">' | append: title | append: '</a><span class="right bottom"><span class="tooltip-title">' | append: title | append: '</span><br/><span class="tooltip-excerpt">' | append: excerpt | remove: "[[" | remove: "]]" | append: '</span><i></i></span></span>' -%}
{%- else -%}
{%- assign link_text = '<span><a href="' | append: url | append: '">' | append: title | append: '</a></span>' -%}
{%- endif -%}
Expand Down Expand Up @@ -155,4 +155,4 @@
{%- else -%}
{{content}}
{%- endif -%}
</div>
</div>
Loading