Ty3uK / parcel-plugin-pug

Pug template support for Parcel bundler
MIT License
46 stars 6 forks source link

Render out anchor link sources #7

Open felixfong227 opened 6 years ago

felixfong227 commented 6 years ago

I have a home page that includes a nav.pug NavBar template, and in that nav.pug I got some anchor link to my other pages. But the funny thing is ParcelJS will also render out my anchor tag sources, so it will make my page look super weird

Tree view

├── package.json
├── src
|  ├── 335.pug
|  ├── 379.pug
|  ├── PUG
|  |  └── includes
|  |     ├── header.pug
|  |     └── nav.pug
|  ├── history.pug
|  ├── index.pug
|  ├── markI.pug
|  ├── markV.pug
|  └── markVII.pug
// src/PUG/includes/nav.pug
#nav
    a.button(href='index.pug') Home
    a.button(href='history.pug') History
    a.button(href='335.pug') Spitfire
    //a.button(href='379.pug') Spitfire
    //a.button(href='markI.pug') Spitfire Mark I
    //a.button(href='markV.pug') Spitfire Mark V
    //a.button(href='markVII.pug') Spitfire Mk VII
// index.pug
doctype html
html(lang='en')
    head
        meta(charset='UTF-8')
        meta(name='viewport', content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0')
        meta(http-equiv='X-UA-Compatible', content='ie=edge')
        title Spitfire | Home Page
        link(rel='stylesheet', href='css/index.css')
    body

        include ./PUG/includes/header.pug

        #app.container
            .context
                | some content

        include ./PUG/includes/nav.pug
Ty3uK commented 6 years ago

Hmm, that’s funny example. 😊 But passing pug files to href covered by official docs?

Sent with GitHawk

felixfong227 commented 6 years ago

Yes, it did convert my PUG file into HTML file, but somehow it puts all the HTML content on the index page, but other than that, I just work out perfectly :/

Ty3uK commented 6 years ago

Ok, I'll check it