https://github.com/miguel98r/project2pug
html template converter to templates with pug as view engine
https://github.com/miguel98r/project2pug
bootstrap expressjs html htmltopug javascript jquery mongo nodejs pug
Last synced: about 1 year ago
JSON representation
html template converter to templates with pug as view engine
- Host: GitHub
- URL: https://github.com/miguel98r/project2pug
- Owner: Miguel98R
- License: other
- Created: 2023-01-20T02:34:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-26T19:28:14.000Z (about 3 years ago)
- Last Synced: 2025-04-16T22:09:10.360Z (about 1 year ago)
- Topics: bootstrap, expressjs, html, htmltopug, javascript, jquery, mongo, nodejs, pug
- Language: JavaScript
- Homepage:
- Size: 991 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
html template converter to templates with pug as view engine
Set a folder where the files to be found will be to be the input directory, so set a folder for the output files
Example of directory paths to enter:
- Input directory : /home/mike98/Desktop/html_files
- Output Directory : /home/mike98/Desktop/pug_files
---
# Install
```
git clone https://github.com/Miguel98R/project2Pug.git
```
```
npm install
```
```
npm run dev
```
# Install by npm
can also install the converter by npm
command:
```
npm i -g project2_pug
```
start converter interface
command:
```
gui
```
example usage:
```
project2_pug gui
```
Then visit http://localhost:3008/*
*By default start on port 3008 , this can be modified in the index.js file
---
# Convert CLI mode
Also has the option to convert your html template to pug via CLI
command:
```
convert
```
options:
```
-i, --inDirectory location of the folder where the files to be converted are
-o, --OutDirectory location of the folder where the converted files will be saved
```
example usage:
```
project2_pug convert -i "/home/mike98/Desktop/html_files" -o "/home/mike98/Desktop/pug_files"
```
install node modules and start the server in the output folder
command:
```
start_dev
```
example usage:
```
project2_pug start_dev
```
---
# Initializing template converted
Once you have converted the template, you will notice that a structure has been created for your project ,
an api-rest based on js express and a database connection in mongo db, this to help in the process of creating projects
Converted views to pug are located in the views folder and static/library files are located in the public folder
to initialize the project simply install the node modules and run the dev command
```
npm install
```
```
npm run dev
```
in the CLI section, the command to install the node modules and start the server in the output folder is shown
The project to be launched on port 3055 , this can be modified in the index.js of your output folder
Then visit http://localhost:3055 *
Note: if in your template static files are in an **assets** folder, this folder will be saved in the **public** folder just move the contents to the root of the **public** folder for your template to work properly
---
Mike Rosas © 2023 | project2Pug v1.0.9
Developed by: Jose Miguel Rosas Jimenez