aboutsummaryrefslogtreecommitdiffstats
path: root/src/services/graphql/articles.ts
Commit message (Collapse)AuthorAgeFilesLines
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-271-201/+0
| | | | | | | | | | | | The Typescript mapped types was useful for autocompletion in fetchers but their are harder to maintain. I think it's better to keep each query close to its fetcher to have a better understanding of the fetched data. So I: * colocate queries with their own fetcher * colocate mutations with their own mutator * remove Typescript mapped types for queries and mutations * move data convertors inside graphql services * rename most of data types and fetchers
* fix: generate an id for each headings in the page main contentsArmand Philippot2023-11-181-16/+19
| | | | | | | | | | | | | | | | | | | | Since #be4d907 the ids was no longer addded to headings in useHeadingsTree hook. It was a bad practice to manipulate the DOM that way. However, I did not move the implementation elsewhere... To fix this, I now use rehype-slug on both markdown contents and html string coming from WordPress. I'm not sure the dynamic imports are really useful here since the table of contents is on almost all pages but Jest was failing with regular import because of ESM. It is the only thing that makes the tests functional again so... However if we want to test the `updateContentTree` function, Jest fails for the same reason. So I decided to not test this function. I've already spend too much time on this issue. Another problem: the ToC on projects page. Currently we use the ref on the body but the page contents are imported dynamically so the hook is executed before the contents are loaded. It makes the ToC empty... We should refactor the pages so we can use the ref directly on the imported contents.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-10/+13
| | | | | | Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements.
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-191-7/+10
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* refactor(types): move and rename GraphQL typesArmand Philippot2022-08-201-25/+17
| | | | | | | The api file in services was not really readable. So I move the types and I also rewrite a little the fetch function. I also rename most of the type to avoid conflict with preexisting types (like Node) and to keep consistency.
* fix: ensure all topics/thematics have the base urlArmand Philippot2022-05-231-2/+2
|
* refactor: reduce the number of data transformationArmand Philippot2022-05-231-2/+1
|
* chore: handle blog pagination when JS is disabledArmand Philippot2022-05-201-1/+27
|
* chore: add Search pageArmand Philippot2022-05-151-1/+2
|
* chore: handle blog paginationArmand Philippot2022-05-131-21/+45
|
* chore: add homepageArmand Philippot2022-05-031-3/+49
|
* chore: fetch posts for rss feedArmand Philippot2022-05-021-0/+104