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", + }, + }; }; diff --git a/scripts/install b/scripts/install index cf00917..9596859 100755 --- a/scripts/install +++ b/scripts/install @@ -26,9 +26,7 @@ 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 -f "../sources/src/" "$data_dir/" chown -R $app:www-data "$install_dir" @@ -65,8 +63,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 #================================================= 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 #================================================= 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" #================================================= diff --git a/sources/index.md b/sources/index.md deleted file mode 100644 index 8d1d0bf..0000000 --- a/sources/index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -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/) 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/src/index.md b/sources/src/index.md new file mode 100644 index 0000000..7d792d0 --- /dev/null +++ b/sources/src/index.md @@ -0,0 +1,6 @@ +--- +title: Hello world +layout: "base.njk" +--- + +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/) 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