Use meta tags for templating, remove JS + Webpack
This commit is contained in:
parent
32d390917b
commit
da60f53a5c
44
Gruntfile.js
44
Gruntfile.js
|
@ -16,12 +16,12 @@ module.exports = grunt => {
|
|||
},
|
||||
focus: {
|
||||
dev: {
|
||||
include: ["css", "js", "json", "md", "njk"],
|
||||
include: ["css", "json", "md", "njk"],
|
||||
},
|
||||
},
|
||||
replace: {
|
||||
dev: {
|
||||
src: ["./dist/**/*.html", "./dist/**/*.js"],
|
||||
src: ["./dist/**/*.html"],
|
||||
replacements: [
|
||||
{
|
||||
from: "%%VERSION_NUMBER%%",
|
||||
|
@ -31,7 +31,7 @@ module.exports = grunt => {
|
|||
overwrite: true
|
||||
},
|
||||
deploy: {
|
||||
src: ["./dist/**/*.html", "./dist/**/*.js"],
|
||||
src: ["./dist/**/*.html"],
|
||||
replacements: [
|
||||
{
|
||||
from: "%%VERSION_NUMBER%%",
|
||||
|
@ -46,10 +46,6 @@ module.exports = grunt => {
|
|||
files: ["src/main/**/*.css"],
|
||||
tasks: ["copy:css"],
|
||||
},
|
||||
js: {
|
||||
files: ["src/main/**/*.js"],
|
||||
tasks: ["webpack:dev", "replace:dev"],
|
||||
},
|
||||
json: {
|
||||
files: ["src/main/**/*.json"],
|
||||
tasks: ["exec:eleventy", "replace:dev"],
|
||||
|
@ -63,33 +59,6 @@ module.exports = grunt => {
|
|||
tasks: ["exec:eleventy", "replace:dev"],
|
||||
},
|
||||
},
|
||||
webpack: {
|
||||
options: {
|
||||
entry: "./src/main/js/main.js",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js"],
|
||||
},
|
||||
output: {
|
||||
filename: "bundle.js",
|
||||
path: path.resolve(__dirname, "dist/"),
|
||||
},
|
||||
},
|
||||
dev: {
|
||||
mode: "development",
|
||||
devtool: "inline-source-map",
|
||||
},
|
||||
deploy: {
|
||||
mode: "production",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks("grunt-contrib-clean");
|
||||
|
@ -98,7 +67,6 @@ module.exports = grunt => {
|
|||
grunt.loadNpmTasks("grunt-exec");
|
||||
grunt.loadNpmTasks("grunt-focus");
|
||||
grunt.loadNpmTasks("grunt-text-replace");
|
||||
grunt.loadNpmTasks("grunt-webpack");
|
||||
|
||||
grunt.registerTask("dev", [
|
||||
// Pre
|
||||
|
@ -106,8 +74,7 @@ module.exports = grunt => {
|
|||
// Generate site
|
||||
"copy:css",
|
||||
"exec:eleventy",
|
||||
// Compile JS
|
||||
"webpack:dev",
|
||||
// Post
|
||||
"replace:dev",
|
||||
]);
|
||||
grunt.registerTask("dev:server", ["dev", "focus:dev"]);
|
||||
|
@ -117,8 +84,7 @@ module.exports = grunt => {
|
|||
// Generate site
|
||||
"copy:css",
|
||||
"exec:eleventy",
|
||||
// Compile JS
|
||||
"webpack:deploy",
|
||||
// Post
|
||||
"replace:deploy",
|
||||
]);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "blog",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"description": "F.W. Dekker's personal blog.",
|
||||
"author": "F.W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
@ -24,9 +24,6 @@
|
|||
"grunt-contrib-watch": "^1.1.0",
|
||||
"grunt-exec": "^3.0.0",
|
||||
"grunt-focus": "^1.0.0",
|
||||
"grunt-text-replace": "^0.4.0",
|
||||
"grunt-webpack": "^4.0.3",
|
||||
"webpack": "^5.45.1",
|
||||
"webpack-cli": "^4.7.2"
|
||||
"grunt-text-replace": "^0.4.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
<meta name="description" content="{{ site.description }}" />
|
||||
<meta name="theme-color" content="#0033cc" />
|
||||
|
||||
<meta name="fwd:nav:target" content="#nav" />
|
||||
<meta name="fwd:footer:target" content="#footer" />
|
||||
<meta name="fwd:footer:vcs-url" content="https://git.fwdekker.com/FWDekker/blog/" />
|
||||
<meta name="fwd:footer:version" content="v%%VERSION_NUMBER%%" />
|
||||
|
||||
<title>{% if page.title %}{{ page.title }}{% else %}Blog{% endif %} | FWDekker</title>
|
||||
|
||||
<link rel="stylesheet" href="https://static.fwdekker.com/fonts/roboto/roboto.css" />
|
||||
|
@ -37,7 +42,5 @@
|
|||
</main>
|
||||
|
||||
<script src="https://static.fwdekker.com/lib/template/2.x.x/template.js"></script>
|
||||
<!--suppress HtmlUnknownTarget -->
|
||||
<script src="{{ '/bundle.js?v=%%VERSION_NUMBER%%' | url }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// noinspection JSUnresolvedVariable
|
||||
const {$, doAfterLoad, footer, nav} = window.fwdekker;
|
||||
|
||||
|
||||
doAfterLoad(() => {
|
||||
$("#nav").appendChild(nav("/Blog/"));
|
||||
$("#footer").appendChild(footer({
|
||||
vcsURL: "https://git.fwdekker.com/FWDekker/blog/",
|
||||
version: "v%%VERSION_NUMBER%%"
|
||||
}));
|
||||
});
|
Loading…
Reference in New Issue