Skip to content

Commit

Permalink
refactor: improve zines route definition
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBrito committed Aug 27, 2024
1 parent 0f40bf1 commit 1375784
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 41 deletions.
8 changes: 5 additions & 3 deletions docs/NewPublications.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
- Add image file to `src/assets/zines` or `src/assets/books`:
- Dimensions (WxH): `339x480`
- Format: `WEBP`
- Import thumb image into `src/data/Thumbs.js` and set the `altText`

- Import thumb image into `src/data/Thumbs.js` and set a descriptive `altText`

- Add PDF file source URL from GoogleDrive into `src/data/FilesSource.js`

- Add route to `src/routes/Routes.js`
- Increment `NUMBER_OF_PUBLISHED_ZINES` for zines

- Add publication info to `src/data/Books.js` or `src/data/Zines.js`:

```js
...
{
name: 'New Publication',
releasedAt: '05/02/2015',
releasedAt: 'DD/MM/YYYY',
thumb: thumbs.NEW_PUBLICATION.image,
path: `${prefix}${routes.NEW_PUBLICATION_PATH}`,
altText: thumbs.NEW_PUBLICATION.altText,
}
```
```
45 changes: 7 additions & 38 deletions src/routes/Routes.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,17 @@
const NUMBER_OF_PUBLISHED_ZINES = 37

const routes = {
APP_BASE_URL: '/poemix',
ZINES_PATH: '/zines',
BOOKS_PATH: '/livros',
PROTESTIZANDO_PATH: '/protestizando',
A_LER_VAZIOS_PATH: '/a_ler_vazios',
PROTESTIZANDO_1_PATH: '/protestizando_1',
PROTESTIZANDO_2_PATH: '/protestizando_2',
PROTESTIZANDO_3_PATH: '/protestizando_3',
PROTESTIZANDO_4_PATH: '/protestizando_4',
PROTESTIZANDO_5_PATH: '/protestizando_5',
PROTESTIZANDO_6_PATH: '/protestizando_6',
PROTESTIZANDO_7_PATH: '/protestizando_7',
PROTESTIZANDO_8_PATH: '/protestizando_8',
PROTESTIZANDO_9_PATH: '/protestizando_9',
PROTESTIZANDO_10_PATH: '/protestizando_10',
PROTESTIZANDO_11_PATH: '/protestizando_11',
PROTESTIZANDO_12_PATH: '/protestizando_12',
PROTESTIZANDO_13_PATH: '/protestizando_13',
PROTESTIZANDO_14_PATH: '/protestizando_14',
PROTESTIZANDO_15_PATH: '/protestizando_15',
PROTESTIZANDO_16_PATH: '/protestizando_16',
PROTESTIZANDO_17_PATH: '/protestizando_17',
PROTESTIZANDO_18_PATH: '/protestizando_18',
PROTESTIZANDO_19_PATH: '/protestizando_19',
PROTESTIZANDO_20_PATH: '/protestizando_20',
PROTESTIZANDO_21_PATH: '/protestizando_21',
PROTESTIZANDO_22_PATH: '/protestizando_22',
PROTESTIZANDO_23_PATH: '/protestizando_23',
PROTESTIZANDO_24_PATH: '/protestizando_24',
PROTESTIZANDO_25_PATH: '/protestizando_25',
PROTESTIZANDO_26_PATH: '/protestizando_26',
PROTESTIZANDO_27_PATH: '/protestizando_27',
PROTESTIZANDO_28_PATH: '/protestizando_28',
PROTESTIZANDO_29_PATH: '/protestizando_29',
PROTESTIZANDO_30_PATH: '/protestizando_30',
PROTESTIZANDO_31_PATH: '/protestizando_31',
PROTESTIZANDO_32_PATH: '/protestizando_32',
PROTESTIZANDO_33_PATH: '/protestizando_33',
PROTESTIZANDO_34_PATH: '/protestizando_34',
PROTESTIZANDO_35_PATH: '/protestizando_35',
PROTESTIZANDO_36_PATH: '/protestizando_36',
PROTESTIZANDO_37_PATH: '/protestizando_37',
A_LER_VAZIOS_PATH: '/a_ler_vazios'
};

for (let i = 1; i <= NUMBER_OF_PUBLISHED_ZINES; i++) {
routes[`PROTESTIZANDO_${i}_PATH`] = `/protestizando_${i}`;
}

export const getRoutes = () => {
return routes;
};

0 comments on commit 1375784

Please sign in to comment.