Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
145a758159
21
README.md
21
README.md
@ -17,6 +17,7 @@
|
|||||||
- [How to edit the theme](#how-to-edit-the-theme)
|
- [How to edit the theme](#how-to-edit-the-theme)
|
||||||
- [How to contribute](#how-to-contribute)
|
- [How to contribute](#how-to-contribute)
|
||||||
- [Terminal theme user?](#terminal-theme-user)
|
- [Terminal theme user?](#terminal-theme-user)
|
||||||
|
- [Sponsoring](#sponsoring)
|
||||||
- [Licence](#licence)
|
- [Licence](#licence)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@ -65,7 +66,7 @@ $ git submodule add https://github.com/panr/hugo-theme-terminal.git themes/termi
|
|||||||
|
|
||||||
The theme doesn't require any advanced configuration. Just copy:
|
The theme doesn't require any advanced configuration. Just copy:
|
||||||
|
|
||||||
```
|
```toml
|
||||||
baseurl = "/"
|
baseurl = "/"
|
||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
theme = "terminal"
|
theme = "terminal"
|
||||||
@ -74,22 +75,32 @@ paginate = 5
|
|||||||
[params]
|
[params]
|
||||||
# dir name of your blog content (default is `content/posts`)
|
# dir name of your blog content (default is `content/posts`)
|
||||||
contentTypeName = "posts"
|
contentTypeName = "posts"
|
||||||
|
|
||||||
# ["orange", "blue", "red", "green", "pink"]
|
# ["orange", "blue", "red", "green", "pink"]
|
||||||
themeColor = "orange"
|
themeColor = "orange"
|
||||||
|
|
||||||
# if you set this to 0, only submenu trigger will be visible
|
# if you set this to 0, only submenu trigger will be visible
|
||||||
showMenuItems = 2
|
showMenuItems = 2
|
||||||
|
|
||||||
# show selector to switch language
|
# show selector to switch language
|
||||||
showLanguageSelector = false
|
showLanguageSelector = false
|
||||||
|
|
||||||
# set theme to full screen width
|
# set theme to full screen width
|
||||||
fullWidthTheme = false
|
fullWidthTheme = false
|
||||||
|
|
||||||
# center theme with default width
|
# center theme with default width
|
||||||
centerTheme = false
|
centerTheme = false
|
||||||
|
|
||||||
# set a custom favicon (default is a `themeColor` square)
|
# set a custom favicon (default is a `themeColor` square)
|
||||||
# favicon = "favicon.ico"
|
# favicon = "favicon.ico"
|
||||||
# set post to show the last updated
|
# set post to show the last updated
|
||||||
# If you use git, you can set `enableGitInfo` to `true` and then post will automatically get the last updated
|
# If you use git, you can set `enableGitInfo` to `true` and then post will automatically get the last updated
|
||||||
showLastUpdated = false
|
showLastUpdated = false
|
||||||
|
|
||||||
|
# set all headings to their default size (depending on browser settings)
|
||||||
|
# it's set to `true` by default
|
||||||
|
# oneHeadingSize = false
|
||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
[languages.en]
|
[languages.en]
|
||||||
languageName = "English"
|
languageName = "English"
|
||||||
@ -166,7 +177,13 @@ If you spot any bugs, please use [Issue Tracker](https://github.com/panr/hugo-th
|
|||||||
|
|
||||||
I'd be happy to know more about you and what you are doing. If you want to share it, please make a contribution and [add your site to the list](https://github.com/panr/hugo-theme-terminal/blob/master/USERS.md)! 🤗
|
I'd be happy to know more about you and what you are doing. If you want to share it, please make a contribution and [add your site to the list](https://github.com/panr/hugo-theme-terminal/blob/master/USERS.md)! 🤗
|
||||||
|
|
||||||
## Licence
|
## Sponsoring
|
||||||
|
|
||||||
|
If you like my work and want to support the development of the project, now you can! Just:
|
||||||
|
|
||||||
|
<a href="https://www.buymeacoffee.com/panr" target="_blank"><img src="https://res.cloudinary.com/panr/image/upload/v1579374705/buymeacoffee_y6yvov.svg" alt="Buy Me A Coffee" ></a>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
Copyright © 2019 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
Copyright © 2019 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
||||||
|
|
||||||
|
7
USERS.md
7
USERS.md
@ -18,6 +18,13 @@
|
|||||||
- https://schacherbauer.dev **Markus Schacherbauer** (Student Developer)
|
- https://schacherbauer.dev **Markus Schacherbauer** (Student Developer)
|
||||||
- https://rinma.dev **Marvin Dalheimer** (Software Developer)
|
- https://rinma.dev **Marvin Dalheimer** (Software Developer)
|
||||||
- https://lunar.computer **Lunar Computer** (DevOps Engineer)
|
- https://lunar.computer **Lunar Computer** (DevOps Engineer)
|
||||||
|
- https://naxxfish.net **Chris Roberts** (Broadcast Systems Engineer)
|
||||||
|
- https://security.jtang.dev **Jonathan Tang** (Student & Software Engineer)
|
||||||
|
- https://andreacaravano.net **Andrea Caravano** (Student)
|
||||||
|
- https://dawsonverboven.com/ **Dawson Verboven** (Student & Software Developer)
|
||||||
|
- https://www.rockyourcode.com **Sophia Brandt** (tax officer and hobby coder)
|
||||||
|
- https://qbunt.com **Jeremy Bunting** (Software Engineer)
|
||||||
|
- https://smeik.org **Smeik** (Embedded Developer)
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
TEMPLATE:
|
TEMPLATE:
|
||||||
|
@ -16,7 +16,7 @@ The theme includes:
|
|||||||
|
|
||||||
- **5 duotone themes**, depending on your preferences (orange, red, blue, green, pink)
|
- **5 duotone themes**, depending on your preferences (orange, red, blue, green, pink)
|
||||||
- [**Fira Code**](https://github.com/tonsky/FiraCode) as default monospaced font. It's gorgeous!
|
- [**Fira Code**](https://github.com/tonsky/FiraCode) as default monospaced font. It's gorgeous!
|
||||||
- **realy nice, custom duotone** syntax highlighting based on [**PrismJS**](https://prismjs.com)
|
- **really nice, custom duotone** syntax highlighting based on [**PrismJS**](https://prismjs.com)
|
||||||
- mobile friendly layout
|
- mobile friendly layout
|
||||||
|
|
||||||
So, there you have it... enjoy!
|
So, there you have it... enjoy!
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<body class="">
|
<body class="">
|
||||||
{{ $container := cond $.Site.Params.FullWidthTheme "container full" (cond $.Site.Params.CenterTheme "container center" "container") }}
|
{{ $container := cond $.Site.Params.FullWidthTheme "container full" (cond $.Site.Params.CenterTheme "container center" "container") }}
|
||||||
|
|
||||||
<div class="{{- $container -}}">
|
<div class="{{- $container -}}{{- cond ($.Site.Params.oneHeadingSize | default true) " headings--one-size" "" }}">
|
||||||
|
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
|
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ .Content }}
|
{{- with .Content -}}
|
||||||
|
<div>
|
||||||
|
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML }}
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
{{ if $.Site.Params.showLastUpdated }}
|
{{ if $.Site.Params.showLastUpdated }}
|
||||||
<div class="post-lastmod">
|
<div class="post-lastmod">
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
<meta name="robots" content="noodp"/>
|
<meta name="robots" content="noodp"/>
|
||||||
<link rel="canonical" href="{{ .Permalink }}" />
|
<link rel="canonical" href="{{ .Permalink }}" />
|
||||||
|
|
||||||
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
|
|
||||||
<!-- Theme CSS -->
|
<!-- Theme CSS -->
|
||||||
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
|
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
|
||||||
{{ if (ne $.Site.Params.ThemeColor "orange") }}
|
{{ if (ne $.Site.Params.ThemeColor "orange") }}
|
||||||
|
25
layouts/shortcodes/prismjs.html
Normal file
25
layouts/shortcodes/prismjs.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{{ $inner := replaceRE "^\n" "" .Inner }}
|
||||||
|
{{ if len .Params | eq 0 }}
|
||||||
|
<pre><code>{{ $inner }}</code></pre>
|
||||||
|
{{ else }}
|
||||||
|
{{ if .IsNamedParams }}
|
||||||
|
<pre class="
|
||||||
|
{{- if .Get "lang" }}language-{{ .Get "lang" }}{{ end }}
|
||||||
|
{{- if .Get "line-numbers" }} line-numbers{{ end }}
|
||||||
|
{{- if .Get "command-line" }} command-line{{ end }}"
|
||||||
|
{{- /* line highlight plugin */ -}}
|
||||||
|
{{- if .Get "line" }} data-line="{{ .Get "line" }}"{{ end }}
|
||||||
|
{{- /* line number plugin */ -}}
|
||||||
|
{{- if .Get "start" }} data-start="{{ .Get "start" }}"{{ end }}
|
||||||
|
{{- /* command-line plugin */ -}}
|
||||||
|
{{- if .Get "user" }} data-user="{{ .Get "user" }}"{{ end }}
|
||||||
|
{{- if .Get "host" }} data-host="{{ .Get "host" }}"{{ end }}
|
||||||
|
{{- if .Get "prompt" }} data-prompt="{{ .Get "prompt" }}"{{ end }}
|
||||||
|
{{- if .Get "output" }} data-output="{{ .Get "output" }}"{{ end }}
|
||||||
|
><code {{ if .Get "lang" }}class="language-{{ .Get "lang" }}"{{ end }}
|
||||||
|
>{{ $inner }}</code></pre>
|
||||||
|
{{ else }}
|
||||||
|
<pre class="language-{{ .Get 0 }}">
|
||||||
|
<code class="language-{{ .Get 0 }}">{{ $inner }}</code></pre>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
@ -29,6 +29,8 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.headings--one-size {
|
||||||
h1,
|
h1,
|
||||||
h2,
|
h2,
|
||||||
h3,
|
h3,
|
||||||
@ -53,6 +55,7 @@ h5,
|
|||||||
h6 {
|
h6 {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@ -131,7 +134,7 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
background: transparent;
|
background: transparent !important;
|
||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
margin: 40px 0;
|
margin: 40px 0;
|
||||||
font-size: .95rem;
|
font-size: .95rem;
|
||||||
|
@ -118,3 +118,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hanchor {
|
||||||
|
color: color-mod(var(--accent) alpha(90%));
|
||||||
|
text-decoration: none;
|
||||||
|
margin-left: 10px;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1:hover a, h2:hover a, h3:hover a, h4:hover a {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
@ -6,6 +6,10 @@ https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+cli
|
|||||||
* @author Rose Pritchard
|
* @author Rose Pritchard
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--code-margin: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
code[class*="language-"],
|
code[class*="language-"],
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
background: none;
|
background: none;
|
||||||
@ -17,13 +21,7 @@ pre[class*="language-"] {
|
|||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
|
||||||
-moz-tab-size: 2;
|
|
||||||
-o-tab-size: 2;
|
|
||||||
tab-size: 2;
|
tab-size: 2;
|
||||||
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
hyphens: none;
|
hyphens: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -31,18 +29,19 @@ pre[class*="language-"] {
|
|||||||
/* Code blocks */
|
/* Code blocks */
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
:not(pre) > code[class*="language-"],
|
:not(pre) > code[class*="language-"],
|
||||||
pre[class*="language-"] {
|
pre[class*="language-"] {
|
||||||
border-radius: 8px;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inline code */
|
/* Inline code */
|
||||||
:not(pre) > code[class*="language-"] {
|
:not(pre) > code[class*="language-"] {
|
||||||
padding: .1em;
|
padding: .1em;
|
||||||
border-radius: .3em;
|
border-radius: 0;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,13 +76,8 @@ pre[class*="language-"].line-numbers > code {
|
|||||||
left: -3.8em;
|
left: -3.8em;
|
||||||
width: 3em; /* works for line-numbers below 1000 lines */
|
width: 3em; /* works for line-numbers below 1000 lines */
|
||||||
letter-spacing: -1px;
|
letter-spacing: -1px;
|
||||||
border-right: 1px solid #999;
|
border-right: 1px solid color-mod(var(--accent) blend(#999 90%) a(20%));
|
||||||
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.line-numbers-rows > span {
|
.line-numbers-rows > span {
|
||||||
@ -94,7 +88,7 @@ pre[class*="language-"].line-numbers > code {
|
|||||||
|
|
||||||
.line-numbers-rows > span:before {
|
.line-numbers-rows > span:before {
|
||||||
content: counter(linenumber);
|
content: counter(linenumber);
|
||||||
color: #999;
|
color: color-mod(var(--accent) blend(#999 90%) a(40%));
|
||||||
display: block;
|
display: block;
|
||||||
padding-right: 0.8em;
|
padding-right: 0.8em;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@ -102,19 +96,15 @@ pre[class*="language-"].line-numbers > code {
|
|||||||
|
|
||||||
.code-toolbar {
|
.code-toolbar {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 40px 0;
|
margin: var(--code-margin) 0;
|
||||||
padding: 20px 0;
|
padding: 20px;
|
||||||
border-top: 1px solid rgba(255, 255, 255, .1);
|
border: 1px solid rgba(255, 255, 255, .1);
|
||||||
border-bottom: 1px solid rgba(255, 255, 255, .1);
|
|
||||||
|
|
||||||
+ .code-toolbar {
|
|
||||||
border-top: 0;
|
|
||||||
margin-top: -40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
+ .code-toolbar,
|
||||||
+ .highlight,
|
+ .highlight,
|
||||||
+ .highlight .code-toolbar {
|
+ .highlight .code-toolbar {
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
|
margin-top: calc(-1 * var(--code-margin));
|
||||||
}
|
}
|
||||||
|
|
||||||
pre, code {
|
pre, code {
|
||||||
@ -122,14 +112,20 @@ pre[class*="language-"].line-numbers > code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
|
display: block;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.highlight + .highlight .code-toolbar {
|
||||||
|
border-top: 0;
|
||||||
|
margin-top: calc(-1 * var(--code-margin));
|
||||||
|
}
|
||||||
|
|
||||||
div.code-toolbar > .toolbar {
|
div.code-toolbar > .toolbar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: .3em;
|
top: 10px;
|
||||||
right: .2em;
|
right: 10px;
|
||||||
transition: opacity 0.3s ease-in-out;
|
transition: opacity 0.3s ease-in-out;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
@ -154,9 +150,7 @@ div.code-toolbar > .toolbar button {
|
|||||||
line-height: normal;
|
line-height: normal;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
-webkit-user-select: none; /* for button */
|
user-select: none;
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div.code-toolbar > .toolbar a,
|
div.code-toolbar > .toolbar a,
|
||||||
@ -164,11 +158,11 @@ div.code-toolbar > .toolbar button,
|
|||||||
div.code-toolbar > .toolbar span {
|
div.code-toolbar > .toolbar span {
|
||||||
color: #bbb;
|
color: #bbb;
|
||||||
font-size: .8em;
|
font-size: .8em;
|
||||||
padding: 0 .5em;
|
padding: 10px;
|
||||||
background: #f5f2f0;
|
background: #f5f2f0;
|
||||||
background: rgba(224, 224, 224, 0.2);
|
background: rgba(224, 224, 224, 0.2);
|
||||||
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
|
box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
|
||||||
border-radius: .5em;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.code-toolbar > .toolbar a:hover,
|
div.code-toolbar > .toolbar a:hover,
|
||||||
@ -177,7 +171,6 @@ div.code-toolbar > .toolbar button:hover,
|
|||||||
div.code-toolbar > .toolbar button:focus,
|
div.code-toolbar > .toolbar button:focus,
|
||||||
div.code-toolbar > .toolbar span:hover,
|
div.code-toolbar > .toolbar span:hover,
|
||||||
div.code-toolbar > .toolbar span:focus {
|
div.code-toolbar > .toolbar span:focus {
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,15 +182,10 @@ div.code-toolbar > .toolbar span:focus {
|
|||||||
letter-spacing: -1px;
|
letter-spacing: -1px;
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.command-line-prompt > span:before {
|
.command-line-prompt > span:before {
|
||||||
color: #999;
|
|
||||||
content: ' ';
|
content: ' ';
|
||||||
display: block;
|
display: block;
|
||||||
padding-right: 0.8em;
|
padding-right: 0.8em;
|
||||||
|
@ -31,7 +31,8 @@ code.language-scss,
|
|||||||
.token.property,
|
.token.property,
|
||||||
.token.function,
|
.token.function,
|
||||||
code.language-javascript,
|
code.language-javascript,
|
||||||
code.language-html {
|
code.language-html,
|
||||||
|
.command-line-prompt > span:before {
|
||||||
color: color-mod(var(--accent) blend(#999 90%));
|
color: color-mod(var(--accent) blend(#999 90%));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,18 +55,15 @@ code.language-html {
|
|||||||
|
|
||||||
pre[data-line] {
|
pre[data-line] {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 1em 0 1em 3em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.line-highlight {
|
.line-highlight {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
padding: inherit 0;
|
padding: 0;
|
||||||
margin-top: 1em;
|
margin: 0;
|
||||||
/* Same as .prism’s padding-top */
|
background: color-mod(var(--accent) blend(#999 90%) a(8%));
|
||||||
background: hsla(24, 20%, 50%, .08);
|
|
||||||
background: linear-gradient(to right, hsla(24, 20%, 50%, .1) 70%, hsla(24, 20%, 50%, 0));
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
@ -75,7 +73,7 @@ pre[data-line] {
|
|||||||
.line-highlight[data-end]:after {
|
.line-highlight[data-end]:after {
|
||||||
content: attr(data-start);
|
content: attr(data-start);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: .4em;
|
/* top: .4em; */
|
||||||
left: .6em;
|
left: .6em;
|
||||||
min-width: 1em;
|
min-width: 1em;
|
||||||
padding: 0 .5em;
|
padding: 0 .5em;
|
||||||
|
Loading…
Reference in New Issue
Block a user