-
As a PhD student relying heavily on Obsidian, I'm looking for a way to share some of my notes with my lab colleagues. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 17 replies
-
I don't know your skill level when it comes to node and docker, so excuse me if I'm either over or under explaining this. Let me know if you have any questios, or something isn't clear. I threw something together you could use to run this locally:
const express = require('express')
const app = express()
const port = 8080;
const searchHandler = require('./netlify/functions/search/search.js').handler;
app.get('/api/search', async (req, res) => {
//Mock the netlify event
let event = {queryStringParameters: req.query};
let response = await searchHandler(event);
res.status(response.statusCode).send(response.body);
})
app.use(express.static('dist'))
app.get('*', (req, res)=>{
res.redirect("/404")
})
app.listen(port, () => {
console.log(`Digital garden running on port ${port}`)
})
The site should now be available at localhost:8080. You can then use something like pm2 to run it on your server, and use a reverse nginx proxy with lets encrypt to expose it on port 443 with https. The one thing it is missing is automatically pulling the latest changes when you publish a note. I will make a docker file available that does all this sometime in the future, when I find the time, so everybody has this option easily available. Hopefully this is enough to get you started. If you manage to actually create a docker file for this, I would be very happy to accept a PR 😄 |
Beta Was this translation helpful? Give feedback.
-
Could you please clarify, who performs the actual Markdown -> HTML rendering? Thank you. |
Beta Was this translation helpful? Give feedback.
-
@naquad the answer is Eleventy. Under the hood this plugin is taking the markdown files selected for publishing, bundling them up into a github repository, that is then rendered into a static website using the 11ty static site generator. The rendering of the github repo has to be "run" somewhere, and the default pathway documented is to hook up the github repo to vercel for the rendering+hosting dance. It could be done 100% on GitHub + GitHub Actions if you want to skip that part. |
Beta Was this translation helpful? Give feedback.
-
The template repository has changed since @oleeskild posted his answer. One significant change is that the default hosting platform was Netlify, but it was swapped to Vercel. I'm not sure if this swapping caused the removal of the Netlify directory, but new repositories don't include it. Try commenting out or removing the statements that use
|
Beta Was this translation helpful? Give feedback.
-
I think the most convenient way is to deploy your digital garden in the very same git repo, but as a new branch and as a github page. this way you dont need netlify, vercel, a proxy server, docker or anything else. just one git repo and nothing more. https://github.com/geschenkwald/geschenkwald.github.io so the belongig digital-garden is (by github design, as mentioned, username.github.io): geschenkwald.github.io/ or, as you can see in my modified build.yaml file, you can set a custom CNAME, which I set to: cognithink.de Additionally what is really really cool, you can integrate giscus in your blog/digital garden by utilizing the discussion function of the same repo as well. to get this working you have to edit the template files slightly (which are
And as you can see there is now a perfectly working comments sections below each of my blog articles and since i added myself (this account) as a collaborator in the settings of the geschenkwald.github.io repo, i can directly moderate, edit, delete comments in the discussion section without even having to logout and login with the other account. @oleeskild if you are interested in this approach, i could make a new branch with a clean code and a pull request (or two, one for gh-page deployment and one for the giscus feature). additionally for giscus we could add an integration in the obsidian plugin, for example an option which the user can opt-in (like the file-tree-sidebar enable/disable etc). |
Beta Was this translation helpful? Give feedback.
-
This is brilliant and basically what I was hoping to do when I first
started wanting to do a digital garden and the whole Vercel setup (and it's
associated bits and services) is really what turned me away.
I'll have to check this out and see if I can put it in practice on my end
…On Thu, Jun 6, 2024, 6:34 PM Yazan Agha-Schrader ***@***.***> wrote:
I think the most convenient way is to deploy your digital garden in the
very same git repo, but as a new branch and as a github page. this way you
dont need netlify, vercel, a proxy server, docker or anything else. just
one git repo and nothing more.
you have to name the forked repo your_user_name.github.io. here is an
example where i did exactly this (with my other github account):
https://github.com/geschenkwald/geschenkwald.github.io
so the belongig digital-garden is (by github design, as mentioned,
username.github.io): geschenkwald.github.io/
or, as you can see in my modified build.yaml file, you can set a custom
CNAME, which I set to: cognithink.de
Additionally what is really really cool, you can integrate giscus
<https://giscus.app/> in your blog/digital garden by utilizing the
discussion function of the same repo as well. to get this working you have
to edit the template files slightly (which are
src/site/_includes/layouts/index.njk and note.njk). so in my case for
example i basically added the following:
<!-- ... -->
{% endfor %}
{{ content | hideDataview | taggify | link | safe}}
<!-- comments section placeholder -->
<div class="giscus"></div>
<!-- giscus-script -->
<script src="https://giscus.app/client.js"
data-repo="geschenkwald/geschenkwald.github.io"
data-repo-id="R_kgDOLBDuTA"
data-category="Announcements"
data-category-id="DIC_kwDOLBDuTM4Cf6VU"
data-mapping="title"
data-strict="0"
data-reactions-enabled="0"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="de"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>
{% for imp in dynamics.common.afterContent %}
<!-- ... -->
And as you can see there is now a perfectly working comments sections
below each of my blog articles and since i added myself (this account) as a
collaborator in the settings of the geschenkwald.github.io repo, i can
directly moderate, edit, delete comments in the discussion section without
even having to logout and login with the other account.
@oleeskild <https://github.com/oleeskild> if you are interested in this
approach, i could make a new branch with a clean code and a pull request
(or two, one for gh-page deployment and one for the giscus feature).
additionally for giscus we could add an integration in the obsidian plugin,
for example an option which the user can opt-in (like the file-tree-sidebar
enable/disable etc).
—
Reply to this email directly, view it on GitHub
<#160 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3K3S6Y4OAF3GMDDXG2NRTZGDPWHAVCNFSM6AAAAAATZPS2C2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TMOJUGU2TM>
.
You are receiving this because you are subscribed to this thread.Message
ID:
<oleeskild/obsidian-digital-garden/repo-discussions/160/comments/9694556@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello, can someone please share this project as consumable docker image? |
Beta Was this translation helpful? Give feedback.
I don't know your skill level when it comes to node and docker, so excuse me if I'm either over or under explaining this. Let me know if you have any questios, or something isn't clear.
I threw something together you could use to run this locally:
npm install express --save
to install express as a dependency.