diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/README.md b/README.md index 0997ac5..0860f3e 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,10 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -This is a dummy description of this app features +Eleventy is a simpler static site generator. **Shipped version:** 2.0.1~ynh1 - -## Screenshots - -![Screenshot of Eleventy](./doc/screenshots/example.jpg) - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 4891e85..41b6c59 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,15 +16,9 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Ceci est une fausse description des fonctionalités de l'app - +Eleventy est un générateur de site statique. **Version incluse :** 2.0.1~ynh1 - -## Captures d’écran - -![Capture d’écran de Eleventy](./doc/screenshots/example.jpg) - ## Documentations et ressources * Site officiel de l’app : diff --git a/conf/.eleventy.js b/conf/.eleventy.js index 36b89e2..2ad0349 100644 --- a/conf/.eleventy.js +++ b/conf/.eleventy.js @@ -1,9 +1,9 @@ module.exports = function (eleventyConfig) { - eleventyConfig.addPassthroughCopy("./src/style.css"); + eleventyConfig.addPassthroughCopy("__DATA_DIR__/src/style.css"); return { dir: { - input: "src", - output: "public", + input: "__DATA_DIR__/src", + output: "__DATA_DIR__/public", }, }; }; diff --git a/conf/systemd.service b/conf/systemd.service index e41622a..1a953a1 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Eleventy +Description=Eleventy: Simpler site generator After=network.target [Service] diff --git a/doc/ADMIN.md b/doc/ADMIN.md index c9b5225..57bc000 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1,3 +1,2 @@ -This is a dummy admin doc for this app - -The app install dir is `__INSTALL_DIR__` +The served file directory: `__DATA_DIR__/src/` +The configuration file: `INSTALL_DIR__/.eleventy.js` diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index a138028..4508df5 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1,3 +1,2 @@ -Ceci est une fausse doc d'admin pour cette app - -Le dossier d'install de l'app est `__INSTALL_DIR__` +Le répertoire des fichiers : `__DATA_DIR__/src/` +Le fichier de configuration : `INSTALL_DIR__/.eleventy.js` \ No newline at end of file diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 3f2e57a..22c7223 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -This is a dummy description of this app features +Eleventy is a simpler static site generator. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 13f4b64..0a81580 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1 @@ -Ceci est une fausse description des fonctionalités de l'app +Eleventy est un générateur de site statique. \ No newline at end of file diff --git a/doc/screenshots/example.jpg b/doc/screenshots/example.jpg deleted file mode 100644 index a1efa1a..0000000 Binary files a/doc/screenshots/example.jpg and /dev/null differ diff --git a/manifest.toml b/manifest.toml index 9dc89fe..3f8aac8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ packaging_format = 2 id = "eleventy" name = "Eleventy" description.en = "Simpler site generator. Transforms a directory of templates (of varying types) into HTML" -description.fr = "Simpler site generator. Transforms a directory of templates (of varying types) into HTML" +description.fr = "Générateur de site plus simple. Transforme un répertoire de modèles (de différents types) en HTML" version = "2.0.1~ynh1" @@ -22,7 +22,7 @@ multi_instance = true ldap = false sso = false disk = "50M" -ram.build = "50M" +ram.build = "500M" ram.runtime = "50M" [install] @@ -46,6 +46,9 @@ ram.runtime = "50M" [resources.install_dir] + [resources.data_dir] + subdirs = ["src", "public"] + [resources.permissions] main.url = "/" diff --git a/scripts/backup b/scripts/backup index f8e82aa..2ee75c0 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,13 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +# Only relevant if there is a "data_dir" resource for this app +ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index af1d36e..cf00917 100755 --- a/scripts/install +++ b/scripts/install @@ -26,9 +26,9 @@ 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="$install_dir/src/index.md" -ynh_add_config --template="../sources/style.css" --destination="$install_dir/src/style.css" -mv "../sources/_includes" "$install_dir/src/_includes" +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" @@ -44,7 +44,7 @@ env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Simpler site generator" --log="/var/log/$app/$app.log" #================================================= # APP INITIAL CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 55ee0f9..3feb114 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,24 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +# (Same as for install dir) +chown -R $app:www-data "$data_dir" + +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=7 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= @@ -31,7 +49,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Simpler site generator" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 6f7bfce..28a2167 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,6 +34,14 @@ fi chown -R $app:www-data "$install_dir" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=5 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -44,7 +52,7 @@ ynh_add_nginx_config env_path="$PATH" ynh_add_systemd_config -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Simpler site generator" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/sources/index.md b/sources/index.md index ddf39ce..8d1d0bf 100644 --- a/sources/index.md +++ b/sources/index.md @@ -3,4 +3,4 @@ title: Hello world layout: "base.njk" --- -This is a template, please replace with your content: __INSTALL_DIR__/src/index.md \ No newline at end of file +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/)