aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* chore(projects): improve project overview styles and unify coversHEADmainArmand Philippot2023-12-207-11/+17
| | | | | | | * The overview was too big on the page, now the cover is inlined with the project meta * Both overview and projects listing benefits from unified covers dimensions
* fix(styles): increase CSS specifity for some selectorsArmand Philippot2023-12-209-177/+183
| | | | | | | | | | | Since `sideEffects` has been added to activate tree shakings, the styles are imported in the wrong order in production build. There is an open issue (again) on Next.js repo. I'm not sure it will be fixed soon so in the meantime I had to increase the specifity of some selectors to avoid broken styles. I also fixed two minor layout errors: * CV page widgets should use headings of level 2 * Homepage should wrap the cards in list items
* build: improve bundle sizeArmand Philippot2023-12-2012-45/+215
| | | | | | | | | * add `sideEffects` in package.json to activate tree shaking for barrel files * use dynamic imports on social links and icons * resize social media images * resize large project image (demo apcom) * resize website logo
* fix(layout): refine pagination when JS is disabledArmand Philippot2023-12-196-53/+58
| | | | | | | | * fix the total number of pages * hide the load more button and the progress bar * remove the informative notice since it is no longer necessary * if the page number is equal to 1, use Blog route directly (NextJS is not able to redirect the user when JS is disabled)
* fix(components): make navbar usable with javascript disabledArmand Philippot2023-12-195-56/+36
|
* fix(components): prevent search form overflow on small devicesArmand Philippot2023-12-191-0/+4
|
* refactor(pages): merge Github/Gitlab overview on project pagesArmand Philippot2023-12-182-147/+124
| | | | | | By using conditional fetchning we can avoid to duplicate the ProjectOverview component and be more accurate about what data is loading.
* fix(pages): use dynamic imports for the table of contentsArmand Philippot2023-12-186-16/+55
| | | | | | | The ToCWidget relies on Javascript to display the headings. If JS is disabled in the browser, the widget is empty. For a better UX, we should use dynamic imports. Now, the ToC is only displayed when JS is enabled.
* build(stylelint): fix configuration by removing unknown rulesArmand Philippot2023-12-181-15/+0
| | | | | | | Some rules have been depecrated in v15 and are now removed in v16: * declaration-colon-newline-after * indentation * max-line-length
* chore(layout): improve noscript banner stylesArmand Philippot2023-12-181-1/+9
|
* fix(pages): add default settings to html tagArmand Philippot2023-12-181-1/+7
| | | | | | | When building the website, some styles are missing if JS is disabled in the browser because we rely on Javascript to set the current theme. By providing some default settings, the JS-free version can access those styles.
* fix(pages): do not show spinner when data are availableArmand Philippot2023-12-187-7/+7
| | | | | | | | The `useSWR` hook set `isLoading` to `true` on first fetch even if the fallback data is provided. It affects how pages are generated on build: the loading page is showing instead of the actual page. So we need to return a custom `isLoading` variable that checks if there is no data.
* fix(branding): do not reanimate branding on route changeArmand Philippot2023-12-161-1/+10
| | | | | | | The branding animation should occurs only once. Since we're changing the heading from a h1 to a p and vice-versa, the CSS animation was retriggered. By using a ref to make sure it is the first render, we can prevent this behaviour.
* fix(layout): reset focus on route changeArmand Philippot2023-12-161-2/+16
| | | | | | | I mistakenly removed the `giveFocusToTop` on route change but Next router is still not fully accessible. It is important for keyboard users to be redirected at the top of the page when changing page so we need to reset the focus.
* fix(build): handle Next.js errors and warnings during buildArmand Philippot2023-12-169-30/+97
| | | | | | | | | | | | * extract Blog component from BlogPage (paginated) and extract Article component from ArticlePage to avoid `Cannot read properties` errors due to fallback route * fix sitemap build (cjs not supported) * fix eslint warnings (react/jsx-no-literals) * update `start` script since I'm using standalone output * update `postbuild` script since we need to copy public and static files to standalone directory (Next.js does not handle it itself because we should use a CDN...)
* build(deps): bump all dependencies except undiciArmand Philippot2023-12-155-1780/+1705
| | | | undici v6 is breaking Jest tests (ReadableStream, structuredClone)
* refactor(stories): migrate stories to CSF3 formatArmand Philippot2023-12-15135-6953/+5162
|
* test(e2e): fix broken Cypress testsArmand Philippot2023-12-147-76/+324
| | | | | | | | Since #93db24b MSW is used in Cypress tests to intercept requests. Some tests relied on WordPress data so it becames broken. Tests are now successful but there are still some issues with hydration because all GraphQL requests are not intercepted and data are mixed between WordPress and fixtures.
* refactor(pages): rewrite helpers to output schema in json-ld formatArmand Philippot2023-12-1429-630/+1284
| | | | | | | | | | | | | * make sure url are absolutes * nest breadcrumb schema in webpage schema * trim HTML tags from content/description * use a regular script instead of next/script (with the latter the schema is not updated on route change) * place the script in document head * add keywords, wordCount and readingTime keys in BlogPosting schema * fix breadcrumbs in search page (without query) * add tests (a `MatchInlineSnapshot` will be better but Prettier 3 is not supported yet)
* refactor(hooks): rewrite useBreadcrumbs hookArmand Philippot2023-12-1226-322/+559
| | | | | | | * use next/router to get the slug instead of using props * handle cases where the current page title is not provided * update JSON-LD schema to match the example in documentation * add tests
* test(hooks): fix not wrapped in act error in Jest testArmand Philippot2023-12-111-5/+5
|
* test(services): add tests for createComment mutationArmand Philippot2023-12-1110-34/+161
| | | | | * add Jest test * add a Cypress test in article pages spec
* refactor(pages): refine Contact pageArmand Philippot2023-12-1124-91/+525
| | | | | | | * remove next/router dependency * remove pageTitle since it is defined in MDX * reduce statements by grouping messages * mock response with MSW and add test for sendEmail
* refactor(pages): refine LegalNotice pageArmand Philippot2023-12-093-9/+20
| | | | | | * remove unnecessary dependency (useRouter) * fix React errors (blurWidth/blurHeight) * complete Cypress tests
* refactor(pages): refine 404 pageArmand Philippot2023-12-096-103/+193
| | | | | * refresh topics and thematics list using hooks * add Cypress tests
* refactor(pages): refine Project pagesArmand Philippot2023-12-0825-330/+535
| | | | | | | | | | | * refactor ProjectOverview component to let consumers handle the value * extract project overview depending on Github to avoid fetching Github API if the project is not on Github * wrap dynamic import in a useMemo hook to avoid infinite rerender * fix table of contents by adding a useMutationObserver hook to refresh headings tree (without it useHeadingsTree is not retriggered once the dynamic import is done) * add Cypress tests
* refactor(hooks): replace useGithubApi with useGithubRepoMetaArmand Philippot2023-12-0736-114/+400
| | | | | | | | * use GraphQL API instead of REST (the inconvenient however is that we now need an authorization token...) * move fetcher in services * add tests * mock response using MSW
* refactor(pages): refine Projects pageArmand Philippot2023-12-0710-107/+152
| | | | | | | * add a `contexts` meta key to projects * replace `technologies` with `contexts` key in projects list * make getProjectsFilenames async * add Cypress tests
* refactor(pages): refine Search pageArmand Philippot2023-12-077-214/+305
| | | | | | | * extract NoResults component to improve readability * provide a different message when the url does not contain a query * use hooks to refresh Thematics and Topics lists * remove useDataFromApi hook
* refactor(pages): refine Blog pagesArmand Philippot2023-12-0420-377/+652
| | | | | | | | | | * replace usePostsList with useArticlesList to keep names coherent * remove useIsMounted hook * rewrite useRedirection hook * add redirect in getStaticProps to avoid unecessary fetching * move Pagination component in a noscript tag * use hooks to refresh thematics and topics lists * complete Cypress tests
* refactor(pages): refine Topic pagesArmand Philippot2023-12-0114-94/+380
| | | | | | * add useTopic and useTopicsList hooks to refresh data * add a table of contents * add Cypress tests
* refactor(pages): refine Thematic pagesArmand Philippot2023-12-0126-115/+446
| | | | | | | | | | | * add a table of contents (however posts heading are not included) * rename posts list section title * add a useThematic hook to refresh thematic contents * add a useThematicLists hook to refresh thematics list * add a `notIn` filter in thematics list fetcher to directly remove unwanted thematics * add Cypress tests
* refactor(pages): refine Article pagesArmand Philippot2023-12-0135-338/+692
| | | | | | | | | | | * use rehype to update code blocks class names * fix widget heading level (after a level 1 it should always be a level 2 and not 3) * replace Spinner with LoadingPage and LoadingPageComments components to keep layout coherent * refactor useArticle and useComments hooks * fix URLs in JSON LD schema * add Cypress tests
* refactor(pages): refine RSS feedArmand Philippot2023-11-3010-79/+131
| | | | | | | | | | | * add favicon * add item categories * add item image * add item author * add item update date (it seems `date` is used as update date by Feed) * change copyright format * fix ESlint errors * fix atom and json links
* fix(pages): redirect /feed to /feed.xmlArmand Philippot2023-11-301-1/+2
| | | | | | I don't know when it happens but the rewrites was no longer working. Also it is more a redirect than a rewrite so I switch the setting key and set "permanent" to true.
* refactor(pages): refine CV pageArmand Philippot2023-11-293-64/+91
| | | | | | * reduce the number of statements by grouping the messages * remove LinkedIn from the widget (it is obviously not a repo and my CV is already here, no need to link to an external site)
* refactor(pages): improve HomepageArmand Philippot2023-11-2921-434/+241
| | | | | | | | | * move custom homepage components that does not require props to the MDX file (links should not need to be translated here but where they are defined) * move SEO title and meta desc to MDX file * make Page component the wrapper instead of using a React fragment * fix MDX module types
* fix(pages,services): make thematics & topics pages usable againArmand Philippot2023-11-2920-72/+815
| | | | | | | | | | When I refactored the fetchers and convertors in #f111685 I forgot to convert WPThematicPreview and WPTopicPreview so the thematics and topics pages was broken. I also: * removed the ToC added by error in #70b4f63 * fix heading styles * fix website url in topics pages
* fix(services,types): make queries and types coherent for TopicArmand Philippot2023-11-2819-7/+420
| | | | | | * some nodes was missing in topicQuery * a node was mispelled in topicsListQuery * add tests for all topics fetchers
* fix(services,types): make coherent Thematic type and queryArmand Philippot2023-11-2819-16/+437
| | | | | | * some nodes was queried but missing in the Thematic type and vice versa, it is now fixed * add tests for all thematics fetchers
* test(services): add tests for comments list fetcherArmand Philippot2023-11-2811-16/+273
|
* test(services): add tests for posts fetchersArmand Philippot2023-11-2827-37/+675
|
* refactor(services): avoid nested fetchersArmand Philippot2023-11-286-15/+18
| | | | | | | If we use fetchPostsCount inside fetchAllPostsSlugs, we might have problems to test fetchAllPostsSlugs failure. So it is better to let the consumer pass the posts count as an argument. The same applies to thematics and topics.
* test: add MSW to intercept GraphQL requestsArmand Philippot2023-11-2715-15/+582
|
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-2787-2220/+2600
| | | | | | | | | | | | 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
* refactor(components): refine Card component stylesArmand Philippot2023-11-231-15/+29
| | | | | | | * remove cover img absolute positioning * remove fixed height on card variant 1 * make title always centered on card variant 2 * make header meta centered on card variant 2 on small containers
* refactor(components): integrate sectioned page template into PageArmand Philippot2023-11-2319-346/+254
| | | | | | | | * replace Section component by a generic one (other components should be able to use it) * add a PageSection component * add `hasSections` prop to Page component * remove sectioned-page template
* refactor(components): replace items prop in Grid with children propArmand Philippot2023-11-229-204/+309
| | | | | | | | | It is easier to read and to maintain this way. The `items` prop was not useful since we are not manipulating the items. Changes: * extract GridItem component from Grid component * replace `items` prop of type Array<ReactNode> with `children` prop of type ReactNode * remove GridItem styles
* refactor(components,pages): extract MDX components mapping from pagesArmand Philippot2023-11-2212-321/+123
| | | | | | | Instead of repeating the overriding on each pages, we should define it in one place and reuse it in pages. By default it is not possible to override native HTML tags with MDX so I added a plugin in next config to allow it.
* refactor(components): split Layout component in smaller componentsArmand Philippot2023-11-2225-757/+978
| | | | | The previous component was too long and hardly readable. So I splitted it in different part and added tests.