Merge remote-tracking branch 'upstream/master'

This commit is contained in:
horochx 2020-03-10 22:26:40 +08:00
commit 145a758159
12 changed files with 1452 additions and 1225 deletions

View File

@ -17,6 +17,7 @@
- [How to edit the theme](#how-to-edit-the-theme)
- [How to contribute](#how-to-contribute)
- [Terminal theme user?](#terminal-theme-user)
- [Sponsoring](#sponsoring)
- [Licence](#licence)
## 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:
```
```toml
baseurl = "/"
languageCode = "en-us"
theme = "terminal"
@ -74,22 +75,32 @@ paginate = 5
[params]
# dir name of your blog content (default is `content/posts`)
contentTypeName = "posts"
# ["orange", "blue", "red", "green", "pink"]
themeColor = "orange"
# if you set this to 0, only submenu trigger will be visible
showMenuItems = 2
# show selector to switch language
showLanguageSelector = false
# set theme to full screen width
fullWidthTheme = false
# center theme with default width
centerTheme = false
# set a custom favicon (default is a `themeColor` square)
# favicon = "favicon.ico"
# 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
showLastUpdated = false
# set all headings to their default size (depending on browser settings)
# it's set to `true` by default
# oneHeadingSize = false
[languages]
[languages.en]
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)! 🤗
## 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))

View File

@ -18,6 +18,13 @@
- https://schacherbauer.dev **Markus Schacherbauer** (Student Developer)
- https://rinma.dev **Marvin Dalheimer** (Software Developer)
- 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:

View File

@ -16,7 +16,7 @@ The theme includes:
- **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!
- **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
So, there you have it... enjoy!

View File

@ -9,7 +9,7 @@
<body class="">
{{ $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" . }}

View File

@ -28,7 +28,11 @@
{{ end }}
<div class="post-content">
{{ .Content }}
{{- with .Content -}}
<div>
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">&#8983;</a> ${3}` | safeHTML }}
</div>
{{- end -}}
</div>
{{ if $.Site.Params.showLastUpdated }}
<div class="post-lastmod">

View File

@ -5,6 +5,8 @@
<meta name="robots" content="noodp"/>
<link rel="canonical" href="{{ .Permalink }}" />
{{ template "_internal/google_analytics.html" . }}
<!-- Theme CSS -->
<link rel="stylesheet" href="{{ "assets/style.css" | absURL }}">
{{ if (ne $.Site.Params.ThemeColor "orange") }}

View 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 }}

View File

@ -29,29 +29,32 @@ body {
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
.headings--one-size {
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 1.3;
&:not(first-child) {
margin-top: 40px;
}
}
}
h1,
h2,
h3 {
h1,
h2,
h3 {
font-size: 1.4rem;
}
}
h4,
h5,
h6 {
h4,
h5,
h6 {
font-size: 1.2rem;
}
}
a {
@ -131,7 +134,7 @@ code {
}
pre {
background: transparent;
background: transparent !important;
padding: 20px 10px;
margin: 40px 0;
font-size: .95rem;

View File

@ -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;
}

View File

@ -6,6 +6,10 @@ https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+cli
* @author Rose Pritchard
*/
:root {
--code-margin: 40px;
}
code[class*="language-"],
pre[class*="language-"] {
background: none;
@ -17,13 +21,7 @@ pre[class*="language-"] {
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
@ -31,18 +29,19 @@ pre[class*="language-"] {
/* Code blocks */
pre[class*="language-"] {
margin: 0;
padding: 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
border-radius: 8px;
border-radius: 0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
border-radius: 0;
white-space: normal;
}
@ -77,44 +76,35 @@ pre[class*="language-"].line-numbers > code {
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
border-right: 1px solid color-mod(var(--accent) blend(#999 90%) a(20%));
user-select: none;
}
.line-numbers-rows > span {
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
}
.line-numbers-rows > span:before {
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
color: color-mod(var(--accent) blend(#999 90%) a(40%));
display: block;
padding-right: 0.8em;
text-align: right;
}
}
.code-toolbar {
position: relative;
margin: 40px 0;
padding: 20px 0;
border-top: 1px solid rgba(255, 255, 255, .1);
border-bottom: 1px solid rgba(255, 255, 255, .1);
+ .code-toolbar {
border-top: 0;
margin-top: -40px;
}
margin: var(--code-margin) 0;
padding: 20px;
border: 1px solid rgba(255, 255, 255, .1);
+ .code-toolbar,
+ .highlight,
+ .highlight .code-toolbar {
border-top: 0;
margin-top: calc(-1 * var(--code-margin));
}
pre, code {
@ -122,14 +112,20 @@ pre[class*="language-"].line-numbers > code {
}
code {
display: block;
color: inherit;
}
}
.highlight + .highlight .code-toolbar {
border-top: 0;
margin-top: calc(-1 * var(--code-margin));
}
div.code-toolbar > .toolbar {
position: absolute;
top: .3em;
right: .2em;
top: 10px;
right: 10px;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}
@ -154,9 +150,7 @@ div.code-toolbar > .toolbar button {
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
div.code-toolbar > .toolbar a,
@ -164,11 +158,11 @@ div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
color: #bbb;
font-size: .8em;
padding: 0 .5em;
padding: 10px;
background: #f5f2f0;
background: rgba(224, 224, 224, 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,
@ -177,7 +171,6 @@ div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus,
div.code-toolbar > .toolbar span:hover,
div.code-toolbar > .toolbar span:focus {
color: inherit;
text-decoration: none;
}
@ -189,15 +182,10 @@ div.code-toolbar > .toolbar span:focus {
letter-spacing: -1px;
margin-right: 1em;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.command-line-prompt > span:before {
color: #999;
content: ' ';
display: block;
padding-right: 0.8em;

View File

@ -31,7 +31,8 @@ code.language-scss,
.token.property,
.token.function,
code.language-javascript,
code.language-html {
code.language-html,
.command-line-prompt > span:before {
color: color-mod(var(--accent) blend(#999 90%));
}
@ -54,18 +55,15 @@ code.language-html {
pre[data-line] {
position: relative;
padding: 1em 0 1em 3em;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
/* Same as .prisms padding-top */
background: hsla(24, 20%, 50%, .08);
background: linear-gradient(to right, hsla(24, 20%, 50%, .1) 70%, hsla(24, 20%, 50%, 0));
padding: 0;
margin: 0;
background: color-mod(var(--accent) blend(#999 90%) a(8%));
pointer-events: none;
line-height: inherit;
white-space: pre;
@ -75,7 +73,7 @@ pre[data-line] {
.line-highlight[data-end]:after {
content: attr(data-start);
position: absolute;
top: .4em;
/* top: .4em; */
left: .6em;
min-width: 1em;
padding: 0 .5em;

2460
yarn.lock

File diff suppressed because it is too large Load Diff