From cd607aadc8f7f7f15f033971761ef301f3084542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 22:12:43 +0200 Subject: [PATCH 1/9] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index cf00917..4bf24fa 100755 --- a/scripts/install +++ b/scripts/install @@ -65,8 +65,8 @@ ynh_script_progression --message="Installing $app..." --weight=10 pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm init -y - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm install @11ty/eleventy --save-dev + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm init -y + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install @11ty/eleventy --save-dev popd #================================================= From 4c44b78cbb9964f56c88f9973a41ad7ccb675c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 22:14:11 +0200 Subject: [PATCH 2/9] Update upgrade --- scripts/upgrade | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 28a2167..043483b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -52,6 +52,21 @@ ynh_add_nginx_config env_path="$PATH" ynh_add_systemd_config +#================================================= +# INSTALL ELEVENTY +#================================================= +ynh_script_progression --message="Installing $app..." --weight=10 + +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm init -y + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install @11ty/eleventy --save-dev +popd + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= + yunohost service add $app --description="Simpler site generator" --log="/var/log/$app/$app.log" #================================================= From 6a640a8463a2f5c6b313ff9932010c70254c246d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:13:28 +0200 Subject: [PATCH 3/9] fix --- scripts/install | 8 +++++--- sources/{ => src}/_includes/base.njk | 0 sources/{ => src}/index.md | 0 sources/{ => src}/style.css | 0 4 files changed, 5 insertions(+), 3 deletions(-) rename sources/{ => src}/_includes/base.njk (100%) rename sources/{ => src}/index.md (100%) rename sources/{ => src}/style.css (100%) diff --git a/scripts/install b/scripts/install index 4bf24fa..68322b1 100755 --- a/scripts/install +++ b/scripts/install @@ -26,9 +26,11 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" -ynh_add_config --template="../sources/index.md" --destination="$data_dir/src/index.md" -ynh_add_config --template="../sources/style.css" --destination="$data_dir/src/style.css" -mv "../sources/_includes" "$data_dir/src/_includes" +mv --template="../sources/src/" --destination="$data_dir/src/" + +#ynh_add_config --template="../sources/index.md" --destination="$data_dir/src/index.md" +#ynh_add_config --template="../sources/style.css" --destination="$data_dir/src/style.css" +#mv "../sources/_includes" "$data_dir/src/_includes" chown -R $app:www-data "$install_dir" diff --git a/sources/_includes/base.njk b/sources/src/_includes/base.njk similarity index 100% rename from sources/_includes/base.njk rename to sources/src/_includes/base.njk diff --git a/sources/index.md b/sources/src/index.md similarity index 100% rename from sources/index.md rename to sources/src/index.md diff --git a/sources/style.css b/sources/src/style.css similarity index 100% rename from sources/style.css rename to sources/src/style.css From e86b6bc22fcaa9753cd6e6e8c364f28b585b0ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:14:38 +0200 Subject: [PATCH 4/9] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 68322b1..48dee32 100755 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" -mv --template="../sources/src/" --destination="$data_dir/src/" +mv "../sources/src/" "$data_dir/src/" #ynh_add_config --template="../sources/index.md" --destination="$data_dir/src/index.md" #ynh_add_config --template="../sources/style.css" --destination="$data_dir/src/style.css" From 2e3111a0216bdeb36e15cb18cec854947b46fd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:17:09 +0200 Subject: [PATCH 5/9] fix --- scripts/install | 2 +- scripts/remove | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 48dee32..6e95f45 100755 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" -mv "../sources/src/" "$data_dir/src/" +mv "../sources/src/" "$data_dir/" #ynh_add_config --template="../sources/index.md" --destination="$data_dir/src/index.md" #ynh_add_config --template="../sources/style.css" --destination="$data_dir/src/style.css" diff --git a/scripts/remove b/scripts/remove index 59b1cc0..9acfbb5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,6 @@ ynh_remove_systemd_config ynh_remove_nginx_config -# Remove NodeJS ynh_remove_nodejs #================================================= From 71afbb02f485a48d2aee3ced75f83fa2dfb84ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:23:32 +0200 Subject: [PATCH 6/9] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6e95f45..1db9e98 100755 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" -mv "../sources/src/" "$data_dir/" +mv -f "../sources/src/" "$data_dir/" #ynh_add_config --template="../sources/index.md" --destination="$data_dir/src/index.md" #ynh_add_config --template="../sources/style.css" --destination="$data_dir/src/style.css" From 545310f0d5a2e67e31ed66fa44337315b8ba25ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:24:07 +0200 Subject: [PATCH 7/9] Update index.md --- sources/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/src/index.md b/sources/src/index.md index 8d1d0bf..7d792d0 100644 --- a/sources/src/index.md +++ b/sources/src/index.md @@ -3,4 +3,4 @@ title: Hello world layout: "base.njk" --- -This is a mockup page (located here: __DATA_DIR__/src/index.md), please follow the instructions to set up your pages: [https://www.11ty.dev/docs/getting-started/](https://www.11ty.dev/docs/getting-started/) +This is a mockup page (located here: /home/yunohost.app/eleventy/src/index.md), please follow the instructions to set up your pages: [https://www.11ty.dev/docs/getting-started/](https://www.11ty.dev/docs/getting-started/) From 9f38ff2f2656f4b632c61d905a15ba7caf99b716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:24:17 +0200 Subject: [PATCH 8/9] Update install --- scripts/install | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/install b/scripts/install index 1db9e98..9596859 100755 --- a/scripts/install +++ b/scripts/install @@ -28,10 +28,6 @@ ynh_setup_source --dest_dir="$install_dir" mv -f "../sources/src/" "$data_dir/" -#ynh_add_config --template="../sources/index.md" --destination="$data_dir/src/index.md" -#ynh_add_config --template="../sources/style.css" --destination="$data_dir/src/style.css" -#mv "../sources/_includes" "$data_dir/src/_includes" - chown -R $app:www-data "$install_dir" #================================================= From 175da8a614e445f130d2c18145804c8af1837cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 23:25:42 +0200 Subject: [PATCH 9/9] Update .eleventy.js --- conf/.eleventy.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/conf/.eleventy.js b/conf/.eleventy.js index 2ad0349..bdc5dec 100644 --- a/conf/.eleventy.js +++ b/conf/.eleventy.js @@ -1,9 +1,9 @@ module.exports = function (eleventyConfig) { - eleventyConfig.addPassthroughCopy("__DATA_DIR__/src/style.css"); - return { - dir: { - input: "__DATA_DIR__/src", - output: "__DATA_DIR__/public", - }, - }; + eleventyConfig.addPassthroughCopy("__DATA_DIR__/src/style.css"); + return { + dir: { + input: "__DATA_DIR__/src", + output: "__DATA_DIR__/public", + }, + }; };