Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-5: Add settings.json and expand CMS backend ADR #10

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .fleet/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"backend.maxHeapSizeMb": 2048,
"editor.formatOnSave": true
}
26 changes: 21 additions & 5 deletions docs/adr/20241203-cms-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Context and Problem Statement

When building my portfolio site, I want the content to be managed by a block-based CMS instead of being hardcoded into
the site so I can change the content easily.

Because the portfolio sites would contain a lot of content, using local JSON to manage content would be difficult.

Ideally, it would have a system that supports persistence over JSON files, and I can just commit the JSON file into
GitHub.

## Decision Drivers

- Ability to run locally
Expand Down Expand Up @@ -40,12 +48,19 @@

### WordPress

[example | description | pointer to more information | …] <!-- optional -->
[Example implementation of custom content type on WP](https://github.com/neviaumi/portfolio/blob/556a7aabbb1e978cab26c6767dee30d3b34528ad/systems/cms/wordpress/wp-content/plugins/portfolio/portfolio.php#L1)

- Good, because [argument a]
- Good, because [argument b]
- Bad, because [argument c]
- … <!-- numbers of pros and cons can vary -->
That implementation includes setting up a custom content type and incorporating the custom fields within the content
type. It also exposes the custom content type content on the REST API.

That experimental implementation is nearly all I want for this portfolio project.

- Good, because it is a popular CMS (62.2% as written)
- Good, because there are millions of results on the Internet for troubleshooting.
- Bad, because the implementation is complicated, as it requires a lot of custom code to implement just a custom content
type.
- Bad, because it is not a headless CMS natively. That means I have to write a lot of custom code in plugins to expose
the custom content type, including the form on the admin and public-facing API.

### PayloadCMS

Expand All @@ -59,6 +74,7 @@
## Links <!-- optional -->

- [Contentful](https://www.contentful.com/)
- [WordPress market share](https://w3techs.com/technologies/overview/content_management)

<!-- example: Refined by [ADR-0005](0005-example.md) -->

Expand Down
22 changes: 21 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ import globals from 'globals';

import pkgjson from './package.json' with { type: 'json' };

function withOverride(overrideConfig) {
return function createEslintConfigHOC(originalConfigFunc) {
return function (...args) {
const originalConfig = originalConfigFunc(...args);
return {
...originalConfig,
...overrideConfig,
rules: {
...originalConfig.rules,
...overrideConfig.rules,
},
};
};
};
}

export default [
{
ignores: ['package-lock.json'],
Expand All @@ -26,5 +42,9 @@ export default [
useYamlEslintConfig(),
usePackageJsonEslintConfig(),
useJSONEslintConfig(),
useMarkdownEslintConfig(),
withOverride({
rules: {
'markdownlint/md013': 'off',
},
})(useMarkdownEslintConfig)(),
];
Loading