Skip to content

obsidian-publish + hugo

dentropydaemon-wiki/Software/List/Obsidian Quartz

Publishing

start.sh

#!/bin/bash
export PATH="/usr/local/go/bin:${PATH}";
export PATH="/quartz/go/bin:${PATH}";
hugo-obsidian -input=content -output=assets/indices -index -root=. ;
hugo server --enableGitInfo --minify --bind="0.0.0.0" --baseURL="http://localhost" --port=1313 --appendPort="true" --liveReloadPort=-1

dockerfile




FROM debian:buster-slim
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR "/quartz"
RUN apt-get -y update
RUN apt-get -y install -y git wget
RUN wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz
RUN wget https://github.com/gohugoio/hugo/releases/download/v0.111.2/hugo_0.111.2_linux-amd64.tar.gz
RUN tar -C /usr/local -xzf hugo_0.111.2_linux-amd64.tar.gz
RUN rm hugo_0.111.2_linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
ENV PATH="/quartz/go/bin:${PATH}"
RUN go install github.com/jackyzha0/hugo-obsidian@latest
EXPOSE 1313
RUN pwd
RUN ls /root/go/bin
RUN ls /usr/local
ADD start.sh /quartz
RUN chmod +x /quartz/start.sh

CMD ["bash", "./start.sh"]


Using Dockerfile

``` bash cat Dockerfile docker build -t hugo-obsidian .