diff --git a/deploy.sh b/deploy.sh old mode 100644 new mode 100755 index c6c9cce..8e2728c --- a/deploy.sh +++ b/deploy.sh @@ -1,9 +1,15 @@ #!/bin/bash # Build +cd v2 hugo +cd .. # Backup current deploy ssh home.hugopoi.net sudo yunohost backup create --apps my_webapp -# Deploy full legacy and new blog -rsync -rlgoD --checksum --verbose www/ home.hugopoi.net:/var/www/my_webapp/www/ -# Deploy only the new hugo blog -rsync -rlgoD --verbose --checksum --delete www/v2/ home.hugopoi.net:/var/www/my_webapp/www/v2/ +echo "$1" +if [[ "$1" == "--full" ]]; then + echo "Deploy full legacy and new blog" + rsync -rlgoD --checksum --verbose www/ home.hugopoi.net:/var/www/my_webapp/www/ +else + echo "Deploy only the new hugo blog" + rsync -rlgoD --verbose --checksum --delete www/v2/ home.hugopoi.net:/var/www/my_webapp/www/v2/ +fi diff --git a/v2/content/post/how-this-blog-is-made/Screenshot 2022-12-03 at 15-30-20 Cupper.png b/v2/content/post/how-this-blog-is-made/Screenshot 2022-12-03 at 15-30-20 Cupper.png new file mode 100644 index 0000000..b4deb39 Binary files /dev/null and b/v2/content/post/how-this-blog-is-made/Screenshot 2022-12-03 at 15-30-20 Cupper.png differ diff --git a/v2/content/post/how-this-blog-is-made/index.md b/v2/content/post/how-this-blog-is-made/index.md index 3324c16..9291051 100644 --- a/v2/content/post/how-this-blog-is-made/index.md +++ b/v2/content/post/how-this-blog-is-made/index.md @@ -133,17 +133,52 @@ parse HTML pages. * [The clever mod](https://home.hugopoi.net/gitea/hugopoi/blog.hugopoi.net/commit/598d28551d071774007172782541e1d140b8a3c1#diff-eb630ac88267e24589fd94de0826721dff38beb4)
- - - - ## The new blog with Hugo I wanted simple markdown that generate static HTML, this why I choose Hugo for my blog. 1. First I add a new directory called `v2` next to the legacy blog. -2. Then you launch `hugo new site v2` this will generate the folder tree needed. -3. I add the Cupper theme with `git submodule add https://github.com/zwbetz-gh/cupper-hugo-theme.git themes/cupper-hugo-theme` -4. Add some custom css -5. Add some config in config.toml +1. Then you launch `hugo new site v2` this will generate the folder tree needed. +1. I choose the Cupper theme + + {{< figureCupper + img="Screenshot 2022-12-03 at 15-30-20 Cupper.png" + caption="Cupper Theme for Hugo" + command="Fit" + options="1024x500" >}} + +1. I add the Cupper theme with `git submodule add https://github.com/zwbetz-gh/cupper-hugo-theme.git themes/cupper-hugo-theme` +1. Add some [custom css](https://home.hugopoi.net/gitea/hugopoi/blog.hugopoi.net/src/commit/80eed4ba721287f4854f26e62a094b26997b4b69/v2/static/css/cupper-hugo-tweaks.css) + +1. Add some config in [`config.toml`](https://home.hugopoi.net/gitea/hugopoi/blog.hugopoi.net/src/branch/master/v2/config.toml) + + +1. I also upgrade prism.js for code highlight in theme itself +1. I add favicon and logo +1. Then I need to build with `hugo` +1. Deploy with rsync in yunohost + +1. I add a CORS header in nginx config + of my Gitea to allow fetching code inside `` html tags + ```nginx + rewrite ^/gitea$ /gitea/ permanent; + location /gitea/ { + proxy_pass http://localhost:6000/; + proxy_set_header Host $host; + proxy_buffering off; + client_max_body_size 200M; + proxy_set_header X-Real-IP $remote_addr; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; + + add_header 'Vary' 'Origin'; + + # Add CORS header for loading code in pre html tags + if ($http_origin ~* "^(http://localhost:1313|https://blog.hugopoi.net)$") { + add_header Access-Control-Allow-Origin "$http_origin"; + } + } + + ``` Moooore to come ! diff --git a/v2/themes/cupper-hugo-theme b/v2/themes/cupper-hugo-theme index 69551a5..2f7a035 160000 --- a/v2/themes/cupper-hugo-theme +++ b/v2/themes/cupper-hugo-theme @@ -1 +1 @@ -Subproject commit 69551a5fbda18f436dcc119b966a437897918d56 +Subproject commit 2f7a0351f101684e7b0fdc1ec726499ae247f7a5