Compare commits
9 Commits
d3e40d1d23
...
e835486965
Author | SHA1 | Date | |
---|---|---|---|
e835486965 | |||
4d1a265b9d | |||
c05ccae7ff | |||
82170a7ee5 | |||
31ab29ccbb | |||
687595b4c9 | |||
51a5046f3c | |||
b9b4d0bf8b | |||
|
6b194c5069 |
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,9 +1,3 @@
|
||||
[submodule "themes/hugo-coder"]
|
||||
path = themes/hugo-coder
|
||||
url = https://github.com/luizdepra/hugo-coder.git
|
||||
[submodule "themes/PaperMod"]
|
||||
path = themes/PaperMod
|
||||
url = https://github.com/adityatelange/hugo-PaperMod.git
|
||||
[submodule "themes/stack"]
|
||||
path = themes/stack
|
||||
url = https://github.com/CaiJimmy/hugo-theme-stack.git
|
||||
|
@ -58,6 +58,8 @@ L'idée est simple :
|
||||
|
||||
De cette façon, je n'ai plus besoin de copier manuellement de fichiers ni de gérer les déploiements. Tout se déroule, de l'écriture de Markdown dans Obsidian au déploiement complet du site web.
|
||||
|
||||

|
||||
|
||||
---
|
||||
## ⚙️ Implémentation
|
||||
|
||||
|
@ -57,6 +57,8 @@ The idea is simple:
|
||||
|
||||
This way, I never need to manually copy files or trigger deployments. Everything flows from writing markdown in Obsidian to having a fully deployed website.
|
||||
|
||||

|
||||
|
||||
---
|
||||
## ⚙️ Implementation
|
||||
|
||||
|
28
docker/Dockerfile
Normal file
28
docker/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM nginx:stable
|
||||
|
||||
ARG HUGO_VERSION
|
||||
ENV HUGO_VERSION=${HUGO_VERSION}
|
||||
ENV HUGO_DEST=/usr/share/nginx/html
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
git \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download Hugo
|
||||
RUN curl -sSL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
|
||||
| tar -xz -C /usr/local/bin hugo
|
||||
|
||||
# Add entrypoint script
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Copy custom nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# Nginx serves on port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Set default entrypoint
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
16
docker/entrypoint.sh
Normal file
16
docker/entrypoint.sh
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
REPO_URL="${REPO_URL:-https://git.vezpi.me/Vezpi/blog.git}"
|
||||
BRANCH="${BRANCH:-preview}"
|
||||
CLONE_DIR="${CLONE_DIR:-/blog}"
|
||||
|
||||
echo "- Cloning $REPO_URL (branch: $BRANCH)..."
|
||||
git clone --depth 1 --recurse-submodules --branch "$BRANCH" "$REPO_URL" "$CLONE_DIR"
|
||||
|
||||
echo "- Building site with Hugo v$HUGO_VERSION in $HUGO_DEST..."
|
||||
hugo --source "$CLONE_DIR" --destination "$HUGO_DEST" --logLevel info --cleanDestinationDir --gc --panicOnWarning --printI18nWarnings
|
||||
|
||||
echo "- Starting Nginx..."
|
||||
exec nginx -g 'daemon off;'
|
26
docker/nginx.conf
Normal file
26
docker/nginx.conf
Normal file
@ -0,0 +1,26 @@
|
||||
map $http_accept_language $lang {
|
||||
default en;
|
||||
~fr fr;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Redirect users to their language home page
|
||||
rewrite ^/$ /$lang/ redirect;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Custom 404 page
|
||||
error_page 404 /$lang/404.html;
|
||||
location = /$lang/404.html {
|
||||
internal;
|
||||
}
|
||||
}
|
||||
|
11
layouts/index.json.json
Normal file
11
layouts/index.json.json
Normal file
@ -0,0 +1,11 @@
|
||||
{{- $.Scratch.Add "index" slice -}}
|
||||
{{- range .Site.RegularPages -}}
|
||||
{{- $.Scratch.Add "index" (dict
|
||||
"title" .Title
|
||||
"permalink" .Permalink
|
||||
"summary" .Summary
|
||||
"tags" .Params.tags
|
||||
"date" (.Date.Format "2006-01-02")
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- $.Scratch.Get "index" | jsonify -}}
|
BIN
static/img/obsidian-blog-gitea-actions-workflow.png
Normal file
BIN
static/img/obsidian-blog-gitea-actions-workflow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
Loading…
x
Reference in New Issue
Block a user