Verified Commit 67c22443 authored by David Haynes's avatar David Haynes 🙆

Relative pathing for static file loading

- plespl
parent d6e15e73
Pipeline #1597 passed with stages
in 1 minute and 16 seconds
......@@ -16,33 +16,33 @@ const dest = './build'
// Move fonts to build/fonts
gulp.task('fonts', () => gulp.src('./node_modules/font-awesome/fonts/fontawesome-webfont.woff2').pipe(connect.reload())
.pipe(gulp.dest(dest + '/masonstrap/fonts/'))
.pipe(gulp.dest(dest + '/fonts/'))
);
// Move html to build/html
gulp.task('html', () => gulp.src(src + '/html/*.html').pipe(connect.reload())
.pipe(gulp.dest(dest + '/masonstrap/'))
.pipe(gulp.dest(dest))
);
// Optimize images and move them to build/img
gulp.task('img', () => gulp.src(src + '/img/*').pipe(connect.reload())
.pipe(imagemin())
.pipe(gulp.dest(dest + '/masonstrap/img/'))
.pipe(gulp.dest(dest + '/img/'))
);
// Move required js files to build/js
gulp.task('js', () => {
let bootstrap = gulp.src('./node_modules/bootstrap/dist/js/bootstrap.min.js')
.pipe(gulp.dest(dest + '/masonstrap/js/'))
.pipe(gulp.dest(dest + '/js/'))
let jquery = gulp.src('./node_modules/jquery/dist/jquery.min.js')
.pipe(gulp.dest(dest + '/masonstrap/js/'))
.pipe(gulp.dest(dest + '/js/'))
let popper = gulp.src('./node_modules/popper.js/dist/umd/popper.min.js')
.pipe(gulp.dest(dest + '/masonstrap/js/'))
.pipe(gulp.dest(dest + '/js/'))
let masonstrap = gulp.src(src + '/js/*.js')
.pipe(gulp.dest(dest + '/masonstrap/js/'))
.pipe(gulp.dest(dest + '/js/'))
return merge(bootstrap, jquery, popper, masonstrap).pipe(connect.reload())
});
......@@ -53,10 +53,10 @@ gulp.task('sass', () => gulp.src(src + '/scss/*.scss').pipe(connect.reload())
.pipe(sass().on('error', sass.logError))
.pipe(postcss([autoprefixer()]))
.pipe(sourcemaps.write())
.pipe(gulp.dest(dest + '/masonstrap/css/'))
.pipe(gulp.dest(dest + '/css/'))
.pipe(uglifycss())
.pipe(rename({extname: ".min.css"}))
.pipe(gulp.dest(dest + '/masonstrap/css/')
.pipe(gulp.dest(dest + '/css/')
));
// Run task whenever associated files change
......
......@@ -31,13 +31,13 @@
<title>Masonstrap 4 &bull; Home</title>
<!-- Load in static content -->
<link rel="icon" href="/masonstrap/img/favicon.ico" sizes="16x16">
<link rel="stylesheet" href="/masonstrap/css/masonstrap.min.css" media="screen">
<link rel="icon" href="./img/favicon.ico" sizes="16x16">
<link rel="stylesheet" href="./css/masonstrap.min.css" media="screen">
</head>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand d-flex mx-auto" href="#">
<img src="/masonstrap/img/SRCT_square.svg" width="30" height="30" class="d-inline-block align-top" alt="SRCT Masonstrap">
<img src="./img/SRCT_square.svg" width="30" height="30" class="d-inline-block align-top" alt="SRCT Masonstrap">
&nbsp;Masonstrap
</a>
......@@ -67,8 +67,8 @@
</nav>
<!-- load in external js -->
<script src="/masonstrap/js/jquery.min.js"></script>
<script src="/masonstrap/js/popper.min.js"></script>
<script src="/masonstrap/js/bootstrap.min.js"></script>
<script src="./js/jquery.min.js"></script>
<script src="./js/popper.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment