Skip to content

Commit c8941eb

Browse files
committed
chore: add example "Hello World!" for Pug
1 parent 7cb5f64 commit c8941eb

14 files changed

Lines changed: 5878 additions & 627 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ For example, using source asset files is HTML template _./src/views/index.html_:
6363
</html>
6464
```
6565

66-
[Open an example in StackBlitz](https://stackblitz.com/edit/stackblitz-starters-78r926?file=webpack.config.js)
66+
[Open an example in StackBlitz](https://stackblitz.com/edit/hello-world-webpack?file=webpack.config.js)
6767

6868
The folder structure of the example:
6969
```
@@ -326,6 +326,8 @@ module.exports = {
326326
// simple page config w/o variables
327327
about: 'src/views/about.html', // => dist/about.html
328328
'news/sport': 'src/views/news/sport/index.html', // => dist/news/sport.html
329+
// add more templates if needed
330+
// 'another-page': 'src/views/anotherPage.html', // => dist/another-page.html
329331
},
330332
// - OR - define a relative or absolute path to page templates
331333
entry: 'src/views/',
@@ -379,7 +381,7 @@ For custom templates, you can use the [preprocessor](#loader-option-preprocessor
379381
<td>Simple example SPA</td>
380382
<td>
381383

382-
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/stackblitz-starters-78r926?file=webpack.config.js)
384+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/hello-world-webpack?file=webpack.config.js)
383385

384386
</td>
385387
</tr>
@@ -500,7 +502,8 @@ See [boilerplate](https://github.com/webdiscus/webpack-html-scss-boilerplate)
500502
- 10up / Animation Best Practices [demo](https://animation.10up.com/) | [source](https://github.com/10up/animation-best-practices)
501503
1. <a id="usage-examples" name="usage-examples"></a>
502504
Usage examples
503-
- Simple example "Hello World!" [View in browser](https://stackblitz.com/edit/stackblitz-starters-78r926?file=webpack.config.js) | [source](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/examples/hello-world)
505+
- Simple example "Hello World!" [View in browser](https://stackblitz.com/edit/hello-world-webpack?file=webpack.config.js) | [source](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/examples/hello-world)
506+
- Simple example "Hello World!" using `Pug` [View in browser](https://stackblitz.com/edit/hello-world-webpack-pug?file=webpack.config.js) | [source](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/examples/hello-world-pug)
504507
- Automatically processing **multiple HTML** templates [View in browser](https://stackblitz.com/edit/webpack-webpack-js-org-diop8g?file=webpack.config.js) | [source](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/examples/simple-site/)
505508
- **Bootstrap** with Webpack [View in browser](https://stackblitz.com/edit/webpack-webpack-js-org-kjnlvk?file=webpack.config.js) | [source](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/examples/bootstrap)
506509
- **Tailwind CSS** with Webpack [View in browser](https://stackblitz.com/edit/webpack-webpack-js-org-auem8r?file=webpack.config.js) | [source](https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/examples/tailwindcss/)

examples/hello-world-pug/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Hello World!
2+
3+
The simple example using the `Pug` [preprocessor](https://github.com/webdiscus/html-bundler-webpack-plugin#using-template-pug).
4+
5+
Use the [HTML Builder Plugin](https://github.com/webdiscus/html-bundler-webpack-plugin) for Webpack
6+
to compile and bundle source Sass and JavaScript in HTML.
7+
8+
## View and edit in browser
9+
10+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/hello-world-webpack-pug?file=webpack.config.js)
11+
12+
## How to use
13+
14+
```sh
15+
git clone https://github.com/webdiscus/html-bundler-webpack-plugin.git
16+
cd examples/hello-world-pug/
17+
npm install
18+
npm start
19+
```

0 commit comments

Comments
 (0)