From ce9681dcb45c4c356658ddc4ad6d5969487969a7 Mon Sep 17 00:00:00 2001 From: Plumtree3D <ham.in.kneesocks@gmail.com> Date: Fri, 2 Sep 2022 10:56:14 +0200 Subject: [PATCH] doc: documented images organisation and refactored code --- README.md | 16 ++++++++++++++++ docusaurus.config.js | 2 +- src/components/CarouselLibre.js | 16 ++++++++-------- src/components/HomepageFeatures.js | 2 +- src/components/HomepagePromises.js | 6 +++--- src/pages/communaute.mdx | 2 +- src/pages/tarifs.mdx | 6 +++--- src/theme/Footer/index.js | 4 ++-- .../CarouselLibre/Ansible_logo.png | Bin .../CarouselLibre/Terraform_logo.png | Bin .../CarouselLibre/borg_logo.png | Bin .../CarouselLibre/debian_logo.png | Bin .../CarouselLibre/docusaurus.png | Bin .../CarouselLibre/gitlab_logo.png | Bin .../CarouselLibre/mattermost_logo.png | Bin .../CarouselLibre/openlogo-nd.svg | 0 .../CarouselLibre/restic_logo.png | Bin .../{ => components}/HomepageFeatures/beer.png | Bin .../HomepageFeatures/chemistry.svg | 0 .../{ => components}/HomepageFeatures/hello.png | Bin .../HomepageFeatures/rainbow.svg | 0 .../HomepageFeatures/read-smile.svg | 0 .../HomepageFeatures/selfie.svg | 0 .../HomepagePromises}/bouclier.svg | 0 .../HomepagePromises}/liberte.svg | 0 .../{ => components/HomepagePromises}/rgpd.svg | 0 .../{ => pages/communaute}/cheatsheet_cover.png | Bin static/img/{ => pages}/pricing/cauldron.png | Bin static/img/{ => pages}/pricing/computer.png | Bin static/img/{ => pages}/pricing/hidden.png | Bin static/img/{ => theme}/do-not-track-me.svg | 0 static/img/{ => theme}/docusaurus.png | Bin static/img/{ => theme}/logo.svg | 0 static/img/{ => theme}/logo_froggit.svg | 0 static/img/{ => theme}/logo_froggit_blanc.png | Bin static/img/{ => theme}/logo_typo_froggit.png | Bin 36 files changed, 35 insertions(+), 19 deletions(-) rename static/img/{ => components}/CarouselLibre/Ansible_logo.png (100%) rename static/img/{ => components}/CarouselLibre/Terraform_logo.png (100%) rename static/img/{ => components}/CarouselLibre/borg_logo.png (100%) rename static/img/{ => components}/CarouselLibre/debian_logo.png (100%) rename static/img/{ => components}/CarouselLibre/docusaurus.png (100%) rename static/img/{ => components}/CarouselLibre/gitlab_logo.png (100%) rename static/img/{ => components}/CarouselLibre/mattermost_logo.png (100%) rename static/img/{ => components}/CarouselLibre/openlogo-nd.svg (100%) rename static/img/{ => components}/CarouselLibre/restic_logo.png (100%) rename static/img/{ => components}/HomepageFeatures/beer.png (100%) rename static/img/{ => components}/HomepageFeatures/chemistry.svg (100%) rename static/img/{ => components}/HomepageFeatures/hello.png (100%) rename static/img/{ => components}/HomepageFeatures/rainbow.svg (100%) rename static/img/{ => components}/HomepageFeatures/read-smile.svg (100%) rename static/img/{ => components}/HomepageFeatures/selfie.svg (100%) rename static/img/{ => components/HomepagePromises}/bouclier.svg (100%) rename static/img/{ => components/HomepagePromises}/liberte.svg (100%) rename static/img/{ => components/HomepagePromises}/rgpd.svg (100%) rename static/img/{ => pages/communaute}/cheatsheet_cover.png (100%) rename static/img/{ => pages}/pricing/cauldron.png (100%) rename static/img/{ => pages}/pricing/computer.png (100%) rename static/img/{ => pages}/pricing/hidden.png (100%) rename static/img/{ => theme}/do-not-track-me.svg (100%) rename static/img/{ => theme}/docusaurus.png (100%) rename static/img/{ => theme}/logo.svg (100%) rename static/img/{ => theme}/logo_froggit.svg (100%) rename static/img/{ => theme}/logo_froggit_blanc.png (100%) rename static/img/{ => theme}/logo_typo_froggit.png (100%) diff --git a/README.md b/README.md index 4612eff..4b6af65 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,22 @@ More details on Project structure: * `/static/` - Any contents inside here will be copied into the root of the final `build` directory * `/docusaurus.config.js` - This is the equivalent of `siteConfig.js` in Docusaurus v1 +## Image organisation + +Static assets are arranged in a certain way, all images are contained in subfolders within the `img` folder, the subfolder depends on how they are used. Following this structure: + +* An image used on a page will be in a subfolder named after the page, within the `pages` folder. e.g: +__You would find the file `kermit.png` used on the `about` page at `img/pages/about/kermit.png`__ + +* An image used in a component will be in a subfolder named after the component, within the `components` folder. e.g: +__You would find the file `kermit.png` used on the `slider` component at `img/components/slider/kermit.png`__ + +* An image used on a documentation page will be in a subfolder named after the page, within the `docs` folder. e.g: +__You would find the file `kermit.png` used on the `management` documentation page at `img/docs/management/kermit.png`__ + +* Global images (e.g: used in the footer) will be in the `img/theme/` subfolder. + + ## License [](https://choosealicense.com/licenses/mit/) diff --git a/docusaurus.config.js b/docusaurus.config.js index 6e5a858..b895a34 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -17,7 +17,7 @@ module.exports = { title: "", logo: { alt: "Froggit Logo", - src: "img/logo_typo_froggit.png", + src: "img/theme/logo_typo_froggit.png", }, items: [ {label: "Fonctionnalités", position: "left", to: "/#features", exact: true}, diff --git a/src/components/CarouselLibre.js b/src/components/CarouselLibre.js index 405a9d5..05188ce 100644 --- a/src/components/CarouselLibre.js +++ b/src/components/CarouselLibre.js @@ -4,42 +4,42 @@ import clsx from "clsx"; const CarouselList = [ { - img: "/img/CarouselLibre/gitlab_logo.png", + img: "/img/components/CarouselLibre/gitlab_logo.png", name: "GitLab", alt: "logo de GitLab" }, { - img: "/img/CarouselLibre/mattermost_logo.png", + img: "/img/components/CarouselLibre/mattermost_logo.png", name: "Mattermost", alt: "logo de Mattermost" }, { - img: "/img/CarouselLibre/docusaurus.png", + img: "/img/components/CarouselLibre/docusaurus.png", name: "Docusaurus", alt: "logo de Docusaurus" }, { - img: "/img/CarouselLibre/debian_logo.png", + img: "/img/components/CarouselLibre/debian_logo.png", name: "Debian", alt: "logo de Debian" }, { - img: "/img/CarouselLibre/Ansible_logo.png", + img: "/img/components/CarouselLibre/Ansible_logo.png", name: "Ansible", alt: "logo de Ansible" }, { - img: "/img/CarouselLibre/Terraform_logo.png", + img: "/img/components/CarouselLibre/Terraform_logo.png", name: "Terraform", alt: "logo de Terraform" }, { - img: "/img/CarouselLibre/borg_logo.png", + img: "/img/components/CarouselLibre/borg_logo.png", name: "Borg", alt: "logo de Borg" }, { - img: "/img/CarouselLibre/restic_logo.png", + img: "/img/components/CarouselLibre/restic_logo.png", name: "Restic", alt: "logo de Restic" }, diff --git a/src/components/HomepageFeatures.js b/src/components/HomepageFeatures.js index 1c64e73..7e7c69a 100644 --- a/src/components/HomepageFeatures.js +++ b/src/components/HomepageFeatures.js @@ -67,7 +67,7 @@ export default function HomepageFeatures() { {FeatureList.map((em) => ( <TabItem key={em.id} className={clsx("text--center")} value={em.title} label={em.title}> <div className={styles.rowDisplay}> - <img src={useBaseUrl("img/HomepageFeatures/" + em.svg)} alt={em.alt} className={styles.tabImages}/> + <img src={useBaseUrl("img/components/HomepageFeatures/" + em.svg)} alt={em.alt} className={styles.tabImages}/> <p className={styles.textDisplay}> {em.description} </p> </div> </TabItem> diff --git a/src/components/HomepagePromises.js b/src/components/HomepagePromises.js index 7513b49..411e51d 100644 --- a/src/components/HomepagePromises.js +++ b/src/components/HomepagePromises.js @@ -5,7 +5,7 @@ import styles from "./HomepagePromises.module.css"; const PromiseList = [ { title: "Sécurisé", - Svg: require("../../static/img/bouclier.svg").default, + Svg: require("../../static/img/components/HomepagePromises/bouclier.svg").default, alt: "Icône d'un bouclier bleu", description: ( <> @@ -15,7 +15,7 @@ const PromiseList = [ }, { title: "Souverain", - Svg: require("../../static/img/rgpd.svg").default, + Svg: require("../../static/img/components/HomepagePromises/rgpd.svg").default, alt: "Icône d'un cadenas avec inscrit RGPD", description: ( <> @@ -25,7 +25,7 @@ const PromiseList = [ }, { title: "Libre", - Svg: require("../../static/img/liberte.svg").default, + Svg: require("../../static/img/components/HomepagePromises/liberte.svg").default, alt: "Icône de menottes brisées", description: ( <> diff --git a/src/pages/communaute.mdx b/src/pages/communaute.mdx index 1c5ddc9..cf85b6a 100644 --- a/src/pages/communaute.mdx +++ b/src/pages/communaute.mdx @@ -1,6 +1,6 @@ import TextRight from '@site/src/components/TextRight'; -<TextRight img="/img/cheatsheet_cover.png" alt="Illustration de l'antisèche Git"> +<TextRight img="/img/pages/communaute/cheatsheet_cover.png" alt="Illustration de l'antisèche Git"> # Devenez deux fois plus productif grâce à GitLab ! diff --git a/src/pages/tarifs.mdx b/src/pages/tarifs.mdx index 3129236..bc4a974 100644 --- a/src/pages/tarifs.mdx +++ b/src/pages/tarifs.mdx @@ -36,7 +36,7 @@ Si vous achetez plusieurs plans, hors têtard, avec le **même email** vous cumu <div class="card card_price"> <div class="card__image margin-top--md"> <img - src={useBaseUrl("img/pricing/hidden.png")} + src={useBaseUrl("img/pages/pricing/hidden.png")} alt="Image alt text" title="Plan Têtard" /> </div> @@ -69,7 +69,7 @@ Si vous achetez plusieurs plans, hors têtard, avec le **même email** vous cumu <div class="card shadow--tl card_price card_price_main"> <div class="card__image margin-top--md"> <img - src={useBaseUrl("img/pricing/computer.png")} + src={useBaseUrl("img/pages/pricing/computer.png")} alt="Image alt text" title="Plan Grenouille" /> </div> @@ -102,7 +102,7 @@ Si vous achetez plusieurs plans, hors têtard, avec le **même email** vous cumu <div class="card card_price"> <div class="card__image margin-top--md"> <img - src={useBaseUrl("img/pricing/cauldron.png")} + src={useBaseUrl("img/pages/pricing/cauldron.png")} alt="Image alt text" title="Plan Étang" /> </div> diff --git a/src/theme/Footer/index.js b/src/theme/Footer/index.js index 6d7bcfe..2e4bdec 100644 --- a/src/theme/Footer/index.js +++ b/src/theme/Footer/index.js @@ -12,8 +12,8 @@ import FooterLogo from "@theme/Footer/Logo"; import FooterCopyright from "@theme/Footer/Copyright"; import FooterLayout from "@theme/Footer/Layout"; import { FaYoutube, FaLinkedin, FaGitlab, FaTwitter } from "react-icons/fa"; -import Froggitblanc from "/static/img/logo_froggit_blanc.png"; -import DontTrackMe from "/static/img/do-not-track-me.svg"; +import Froggitblanc from "/static/img/theme/logo_froggit_blanc.png"; +import DontTrackMe from "/static/img/theme/do-not-track-me.svg"; import useBaseUrl from "@docusaurus/useBaseUrl"; diff --git a/static/img/CarouselLibre/Ansible_logo.png b/static/img/components/CarouselLibre/Ansible_logo.png similarity index 100% rename from static/img/CarouselLibre/Ansible_logo.png rename to static/img/components/CarouselLibre/Ansible_logo.png diff --git a/static/img/CarouselLibre/Terraform_logo.png b/static/img/components/CarouselLibre/Terraform_logo.png similarity index 100% rename from static/img/CarouselLibre/Terraform_logo.png rename to static/img/components/CarouselLibre/Terraform_logo.png diff --git a/static/img/CarouselLibre/borg_logo.png b/static/img/components/CarouselLibre/borg_logo.png similarity index 100% rename from static/img/CarouselLibre/borg_logo.png rename to static/img/components/CarouselLibre/borg_logo.png diff --git a/static/img/CarouselLibre/debian_logo.png b/static/img/components/CarouselLibre/debian_logo.png similarity index 100% rename from static/img/CarouselLibre/debian_logo.png rename to static/img/components/CarouselLibre/debian_logo.png diff --git a/static/img/CarouselLibre/docusaurus.png b/static/img/components/CarouselLibre/docusaurus.png similarity index 100% rename from static/img/CarouselLibre/docusaurus.png rename to static/img/components/CarouselLibre/docusaurus.png diff --git a/static/img/CarouselLibre/gitlab_logo.png b/static/img/components/CarouselLibre/gitlab_logo.png similarity index 100% rename from static/img/CarouselLibre/gitlab_logo.png rename to static/img/components/CarouselLibre/gitlab_logo.png diff --git a/static/img/CarouselLibre/mattermost_logo.png b/static/img/components/CarouselLibre/mattermost_logo.png similarity index 100% rename from static/img/CarouselLibre/mattermost_logo.png rename to static/img/components/CarouselLibre/mattermost_logo.png diff --git a/static/img/CarouselLibre/openlogo-nd.svg b/static/img/components/CarouselLibre/openlogo-nd.svg similarity index 100% rename from static/img/CarouselLibre/openlogo-nd.svg rename to static/img/components/CarouselLibre/openlogo-nd.svg diff --git a/static/img/CarouselLibre/restic_logo.png b/static/img/components/CarouselLibre/restic_logo.png similarity index 100% rename from static/img/CarouselLibre/restic_logo.png rename to static/img/components/CarouselLibre/restic_logo.png diff --git a/static/img/HomepageFeatures/beer.png b/static/img/components/HomepageFeatures/beer.png similarity index 100% rename from static/img/HomepageFeatures/beer.png rename to static/img/components/HomepageFeatures/beer.png diff --git a/static/img/HomepageFeatures/chemistry.svg b/static/img/components/HomepageFeatures/chemistry.svg similarity index 100% rename from static/img/HomepageFeatures/chemistry.svg rename to static/img/components/HomepageFeatures/chemistry.svg diff --git a/static/img/HomepageFeatures/hello.png b/static/img/components/HomepageFeatures/hello.png similarity index 100% rename from static/img/HomepageFeatures/hello.png rename to static/img/components/HomepageFeatures/hello.png diff --git a/static/img/HomepageFeatures/rainbow.svg b/static/img/components/HomepageFeatures/rainbow.svg similarity index 100% rename from static/img/HomepageFeatures/rainbow.svg rename to static/img/components/HomepageFeatures/rainbow.svg diff --git a/static/img/HomepageFeatures/read-smile.svg b/static/img/components/HomepageFeatures/read-smile.svg similarity index 100% rename from static/img/HomepageFeatures/read-smile.svg rename to static/img/components/HomepageFeatures/read-smile.svg diff --git a/static/img/HomepageFeatures/selfie.svg b/static/img/components/HomepageFeatures/selfie.svg similarity index 100% rename from static/img/HomepageFeatures/selfie.svg rename to static/img/components/HomepageFeatures/selfie.svg diff --git a/static/img/bouclier.svg b/static/img/components/HomepagePromises/bouclier.svg similarity index 100% rename from static/img/bouclier.svg rename to static/img/components/HomepagePromises/bouclier.svg diff --git a/static/img/liberte.svg b/static/img/components/HomepagePromises/liberte.svg similarity index 100% rename from static/img/liberte.svg rename to static/img/components/HomepagePromises/liberte.svg diff --git a/static/img/rgpd.svg b/static/img/components/HomepagePromises/rgpd.svg similarity index 100% rename from static/img/rgpd.svg rename to static/img/components/HomepagePromises/rgpd.svg diff --git a/static/img/cheatsheet_cover.png b/static/img/pages/communaute/cheatsheet_cover.png similarity index 100% rename from static/img/cheatsheet_cover.png rename to static/img/pages/communaute/cheatsheet_cover.png diff --git a/static/img/pricing/cauldron.png b/static/img/pages/pricing/cauldron.png similarity index 100% rename from static/img/pricing/cauldron.png rename to static/img/pages/pricing/cauldron.png diff --git a/static/img/pricing/computer.png b/static/img/pages/pricing/computer.png similarity index 100% rename from static/img/pricing/computer.png rename to static/img/pages/pricing/computer.png diff --git a/static/img/pricing/hidden.png b/static/img/pages/pricing/hidden.png similarity index 100% rename from static/img/pricing/hidden.png rename to static/img/pages/pricing/hidden.png diff --git a/static/img/do-not-track-me.svg b/static/img/theme/do-not-track-me.svg similarity index 100% rename from static/img/do-not-track-me.svg rename to static/img/theme/do-not-track-me.svg diff --git a/static/img/docusaurus.png b/static/img/theme/docusaurus.png similarity index 100% rename from static/img/docusaurus.png rename to static/img/theme/docusaurus.png diff --git a/static/img/logo.svg b/static/img/theme/logo.svg similarity index 100% rename from static/img/logo.svg rename to static/img/theme/logo.svg diff --git a/static/img/logo_froggit.svg b/static/img/theme/logo_froggit.svg similarity index 100% rename from static/img/logo_froggit.svg rename to static/img/theme/logo_froggit.svg diff --git a/static/img/logo_froggit_blanc.png b/static/img/theme/logo_froggit_blanc.png similarity index 100% rename from static/img/logo_froggit_blanc.png rename to static/img/theme/logo_froggit_blanc.png diff --git a/static/img/logo_typo_froggit.png b/static/img/theme/logo_typo_froggit.png similarity index 100% rename from static/img/logo_typo_froggit.png rename to static/img/theme/logo_typo_froggit.png -- GitLab