Merge remote-tracking branch 'remotes/origin/v2'
# Conflicts: # README.md # assets/css/notice.css # package.json # source/css/style.css # static/assets/blue.css # static/assets/green.css # static/assets/main.js # static/assets/pink.css # static/assets/prism.js # static/assets/red.css # static/assets/style.css # yarn.lock
This commit is contained in:
commit
67d50bb8b5
30
README.md
30
README.md
@ -184,7 +184,17 @@ See the basic `post` file params supported by the theme — https://github.com/p
|
||||
|
||||
## How to run your site
|
||||
|
||||
From your Hugo root directory run:
|
||||
The theme is using [Hugo Pipes](https://gohugo.io/hugo-pipes/) to handle Javascript and PostCSS files. This setup **requires** following npm packages: `@babel/core`, `@babel/cli` and `postcss-cli`. Before you start, you have to install them (globally or locally). Here's how you can set it all up from your Hugo root directory by running:
|
||||
|
||||
```
|
||||
yarn add -D @babel/core @babel/cli postcss-cli
|
||||
cd themes/terminal
|
||||
git checkout v2
|
||||
yarn
|
||||
cd ../..
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```
|
||||
$ hugo server -t terminal
|
||||
@ -195,21 +205,7 @@ and go to `localhost:1313` in your browser. From now on all the changes you make
|
||||
## How to edit the theme
|
||||
|
||||
If you have to override some of the styles, **you can do this easily** by adding `static/style.css` in your root directory and point things you want to change.
|
||||
|
||||
Otherwise, if you really want to edit the theme, you need to install Node dependencies. To do so, go to the theme directory (from your Hugo root directory):
|
||||
|
||||
```
|
||||
$ cd themes/terminal
|
||||
```
|
||||
|
||||
and then run:
|
||||
|
||||
```
|
||||
$ npm install
|
||||
$ npm i yarn
|
||||
$ yarn
|
||||
$ yarn build
|
||||
```
|
||||
But you can also copy `assets` folder from the theme to your root directory and modify the files. This will protect your changes from the override when you update the theme.
|
||||
|
||||
## How to contribute
|
||||
|
||||
@ -227,6 +223,6 @@ If you like my work and want to support the development of the project, now you
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2019 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
||||
Copyright © 2019-2020 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
||||
|
||||
The theme is released under the MIT License. Check the [original theme license](https://github.com/panr/hugo-theme-terminal/blob/master/LICENSE.md) for additional licensing information.
|
||||
|
17
assets/css/style.css
Normal file
17
assets/css/style.css
Normal file
@ -0,0 +1,17 @@
|
||||
@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';
|
||||
@import 'notice.css';
|
18
babel.config.js
Normal file
18
babel.config.js
Normal 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,
|
||||
};
|
||||
};
|
@ -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" "" }}">
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -9,9 +9,7 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author">::
|
||||
{{ . }}
|
||||
</span>
|
||||
<span class="post-author">:: {{ . }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
@ -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" . }}
|
||||
|
@ -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) -->
|
||||
|
47
package.json
47
package.json
@ -1,60 +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"
|
||||
},
|
||||
"dependencies": {
|
||||
"yarn": "^1.22.4"
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +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';
|
||||
@import 'notice';
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),n(2),e.exports=n(3)},function(e,t){},function(e,t){var n=document.querySelector(".container"),o=document.querySelector(".menu"),r=document.querySelector(".menu-trigger"),i=(document.querySelector(".menu__inner--desktop"),document.querySelector(".menu__sub-inner-more-trigger")),c=document.querySelector(".menu__sub-inner-more"),u=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),a=function(){return window.matchMedia(u).matches},d=function(){r&&r.classList.toggle("hidden",!a()),o&&o.classList.toggle("hidden",a()),c&&c.classList.toggle("hidden",!a())};o&&o.addEventListener("click",function(e){return e.stopPropagation()}),c&&c.addEventListener("click",function(e){return e.stopPropagation()}),d(),document.body.addEventListener("click",function(){a()||!c||c.classList.contains("hidden")?a()&&!o.classList.contains("hidden")&&o.classList.add("hidden"):c.classList.add("hidden")}),window.addEventListener("resize",d),r&&r.addEventListener("click",function(e){e.stopPropagation(),o&&o.classList.toggle("hidden")}),i&&i.addEventListener("click",function(e){e.stopPropagation(),c&&c.classList.toggle("hidden"),c.getBoundingClientRect().right>n.getBoundingClientRect().right&&(c.style.left="auto",c.style.right=0)})},function(e,t){var n=getComputedStyle(document.body).getPropertyValue("--phoneWidth");window.matchMedia(n).matches||(languageSelector=document.querySelector(".language-selector-current"),moreLanguagesContainer=document.querySelector(".language-selector__more"),document.body.addEventListener("click",function(){moreLanguagesContainer&&!moreLanguagesContainer.classList.contains("hidden")&&moreLanguagesContainer.classList.add("hidden")}),languageSelector&&languageSelector.addEventListener("click",function(e){e.stopPropagation(),moreLanguagesContainer.classList.toggle("hidden")}))}]);
|
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
Loading…
x
Reference in New Issue
Block a user