Comments (5)
My plenti.json file is at packages/web/src/plenti.json
- so it's in the usual location relative to the content
folder.
I think the extra config option sounds great. Do you have any idea of when that feature might make it into a release? I'm on the verge of finishing a project for a client, and this is the last piece of the CMS that is not working.
Thanks for building such a great framework for nonprofits, by the way. I'm really excited to deliver this project to the client - which happens to be my son's preschool, a nonprofit organization - and Plenti is a perfect match for their needs.
from plenti.
My pleasure, glad that I could be helpful in some way! As I mentioned, this is a really great fit for my client's needs, and I totally appreciate your contributions to the ecosystem. Plenti fills a niche that I haven't seen addressed by any other framework.
from plenti.
Good idea @alexnitta, I had not thought about monorepo-style projects. Is your plenti.json
at the project root or packages/web/src/plenti.json
?
I think we could probably just add a file_prefix
option to the cms
settings defined in plenti.json
. We're planning on modifying that API a bit anyways now that we're adding other providers like Gitea.
from plenti.
I was able to work around this by adding a shell script to my .gitlab-ci.yml
. The shell script uses sed
to append the packages/web/src/
subdirectory before the file path in pubic/spa/core/cms/publish.js
. Now I am able to use the CMS editor to save changes - so @jimafisk there's no need to rush the official fix into a release, but whenever you have time for that I'd be happy to remove this patch from my codebase.
To restate the problem, my issue is that my JSON content is not located in ./content
relative to the root of the repo; since I'm using a monorepo, it's located in ./packages/web/src/content
instead. This breaks the current version of the CMS editor when trying to save changes, because the generated JS file in public/spa/core/cms/publish.js
assumes the file paths are relative to the root of the repository.
For anyone else facing this same problem, here's my .gitlab-ci.yml
with some comments added where I changed things.
image: docker:stable
pages:
before_script:
- apk add --update curl wget && rm -rf /var/cache/apk/*
script:
# Move to the subdirectory of the monorepo where the plenti.json file is.
# This is also where the `content` folder is located which contains all of the JSON content.
- cd packages/web/src
# These next three steps are the same as in the example at https://plenti.co/docs/gitlab-piplines/
- wget -c $(curl -s https://api.github.com/repos/plentico/plenti/releases/latest | grep -o 'http.*linux_64-bit.tar.gz')
- tar -zxvf *_linux_64-bit.tar.gz
- ./plenti build
# Move back up one folder to where the patch script is located
- cd ..
# Run the patch script
- ./patch_cms_publish.sh
artifacts:
paths:
- packages/web/public
publish: packages/web/public
only:
- main
And here is the packages/web/patch_cms_publish.sh
script:
#!/bin/sh
# This script is used to patch the public/spa/core/cms/publish.js script to use the correct file path
# when committing changes with the GitLab API. This is necessary because the script expects the
# JSON `content` folder path to start from the root of the repo, but our JSON `content` folder is in
# a subdirectory of the monorepo.
sed -i.bak 's/file_path:/&"packages\/web\/src\/" + /' public/spa/core/cms/publish.js
The script needs to be committed with git add --chmod=+x packages/web/patch_cms_publish.sh
so that it can be executed.
from plenti.
I'm really excited to deliver this project to the client - which happens to be my son's preschool, a nonprofit organization
That's wonderful, so glad it's fitting your needs! Providing a low-overhead solution for nonprofits is one of our primary goals.
I was able to work around this by adding a shell script
That's very clever, thanks for sharing your workaround!
there's no need to rush the official fix into a release
Sounds great, thanks for letting me know. I'm a little overbooked this month and next, but this is something I'm interested in adding to the project. Thanks for the suggestion!
from plenti.
Related Issues (20)
- Can SSR be enabled with V8 engine? HOT 2
- plenti serve is spitting errors HOT 9
- Fingerprint SPA to bust cache HOT 1
- Can't use "plenti" command HOT 2
- Broken build: invalid go version '1.21.0': must match format 1.23 HOT 1
- Component cache
- Custom env variable
- Live Reload: Broken/Missing JS script? HOT 2
- Git Gateway with Netlify HOT 3
- Use query params to bust cache HOT 1
- tls: failed to verify certificate: x509 HOT 3
- Broken Build: Project file 'snapcraft.yaml' not found HOT 3
- Strip inline style when pasting into inputs HOT 1
- Flatpak support
- Fingerprint every file in SPA HOT 4
- SIGSEGV: segmentation violation on running plenti serve on Linux (0.6.45) HOT 1
- Importing plain JS Files from components HOT 4
- Required fields HOT 1
- Route override fallbacks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plenti.