Comments (4)
All you need to do is modify webpack.plugins.js to instead of using path.basename(dir)
which throws away the directory path, extract the html "filename" from dir
including the relative path compared to src
. Something like:
const filename = path.relative(config.paths.src, dir);
Actually this could be updated in the repo, as it would be more versatile.
Together with changing line 58 as:
const generateHTMLPlugins = () => glob.sync(`./${config.paths.src}/**/*.html`).map((dir) => {
which would allow the src path to be properly modified here, but that is not directly related to this issue, just saying, as once config.paths.src
is being used to generate the relative filenames it'd be preferable to use that to gather the files as well instead of hardcoded src
as of now.
from static-site-boilerplate.
Have you found any way to load style and script on subfolder.
from static-site-boilerplate.
You will be able to organize HTML files in folders, by adding the below code
filename = dir.substring(6);
in https://github.com/ericalli/static-site-boilerplate/blob/master/config/webpack.plugins.js#L60
Can be done better, if we alter the actual code.
from static-site-boilerplate.
Would be great if we could have different directories and root level pages e.g.
contact.html
index.html
insights.html
service.html
team.html
blog/story1.html
blog/story2.html
insights/insight1.html
insights/insight2.html
services/service1.html
services/service2.html
team/member1.html
team/member2.html
Any idea how to change the script to do this?
from static-site-boilerplate.
Related Issues (20)
- Integrate file-include-webpack-plugin HOT 3
- Error: No configuration provided for styles.scss HOT 1
- Error "Option `sitemap` should be an absolute URL" when I run/build for production
- SSL Cert expired on docs page. HOT 1
- Video isn't being loaded during production. HOT 3
- Is there a way to implement permanent redirect?
- Cannot npm install on node 13.8.0
- Support for the experimental syntax 'optionalChaining' isn't currently enabled
- Fresh install npm install error HOT 6
- Use a templating/include engine HOT 1
- webp images are not being copied
- Images referenced in HTML are incorrectly deleted during production build HOT 4
- Unmodified clone doesn't build HOT 1
- devServer hot reload does not working. HOT 1
- When running NPM install site_url is blank and causes issues.
- FEAT: Use TailwindCSS for styling HOT 2
- Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8 ( Apple M1 )
- Need to update node-sass to sass and update image-webpack-loader
- npm install fails HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from static-site-boilerplate.