Webpack -> Hugo Pipes

This commit is contained in:
panr 2020-07-16 23:56:01 +02:00
parent 73373847d8
commit 0759309c59
42 changed files with 67 additions and 322 deletions

16
assets/css/style.css Normal file
View File

@ -0,0 +1,16 @@
@import 'variables.css';
@import 'font.css';
@import 'buttons.css';
@import 'header.css';
@import 'logo.css';
@import 'main.css';
@import 'post.css';
@import 'pagination.css';
@import 'footer.css';
@import 'prism.css';
@import 'syntax.css';
@import 'code.css';
@import 'terms.css';

18
babel.config.js Normal file
View File

@ -0,0 +1,18 @@
module.exports = function(api) {
api.cache(true);
const presets = [
[
"@babel/preset-env",
{
targets: "last 2 versions, >1%, not dead",
},
],
];
const plugins = [];
return {
presets,
plugins,
};
};

View File

@ -2,11 +2,11 @@
<html lang="{{ $.Site.Language }}">
<head>
{{ block "title" . }}
<title>{{ if .IsHome }}{{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}{{ end }}</title>
<title>{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }}{{ end }}</title>
{{ end }}
{{ partial "head.html" . }}
</head>
<body class="">
<body class="{{- ( or .Params.color $.Site.Params.ThemeColor ) -}}">
{{ $container := cond $.Site.Params.FullWidthTheme "container full" (cond $.Site.Params.CenterTheme "container center" "container") }}
<div class="{{- $container -}}{{- cond ($.Site.Params.oneHeadingSize | default true) " headings--one-size" "" }}">

View File

@ -24,7 +24,7 @@
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Params.Author }}
<span class="post-author">::{{ . }}</span>
<span class="post-author">:: {{ . }}</span>
{{ end }}
</div>

View File

@ -15,7 +15,7 @@
{{ .Date.Format "2006-01-02" }}
</span>
{{ with .Params.Author }}
<span class="post-author">::{{ . }}</span>
<span class="post-author">:: {{ . }}</span>
{{ end }}
</div>

View File

@ -9,9 +9,7 @@
</span>
{{ end }}
{{ with .Params.Author }}
<span class="post-author">::
{{ . }}
</span>
<span class="post-author">:: {{ . }}</span>
{{ end }}
</div>

View File

@ -12,8 +12,13 @@
</div>
</footer>
<script src="{{ "assets/main.js" | absURL }}"></script>
<script src="{{ "assets/prism.js" | absURL }}"></script>
{{ $js := resources.Get "js/main.js" | js.Build }}
{{ $js := resources.Get "js/prism.js" | js.Build }}
{{ $opts := dict "noComments" true "minified" true "compact" true }}
{{ $menu := resources.Get "js/menu.js" | js.Build | babel $opts }}
{{ $prism := resources.Get "js/prism.js" | js.Build | babel $opts }}
<script src="{{ $menu.Permalink }}"></script>
<script src="{{ $prism.Permalink }}"></script>
<!-- Extended footer section-->
{{ partial "extended_footer.html" . }}

View File

@ -8,11 +8,15 @@
{{ template "_internal/google_analytics.html" . }}
<!-- Theme CSS -->
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
{{ if (isset .Params "color") }}
<link rel="stylesheet" href="{{ (printf "assets/%s.css" .Params.color) | absURL }}">
{{ else if (ne $.Site.Params.ThemeColor "orange") }}
<link rel="stylesheet" href="{{ (printf "assets/%s.css" $.Site.Params.ThemeColor) | absURL }}">
{{ $css := resources.Get "css/style.css" }}
{{ $opts := dict "inlineImports" true }}
{{ $style := $css | resources.PostCSS $opts | minify }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{ if (or (isset .Params "color") (ne $.Site.Params.ThemeColor "orange")) }}
{{ $colorCss := resources.Get (printf "css/color/%s.css" (or .Params.color $.Site.Params.ThemeColor)) }}
{{ $color := $colorCss | resources.PostCSS $opts | minify }}
<link rel="stylesheet" href="{{ $color.Permalink }}">
{{ end }}
<!-- Custom CSS to override theme properties (/static/style.css) -->

View File

@ -1,57 +1,37 @@
{
"name": "terminal",
"version": "1.0.0",
"version": "2.0.0",
"main": "index.js",
"author": "Radosław Kozieł <@panr> <radoslaw.koziel@gmail.com>",
"license": "MIT",
"scripts": {
"dev": "webpack --mode=development --watch",
"build": "webpack --mode=production"
},
"browserslist": [
"last 2 versions",
">1%",
"not dead"
],
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.10.5",
"@babel/parser": "^7.4.2",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/preset-stage-2": "^7.0.0",
"angular-html-parser": "^1.2.0",
"babel-eslint": "^8.2.1",
"babel-loader": "^8.0.5",
"browserslist": "^4.0.1",
"clean-webpack-plugin": "^0.1.19",
"clipboard": "^2.0.4",
"css-loader": "^1.0.1",
"cssnano": "^4.1.8",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^2.10.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"postcss": "^7.0.0",
"postcss-browser-reporter": "^0.5.0",
"postcss-cli": "^6.1.1",
"postcss-color-function": "^4.0.1",
"postcss-cli": "^7.1.1",
"postcss-color-mod-function": "^3.0.3",
"postcss-import": "^11.1.0",
"postcss-loader": "^2.1.6",
"postcss-mixins": "^6.2.1",
"postcss-nested": "^3.0.0",
"postcss-preset-env": "^5.3.0",
"postcss-reporter": "^5.0.0",
"postcss-url": "^7.3.2",
"prettier-eslint-cli": "^4.7.1",
"ramda": "^0.25.0",
"style-loader": "^0.21.0",
"uglifyjs-webpack-plugin": "^1.3.0",
"url-loader": "^1.1.2",
"webpack": "^4.29.3",
"webpack-cli": "^3.2.3"
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-mixins": "^6.2.3",
"postcss-nested": "^4.2.3",
"postcss-preset-env": "^6.7.0",
"postcss-reporter": "^6.0.1",
"postcss-url": "^8.0.0",
"prettier-eslint-cli": "^4.7.1"
}
}

View File

@ -1,16 +0,0 @@
@import 'variables';
@import 'font';
@import 'buttons';
@import 'header';
@import 'logo';
@import 'main';
@import 'post';
@import 'pagination';
@import 'footer';
@import 'prism';
@import 'syntax';
@import 'code';
@import 'terms';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,133 +0,0 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./source/js/languageSelector.js":
/*!***************************************!*\
!*** ./source/js/languageSelector.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("var mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nif (!isMobile()) {\n languageSelector = document.querySelector(\".language-selector-current\");\n moreLanguagesContainer = document.querySelector(\".language-selector__more\");\n document.body.addEventListener(\"click\", function () {\n if (moreLanguagesContainer && !moreLanguagesContainer.classList.contains(\"hidden\")) {\n moreLanguagesContainer.classList.add(\"hidden\");\n }\n });\n languageSelector && languageSelector.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n moreLanguagesContainer.classList.toggle(\"hidden\");\n });\n}\n\n//# sourceURL=webpack:///./source/js/languageSelector.js?");
/***/ }),
/***/ "./source/js/main.js":
/*!***************************!*\
!*** ./source/js/main.js ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("// Add your script here\n\n//# sourceURL=webpack:///./source/js/main.js?");
/***/ }),
/***/ "./source/js/menu.js":
/*!***************************!*\
!*** ./source/js/menu.js ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("var container = document.querySelector(\".container\");\nvar menu = document.querySelector(\".menu\");\nvar mobileMenuTrigger = document.querySelector(\".menu-trigger\");\nvar desktopMenu = document.querySelector(\".menu__inner--desktop\");\nvar desktopMenuTrigger = document.querySelector(\".menu__sub-inner-more-trigger\");\nvar menuMore = document.querySelector(\".menu__sub-inner-more\");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue(\"--phoneWidth\");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nvar handleMenuClasses = function handleMenuClasses() {\n mobileMenuTrigger && mobileMenuTrigger.classList.toggle(\"hidden\", !isMobile());\n menu && menu.classList.toggle(\"hidden\", isMobile());\n menuMore && menuMore.classList.toggle(\"hidden\", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener(\"click\", function (e) {\n return e.stopPropagation();\n});\nhandleMenuClasses();\ndocument.body.addEventListener(\"click\", function () {\n if (!isMobile() && menuMore && !menuMore.classList.contains(\"hidden\")) {\n menuMore.classList.add(\"hidden\");\n } else if (isMobile() && !menu.classList.contains(\"hidden\")) {\n menu.classList.add(\"hidden\");\n }\n});\nwindow.addEventListener(\"resize\", handleMenuClasses); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menu && menu.classList.toggle(\"hidden\");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener(\"click\", function (e) {\n e.stopPropagation();\n menuMore && menuMore.classList.toggle(\"hidden\");\n\n if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n menuMore.style.left = \"auto\";\n menuMore.style.right = 0;\n }\n});\n\n//# sourceURL=webpack:///./source/js/menu.js?");
/***/ }),
/***/ 0:
/*!*************************************************************************************!*\
!*** multi ./source/js/main.js ./source/js/menu.js ./source/js/languageSelector.js ***!
\*************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("__webpack_require__(/*! /Users/radek/Documents/Git/Moje/terminal/themes/terminal/source/js/main.js */\"./source/js/main.js\");\n__webpack_require__(/*! /Users/radek/Documents/Git/Moje/terminal/themes/terminal/source/js/menu.js */\"./source/js/menu.js\");\nmodule.exports = __webpack_require__(/*! /Users/radek/Documents/Git/Moje/terminal/themes/terminal/source/js/languageSelector.js */\"./source/js/languageSelector.js\");\n\n\n//# sourceURL=webpack:///multi_./source/js/main.js_./source/js/menu.js_./source/js/languageSelector.js?");
/***/ })
/******/ });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long