twostraws / Ignite

A static site generator for Swift developers.
MIT License
985 stars 34 forks source link

Add a CLI tool to create new sites and launch them in a local server #1

Closed Mcrich23 closed 1 month ago

Mcrich23 commented 1 month ago

I would love to be able to run the target and it opens index.html properly with formatting. Right now, I build it and open it locally and get this:

Screenshot 2024-03-22 at 1 27 51 PM

But running it on a cloudflare site works fine

twostraws commented 1 month ago

Most folks are likely to do this using a local web server. The most common was is using Python, which ships with one. cd into your Build directory on the command line, then run python3 -m http.server to start the server. You should now be able to visit http://localhost:8000 to access your site, rendered normally.

Mcrich23 commented 1 month ago

Thank you, I figured this out. Might be something to add to the executable to have it built in.

twostraws commented 1 month ago

Yes, I agree. This issue should stay open, but I've renamed it to the bigger problem: we need a way to generate new sites quickly, and also run those sites.

Mcrich23 commented 1 month ago

@twostraws I could write shell scripts to do these things. However, I don't know how to turn this into a cli.

Mcrich23 commented 1 month ago

@twostraws I have put together a couple shell scripts to do exactly what it needed but you should probably be the one to publish it. It has 2 commands:

ignite create-template [-n|--name new_folder_name] [destination_path] which fetches the starter repo and unzips it and if you specify a name it will rename IgniteStarter to the name.

and ignite run [-p|--port] [-d|--directory] which will startup a server on port 80 and run the package Ignite-CLI.zip

Mcrich23 commented 1 month ago

There were some bugs, so I made fixes to the script: Ignite-CLI.zip

twostraws commented 1 month ago

This is now resolved.