Coder Social home page Coder Social logo

whoobe-ssg's Introduction

whoobe-ssg

A new version of whoobe-one-studio based on Vue3, ViteJS, WindiCSS/TailwindCSS and Typescript, to generate static html pages (complete website) with auto purge CSS.

Since the app has access to the local filesystem to run the app safely use a container

whoobe-ssg uses a basic nodejs server in order to generate static HTML pages starting from your blocks templates. For this reason it can be used safely in a container in a local environment.

Do not use whoobe-ssg on production (public server), since filesystem access is not secured

DOCKER

Run in a docker without installing node or any other application (requires docker)

Project structure

   |-pages            //SSG folder
   |---dist           //Static generated folder (you can copy this folder to your hosting)
   |-----assets
   |-------css
   |-------img
   |-project          //Not used
   |-public
   |---icons
   |-server           //templates folder (where your templates are saved)
   |---data
   |-----current
   |-----projects
   |-----templates
   |-----uikits
   |-src              //application folder
   |---assets
   |---components
   |---composables
   |---pages
   |---router
   |---stores
   |---styles
   |---views

Run development in a docker container

First you need to create an .env file at the root of the project

VITE_APP_LOCAL_API=http://localhost:9000
VITE_APP_PAGES=/app/pages/dist
VITE_APP_PAGES_URL=http://localhost:8080

To run in a docker container simply run from the project folder console

docker-compose run --name whoobe -p 3000:3000 -p 9000:9000 -p 8080:8080 -p 24678:24678 --rm app bash

At the first run it will build the container and install all dependencies.

Run the app (from the container)

Open the project folder and run the following commands

docker exec -it whoobe npm run dev
docker exec -it whoobe nodemon

Run the http server for website preview and CSS auto purge (from the container)

From your console

  1. Start http server
docker exec -it whoobe /bin/bash
cd pages/dist
http-server -g -p 8080 -d
  1. Hot reload and purge of CSS files
docker exec -it whoobe /bin/bash
cd pages
npx tailwindcss -i ./input.css -o ./dist/assets/css/output.css --watch

At first time you will be asked to

Need to install the following packages:
  tailwindcss
Ok to proceed? (y)

Rebuilding...

Add new packages

If you want to add any other package from the container console then

npm i __package__

Access docker console from another terminal

docker exec -it whoobe /bin/bash

whoobe-ssg's People

Contributors

swina avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.