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

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' ...@@ -16,33 +16,33 @@ const dest = './build'
// Move fonts to build/fonts // Move fonts to build/fonts
gulp.task('fonts', () => gulp.src('./node_modules/font-awesome/fonts/fontawesome-webfont.woff2').pipe(connect.reload()) 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 // Move html to build/html
gulp.task('html', () => gulp.src(src + '/html/*.html').pipe(connect.reload()) 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 // Optimize images and move them to build/img
gulp.task('img', () => gulp.src(src + '/img/*').pipe(connect.reload()) gulp.task('img', () => gulp.src(src + '/img/*').pipe(connect.reload())
.pipe(imagemin()) .pipe(imagemin())
.pipe(gulp.dest(dest + '/masonstrap/img/')) .pipe(gulp.dest(dest + '/img/'))
); );
// Move required js files to build/js // Move required js files to build/js
gulp.task('js', () => { gulp.task('js', () => {
let bootstrap = gulp.src('./node_modules/bootstrap/dist/js/bootstrap.min.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') 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') 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') 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()) return merge(bootstrap, jquery, popper, masonstrap).pipe(connect.reload())
}); });
...@@ -53,10 +53,10 @@ gulp.task('sass', () => gulp.src(src + '/scss/*.scss').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(sass().on('error', sass.logError))
.pipe(postcss([autoprefixer()])) .pipe(postcss([autoprefixer()]))
.pipe(sourcemaps.write()) .pipe(sourcemaps.write())
.pipe(gulp.dest(dest + '/masonstrap/css/')) .pipe(gulp.dest(dest + '/css/'))
.pipe(uglifycss()) .pipe(uglifycss())
.pipe(rename({extname: ".min.css"})) .pipe(rename({extname: ".min.css"}))
.pipe(gulp.dest(dest + '/masonstrap/css/') .pipe(gulp.dest(dest + '/css/')
)); ));
// Run task whenever associated files change // Run task whenever associated files change
......
...@@ -31,13 +31,13 @@ ...@@ -31,13 +31,13 @@
<title>Masonstrap 4 &bull; Home</title> <title>Masonstrap 4 &bull; Home</title>
<!-- Load in static content --> <!-- Load in static content -->
<link rel="icon" href="/masonstrap/img/favicon.ico" sizes="16x16"> <link rel="icon" href="./img/favicon.ico" sizes="16x16">
<link rel="stylesheet" href="/masonstrap/css/masonstrap.min.css" media="screen"> <link rel="stylesheet" href="./css/masonstrap.min.css" media="screen">
</head> </head>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary"> <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand d-flex mx-auto" href="#"> <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 &nbsp;Masonstrap
</a> </a>
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
</nav> </nav>
<!-- load in external js --> <!-- load in external js -->
<script src="/masonstrap/js/jquery.min.js"></script> <script src="./js/jquery.min.js"></script>
<script src="/masonstrap/js/popper.min.js"></script> <script src="./js/popper.min.js"></script>
<script src="/masonstrap/js/bootstrap.min.js"></script> <script src="./js/bootstrap.min.js"></script>
</html> </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