Skip to content

Template for building sites in Astro and deploy them using Alternate Futures Cloud

License

Notifications You must be signed in to change notification settings

alternatefutures/template-cloud-astro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Astro + AlternateFutures Starter Kit

🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
├── public/
│   └── favicon.svg
├── src/
│   ├── components/
│   │   └── Card.astro
│   ├── layouts/
│   │   └── Layout.astro
│   └── pages/
│       └── index.astro
└── package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the public/ directory.

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro check
npm run astro --help Get help using the Astro CLI

✨ How to deploy to Alternate Futures

1. Create a config file:

You can configure this site deployment using Alternate Futures CLI and running:

 > af sites init
  WARN! Alternate Futures CLI is in beta phase, use it under your own responsibility
   ? Choose one of the existing sites or create a new one. ›
    ❯ Create a new site

It will prompt you for a name, dist directory location & build command

  • name: How you want to name the site
  • dist: The output directory where the site is located, for this template it's dist
  • build command: Command to build your site, this will be used to deploy the latest version either by CLI or Github Actions

2. Deploy the site

After configuring your site, you can deploy it by running

af sites deploy

After running it you will get an output like this:

 WARN! Alternate Futures CLI is in beta, use it at your own discretion
  > Success! Deployed!
   > Site IPFS CID: QmP1nDyoHqSrRabwUSrxRV3DJqiKH7b9t1tpLcr1NTkm1M

    > You can visit through the gateway:
     > https://ipfs.io/ipfs/QmP1nDyoHqSrRabwUSrxRV3DJqiKH7b9t1tpLcr1NTkm1M

Extra features

Keep in mind:

This template has been configured to produce a static output.

// astro.config.mjs 

import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
    output: 'static',
});

You can find more information about static builds in Astro Documentation

👀 Want to learn more?

Feel free to check Astro documentation or jump into Astro's Discord server.

📄 License

This project is licensed under GNU GPLv3.

🙏 Acknowledgements

The initial architecture and conceptual foundation of this project were derived from a fork of the Fleek.xyz platform. While significant changes have created divergence from the original, we express our gratitude to the Fleek team for their pioneering open-source contributions to decentralized application hosting and infrastructure.

About

Template for building sites in Astro and deploy them using Alternate Futures Cloud

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 6