Closed sapradhan closed 1 year ago
Hi @sapradhan,
Thanks for the bug report. When I tried the Papermod theme (https://github.com/plenti-themes/papermod) just now I got this error:
Building... 2022/09/05 11:45:29 build.go:154:
Error in DataSource build step
Could not get all content from project
Error getting content from content/posts/_blueprint.json
Unable to read content because: unexpected end of JSON input
I change the Plenti API from time to time and the themes don't always catch up right away. I just pushed a change to fix this particular error (and a couple of others).
However, it seems like you're seeing something different that might be related to go-git. Did you install Plenti by manually downloading the binary from the releases tab?
This issue might be related to cgo: https://stackoverflow.com/questions/69773478/golang-fatal-error-unexpected-signal-during-runtime-execution
Statically linking glibc
could be causing a bug somewhere with ld, the go compiler, or glibc. I'm curious if there are other Arch users experiencing the same thing? Seems to be fine on Debian distros.
@jimafisk greatly appreciate your prompt response.
Did you install Plenti by manually downloading the binary from the releases tab?
I installed it from AUR I just downloaded plenti from releases and ran - same result
This issue might be related to cgo: https://stackoverflow.com/questions/69773478/golang-fatal-error-unexpected-signal-during-runtime-execution
Sorry I dont have much experience with this. I can try to build from source if you can provide instructions
Woah I didn't know about https://github.com/hapakaien/aur-packages. Very cool, thanks for building an AUR package for Plenti @hapakaien!
I'll have to install Arch to see if I can replicate this on my machine. @sapradhan is it just the theme
commands that are giving you issues? Curious if you're able to do other things like create a new site plenti new site test
then cd test
and start up the local webserver plenti serve
.
If it's just the theme
commands giving you trouble, this might be isolated to the go-git dependency. Those commands are really just helpers for downloading themes and managing updates without worrying about git submodules. You can work around this manually if you'd like, just download Papermod directly, unzip it and place it inside a themes
folder in your project. Then edit your plenti.json
sitewide configuration file and add "theme": "papermod",
(assuming your folder structure is themes/papermod
). You don't need to add any of the theme_config
stuff, that's only used for managing updates and is optional. Does something like that work for now?
I can run plenti new
and plenti serve
without issues on a new site with default content. anything related to theme gets me the above mentioned error.
I installed papermod manually and on plenti serve
got similar error that you have posted. I guess this will be fixed in next release .
Error in DataSource build step
Could not get all content from virtual theme
Error getting content from content/posts/_blueprint.json
Unable to read content because: unexpected end of JSON input
I also tried on a Windows machine with Arch on WSL2, same error using theme commands. So it is likely something with Arch
That error leads me to believe you have a blank _blueprint.json
file in either:
content/posts/_blueprint.json
themes/papermod/content/posts/_blueprint.json
You should be able to simply edit those files and add a blank JSON object {}
to them to fix this issue. If you're planning on using the built in CMS, you could add default content here for creating new pages. The papermod theme should be updated already.
I also tried on a Windows machine with Arch on WSL2, same error using theme commands. So it is likely something with Arch
Thanks for testing that out, that's good to know!
With this plenti serve
executed without errors.
However it seems that I ended up with content from the papermod theme but assets/css from default install
steps I followed were
plenti new site plenti-papermod2
# unzip papermod-main.zip to themes/papermod
# add theme in plenti.json
plenti.json
{
"routes": {
"pages": ":filename",
"index": ":paginate(totalPages)"
},
"baseurl": "/",
"build": "public",
"local": {
"port": 3000
},
"cms": {
"repo": "https://gitlab.com/YourGroup/YourRepo",
"redirect_url": "http://localhost:3000/admin/",
"app_id": "",
"branch": "main"
},
"theme": "papermod"
}
Ah ok I see. There's a couple of concepts here that can hopefully clear things up:
To fix the first issue, it would be helpful to start from a site with less content and layouts already defined. When you run plenti new site plenti-papermod2
behind the scenes we're using the learner
starter which is used for someone who wants to check out Plenti for the first time and view some basic concepts that are already implemented. To start from a blank site just pass the --bare
flag like: plenti new site plenti-papermod2 --bare
. Even this will have some content that you'll want to manually delete (usually happens automatically with theme commands):
content/index.json
layouts/content/index.svelte
layouts/global/head.svelte
layouts/global/html.svelte
Then just make sure to add the following routes from the theme to your plenti.json
file (also would normally happen automatically):
"routes": {
"pages": ":filename",
"index": ":paginate(totalPages)"
},
For the second issue, you could use an exclude
inside of your theme_config
: https://plenti.co/docs/themes. If you do this without handling it in your base project, it will break your site (you'd need a content/index.json
at the very least). I don't think you want to do this in your case. It sounds like you want to use the theme as starting point and make customizations. In that case when you want to edit a page, just copy it from the theme to your project and make the edit there (e.g. cp themes/papermod/content/index.json content/.
).
@sapradhan hopefully you were able to get the theme working on your end, I'm closing this issue out for now. If you still have questions just let me know!
I am on plenti v0.5.12, Linux 5.19.2-arch1-1 SMP PREEMPT_DYNAMIC Wed, 17 Aug 2022 13:48:51 +0000 x86_64 GNU/Linux
When I run
plenti new site plenti-papermod --theme=https://github.com/plenti-themes/papermod
I get an error segmentation violation code (full error stacktrace below)
I then created a --bare project and try to add two different themes
still get similar error
Stacktrace: