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

I'm not so sure how to use this #1

Closed
Powtaitoe opened this issue Apr 24, 2020 · 8 comments
Closed

I'm not so sure how to use this #1

Powtaitoe opened this issue Apr 24, 2020 · 8 comments

Comments

@Powtaitoe
Copy link

Powtaitoe commented Apr 24, 2020

Title. I'm completely new to php and I'm not so sure how to run this or where to put my key, etc etc. I have composer and PHP installed already. But I don't know where to go from there

@reed-jones
Copy link
Owner

This library by itself is mostly just for uploading/modifying/deleting files you already have. I have mostly used it for writing CLI scripts, and for the jigsaw integration.

Theres lots of ways to store your keys, but I personally would install vlucas/phpdotenv putting my keys in a .env file.

If your just starting to make your site I would suggest checking out Jigsaw Its already got the .env stuff setup, and is pretty nice to use. Then you can install this, and set it up to deploy automatically whenever you run ./vendor/bin/jigsaw deploy production

@Powtaitoe
Copy link
Author

Right. Is it possible for neocities to support .PHP files?

@reed-jones
Copy link
Owner

not directly no, but that's how Jigsaw (or something else) can help. It compiles your .php files into static .html files that can get uploaded to neocities

@Powtaitoe
Copy link
Author

Right. Thanks a lot. I just have to figure out on my own how to use Jigsaw with this. I have no clue what I'm doing xD

@reed-jones
Copy link
Owner

👍 Good luck, Hopefully their instructions help get you all set up

@Powtaitoe
Copy link
Author

Do I install this into the jigsaw directory or my project's directory?

@reed-jones
Copy link
Owner

reed-jones commented May 6, 2020

starting from scratch, I would make new project folder

mkdir myProject

install Jigsaw & Neocities-php

cd myProject
composer require tightenco/jigsaw
composer require reed-jones/neocities

'initialize' the Jigsaw stuff by running

./vendor/bin/jigsaw init

That will generate the project skeleton and add a bunch of files, one of them in the root of your project will be bootstrap.php

then 'install' the neocities integration by adding this to your bootstrap.php (It doesn't really matter where, but I would probably put it above that big comment block, so like line 7.

Jigsaw::mixin(new \ReedJones\Neocities\NeocitiesDeployment($container));

Next is the keys, so create a file called .env (depending on your operating system & settings, this may be 'hidden' because it starts with a '.')

now add your api key in there

NEO_CITIES_API_KEY="YOUR_API_KEY_HERE"

... unfortunately, I just ran through these commands to double check it, and it seems theres a small bug with jigsaw which breaks this plugin. I opened a PR to fix it here: tighten/jigsaw#467 so hopefully it gets merged in soon 🤞 Until then you can still get started learning how to build a site with jigsaw, you just won't be able to use this library to automatically upload it to neocities. You can still build it with jigsaw using ./vendor/bin/jigsaw build production , and then upload the contents of the build_production folder to neocities manually at https://neocities.org/dashboard

@reed-jones
Copy link
Owner

Jigsaw has been updated & everything should be working properly again 👍 let me know if you run into troubles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants