Browse Source

Made the website lighter, removed JS entirely, made some adjustments to CSS.

Signed-off-by: Dušan Mitrović <dusan@dusanmitrovic.xyz>
master
Dušan Mitrović 3 weeks ago
parent
commit
76a51c7de4
No known key found for this signature in database GPG Key ID: 54261991535AB4CB
17 changed files with 755 additions and 4713 deletions
  1. +2
    -0
      config/handlebars.js
  2. +687
    -3386
      package-lock.json
  3. +1
    -1
      package.json
  4. +0
    -1
      routes/blog.js
  5. +7
    -1
      static/css/blog-post.css
  6. +26
    -0
      static/css/footer.css
  7. +1
    -1
      static/css/navbar.css
  8. +2
    -2
      static/css/style.css
  9. BIN
     
  10. +0
    -28
      static/js/main.js
  11. +0
    -1215
      static/js/prism.js
  12. +0
    -51
      static/js/ui-functions.js
  13. +11
    -0
      views/helpers/date.js
  14. +0
    -2
      views/home.hbs
  15. +3
    -9
      views/layouts/main.hbs
  16. +6
    -0
      views/partials/footer.hbs
  17. +9
    -16
      views/view-data/home.js

+ 2
- 0
config/handlebars.js View File

@@ -6,6 +6,7 @@
*/
const { dirname } = require('path');
const compareHandlebarsHelper = require('../views/helpers/compare');
const copyrightDateHandlebarsHelper = require('../views/helpers/date');

const handlebarsConfig = {
extname: 'hbs',
@@ -14,6 +15,7 @@ const handlebarsConfig = {
layoutsDir: dirname(require.main.filename) + '/views/layouts/',
helpers: {
compare: compareHandlebarsHelper,
copyrightDate: copyrightDateHandlebarsHelper,
},
};



+ 687
- 3386
package-lock.json
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

@@ -32,7 +32,7 @@
"gm": "^1.23.1",
"image-size": "^0.9.3",
"jsdom": "^16.4.0",
"knex": "^0.21.15",
"knex": "^0.95.13",
"marked": "^2.0.1",
"method-override": "^3.0.0",
"moment": "^2.29.1",


+ 0
- 1
routes/blog.js View File

@@ -56,7 +56,6 @@ router.get('/post/:date/:slug', async (req, res) => {
return res.render('blogPost', {
title: post.title,
css,
js: ['/static/js/prism.js'],
id: post.id,
slug: post.slug,
content: markdown2Html(post.content),


+ 7
- 1
static/css/blog-post.css View File

@@ -77,7 +77,12 @@
.post-content h1 {
color: var(--red);
font-size: 2rem;
margin-bottom: 0.5em;
margin: 0.5em 0;
}

.post-content h2 {
color: var(--red);
margin: 0.5em 0;
}

.post-content h3 {
@@ -114,6 +119,7 @@ ol {

.post-content pre {
border: 1px solid var(--foreground);
padding: 1em;
}

.post-actions {


+ 26
- 0
static/css/footer.css View File

@@ -0,0 +1,26 @@
footer {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.footer-copy {
padding-bottom: 3em;
}

.footer-license {
margin-bottom: 1em;
}

.footer-copyleft {
display: inline-block;
text-align: right;
margin: 0px;
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: “FlipH”;
}

+ 1
- 1
static/css/navbar.css View File

@@ -11,7 +11,7 @@ header {

.navbar-nav {
display: flex;
justify-content: space-around;
justify-content: center;
align-items: center;
height: 100%;
}


+ 2
- 2
static/css/style.css View File

@@ -43,8 +43,8 @@ h3 {

.container {
overflow: hidden;
margin: 3em auto;
width: 75%;
margin: 3em auto 1em auto;
width: 1500px;
}

.text-center {


BIN
View File


+ 0
- 28
static/js/main.js View File

@@ -1,28 +0,0 @@
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* Copyright (C) 2020 Dusan Mitrovic <dusan@dusanmitrovic.xyz>
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* @licend The above is the entire license notice
* for the JavaScript code in this page.
*/
document.addEventListener('DOMContentLoaded', () => {
if ('function' === typeof determineActiveNavigation) {
determineActiveNavigation();
}
});

+ 0
- 1215
static/js/prism.js
File diff suppressed because it is too large
View File


+ 0
- 51
static/js/ui-functions.js View File

@@ -1,51 +0,0 @@
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* Copyright (C) 2020 Dusan Mitrovic <dusan@dusanmitrovic.xyz>
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* @licend The above is the entire license notice
* for the JavaScript code in this page.
*/

/**
* Appends an active css class to a currently active navigation link
*
* @returns {void}
*/
const determineActiveNavigation = () => {
const currentPath = window.location.pathname;

const navigationLinks = document.querySelectorAll('.navbar-link');

for (navigationLink of navigationLinks) {
const navigationLinkPath = navigationLink.getAttribute('href');

if (navigationLinkPath === '/' && currentPath === '/') {
navigationLink.classList.add('active');
return;
}

if (
navigationLinkPath !== '/' &&
currentPath.includes(navigationLinkPath)
) {
navigationLink.classList.add('active');
return;
}
}
};

+ 11
- 0
views/helpers/date.js View File

@@ -0,0 +1,11 @@
/**
* @author Dusan Mitrovic <dusan@dusanmitrovic.xyz>
* @license AGPL-3.0-or-later https://opensource.org/licenses/AGPL-3.0
*
* @summary This helper prints the current year into the template
*/
const copyrightDateHandlebarsHelper = () => {
return new Date().getFullYear();
};

module.exports = copyrightDateHandlebarsHelper;

+ 0
- 2
views/home.hbs View File

@@ -3,7 +3,5 @@
{{#each cards}}
{{> card title=this.title image=this.image content=this.content links=this.links }}
{{/each}}

<p class="text-center">{{copyrightText}}</p>
</main>
</section>

+ 3
- 9
views/layouts/main.hbs View File

@@ -19,6 +19,8 @@
<link rel="stylesheet" href="/static/css/navbar.css">
<!-- Card Stylesheet -->
<link rel="stylesheet" href="/static/css/card.css">
<!-- Footer Stylesheet -->
<link rel="stylesheet" href="/static/css/footer.css">
<!-- Form Stylesheet -->
<link rel="stylesheet" href="/static/css/form.css">
<!-- Main Stylesheet -->
@@ -35,14 +37,6 @@
<body>
{{> navbar}}
{{{ body }}}
{{#if js}}
{{#each js}}
<script src="{{this}}"></script>
{{/each}}
{{/if}}
<!-- UI Functions JS File -->
<script src="/static/js/ui-functions.js"></script>
<!-- Main JS File -->
<script src="/static/js/main.js"></script>
{{> footer}}
</body>
</html>

+ 6
- 0
views/partials/footer.hbs View File

@@ -0,0 +1,6 @@
<footer>
<a class="footer-license" rel="license" target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt">
<img alt="Creative Commons Licence" style="border-width:0" src="/static/images/cc.png" />
</a>
<p class="footer-copy"><span class="footer-copyleft">©</span> {{#copyrightDate}}{{/copyrightDate}} Dušan Mitrović - All rights reversed</p>
</footer>

+ 9
- 16
views/view-data/home.js View File

@@ -7,15 +7,15 @@ module.exports = {
url: process.env.HOST,
description: `I'm a network engineering student and a professional software developer and a gigantic GNU/Linux enthusiast.`,
},
copyrightText: `© ${new Date().getFullYear()} Dušan Mitrović - All rights reversed`,
cards: [
{
title: 'About me',
content: `I'm a professional software developer, advocate of free and open source software, minimalism and altruism.
When I'm not coding I study network engineering at ICT College of Vocational studies in Belgrade, Serbia.
Despite working as a backend developer professionally, I still consider programming mostly a hobby.
To that end I develop passion projects, scripts and other stuff that I may consider useful.
This website is one of those passion projects and I use it to write my blog.`,
content: `I'm a professional software developer, advocate of free and open source software and minimalism.
When I'm not coding I usually study what I find interesting in the moment.
Despite working as a backend developer professionally, I still consider programming mostly a hobby.
This website was created to fullfil my desire to express myself creatively.
You can find my config files and more by visiting my Github page at the link below.
`,
links: [
{
url: 'https://github.com/dusnm',
@@ -46,21 +46,14 @@ module.exports = {
{
title: 'Other',
content: `This website is free software, licensed under the terms of the GNU AGPL 3.0 or later.
You're free to study it, modify it and redistribute it as long as you abide by the license terms and conditions.
Additionally all content is licensed under the terms of the CC BY-SA 4.0 license.`,
You're free to study it, modify it and redistribute it as long as you abide by the license terms and conditions.
Additionally all content is licensed under the terms of the CC BY-SA 4.0 license.
If you want to contact me with encrypted email, my PGP key is listed below as well.`,
links: [
{
url: 'https://git.dusanmitrovic.xyz/dusan/dusanmitrovic.xyz',
text: '🔧 Source Code',
},
{
url: 'https://git.dusanmitrovic.xyz/dusan/dusanmitrovic.xyz/raw/branch/master/LICENSE',
text: '⚖️ AGPL 3.0',
},
{
url: 'https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt',
text: '⚖️ CC BY-SA 4.0',
},
{
url: '/static/publickey.txt',
text: '🔑 PGP Key',


Loading…
Cancel
Save