Skip to content

Commit

Permalink
Tweaks for static builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
RatJuggler committed Feb 18, 2021
1 parent e55d924 commit f7229c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const pkg = require('./package.json');
const banner = '/*!\n * <%= pkg.title %> v<%= pkg.version %> (<%= pkg.homepage %>)\n */\n';

function cleanVendor() {
return del(["./public/vendor/"]);
return del(["public/vendor/"]);
}

function cleanDist() {
return del(["./dist/"]);
return del(["dist/"]);
}

// Bring third party dependencies from node_modules into the vendor directory.
Expand Down Expand Up @@ -97,12 +97,12 @@ function copyStaticDist() {
// Static HTML
let html = gulp.src('./public/**/*.html')
.pipe(gulpif(staticBuild, replace('"/template', '"https://jurassic-john.site/template')))
.pipe(gulpif(!staticBuild, replace(/\.\.?\//g, '/')))
.pipe(gulpif(!staticBuild, replace('.html', '')))
.pipe(replace('.min.js', '.js'))
.pipe(replace('.css', '.min.css'))
.pipe(replace('.js', '.min.js'))
.pipe(replace('.html', ''))
.pipe(replace(/\.\.?\//g, '/'))
.pipe(gulp.dest('./dist/public'));
.pipe(gulp.dest('dist/public'));
return merge(webRoot, images, html);
}

Expand All @@ -124,7 +124,7 @@ function copyAppDist() {

// Minify CSS task
function mincss() {
return gulp.src("./public/css/*.css")
return gulp.src("public/css/*.css")
.pipe(plumber())
.pipe(header(banner, {
pkg: pkg
Expand All @@ -133,7 +133,7 @@ function mincss() {
suffix: ".min"
}))
.pipe(cleanCSS())
.pipe(gulp.dest("./dist/public/css"));
.pipe(gulp.dest("dist/public/css"));
}

// Minify JS task
Expand Down
28 changes: 14 additions & 14 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<meta name="og:description" content="Developer portfolio website for John Chase.">
<meta name="og:image" content="">

<link rel="manifest" href="./site.webmanifest">
<link rel="apple-touch-icon" href="./img/apple-touch-icon.png">
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">

<link rel="stylesheet" href="./vendor/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="./vendor/fontawesome-free/css/all.css">
<link rel="stylesheet" href="./css/main.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="vendor/fontawesome-free/css/all.css">
<link rel="stylesheet" href="css/main.css">

<meta name="theme-color" content="#b833c0">
</head>
Expand All @@ -29,7 +29,7 @@
<header>
<nav class="navbar fixed-top navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="#">
<img src="./img/Rat-Profile.svg" width="30" height="30" class="d-inline-block align-top" alt="My profile avatar">
<img src="img/Rat-Profile.svg" width="30" height="30" class="d-inline-block align-top" alt="My profile avatar">
Portfolio - Version Selection
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainMenu" aria-controls="mainMenu" aria-expanded="false" aria-label="Toggle navigation">
Expand All @@ -51,7 +51,7 @@
<div class="dropdown-menu" aria-labelledby="versionMenu">
<span class="dropdown-header">Site Version</span>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/static/profile.html">Static HTML</a>
<a class="dropdown-item" href="static/profile.html">Static HTML</a>
<a class="dropdown-item" href="/template/json/profile">Template / Static JSON Files</a>
<a class="dropdown-item" href="/template/map/profile">Template / Map Spring Service</a>
<a class="dropdown-item" href="/template/sql/profile">Template / SQL Spring Service</a>
Expand Down Expand Up @@ -80,7 +80,7 @@
<h1>John Chase - Developer Portfolio Site</h1>
<p class="lead">Please select the version of the site you would like to visit. You can changes versions at any time by using the Setting menu.</p>
<ul class="lead">
<li><a href="/static/profile.html" class="list-group-item-action">Static HTML only</a></li>
<li><a href="static/profile.html" class="list-group-item-action">Static HTML only</a></li>
<li><a href="/template/json/profile" class="list-group-item-action">Template with data from static JSON files</a></li>
<li><a href="/template/map/profile" class="list-group-item-action">Template with data from a Map repository Spring service</a></li>
<li><a href="/template/sql/profile" class="list-group-item-action">Template with data from a SQL repository Spring service</a></li>
Expand Down Expand Up @@ -117,12 +117,12 @@ <h5 class="modal-title" id="signOutConfirmationLabel">Sign Out Confirmation</h5>
</div>
</div>

<script src="./js/vendor/modernizr-3.11.2.min.js"></script>
<script src="./vendor/jquery/jquery.js"></script>
<script src="./vendor/popper/popper.js"></script>
<script src="./vendor/bootstrap/js/bootstrap.js"></script>
<script src="./js/plugins.js"></script>
<script src="./js/main.js"></script>
<script src="js/vendor/modernizr-3.11.2.min.js"></script>
<script src="vendor/jquery/jquery.js"></script>
<script src="vendor/popper/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>

</html>

0 comments on commit f7229c4

Please sign in to comment.