forked from mirrors/hugo-theme-terminal
Compare commits
8 Commits
v4.2.0-rc1
...
v4.2.3
Author | SHA1 | Date | |
---|---|---|---|
5a2b4c0f1f | |||
973642048a | |||
855bbc2f09 | |||
2cbfdf00f6 | |||
ba3681ca55 | |||
50d2f96b2d | |||
a2daa38408 | |||
3f87c12098 |
13
README.md
13
README.md
@ -23,6 +23,7 @@
|
|||||||
- [How to edit the theme](#how-to-edit)
|
- [How to edit the theme](#how-to-edit)
|
||||||
- [Found a bug?](#bug)
|
- [Found a bug?](#bug)
|
||||||
- [New cool idea or feature](#feature)
|
- [New cool idea or feature](#feature)
|
||||||
|
- [Support](#support)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@ -129,7 +130,7 @@ This will clone the repository directly to the `themes/terminal` directory.
|
|||||||
git submodule add -f https://github.com/panr/hugo-theme-terminal.git themes/terminal
|
git submodule add -f https://github.com/panr/hugo-theme-terminal.git themes/terminal
|
||||||
```
|
```
|
||||||
|
|
||||||
This will install the repository as a sumbodule in the `themes/terminal` directory.
|
This will install the repository as a submodule in the `themes/terminal` directory.
|
||||||
|
|
||||||
⚠️ If you encounter any issues with:
|
⚠️ If you encounter any issues with:
|
||||||
|
|
||||||
@ -159,6 +160,10 @@ languageCode = "en-us"
|
|||||||
theme = "terminal"
|
theme = "terminal"
|
||||||
pagination.pagerSize = 5
|
pagination.pagerSize = 5
|
||||||
|
|
||||||
|
# Required for Chroma and the custom syntax highlighting.
|
||||||
|
[markup.highlight]
|
||||||
|
noClasses = false
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
# dir name of your main content (default is `content/posts`).
|
# dir name of your main content (default is `content/posts`).
|
||||||
# the list of set content will show up on your index page (baseurl).
|
# the list of set content will show up on your index page (baseurl).
|
||||||
@ -303,8 +308,12 @@ This will help keeping the theme close to its roots, and also allow anyone who w
|
|||||||
|
|
||||||
Sounds OK? Cool, let's rock! 🤘
|
Sounds OK? Cool, let's rock! 🤘
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
If you like what I'm doing and want to support my work. You can do it [here](https://ko-fi.com/pan_r). Thank you! ♥️
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright © 2019-2025 Radosław Kozieł ([@panr](https://radoslawkoziel.pl/))
|
Copyright © 2019-2025 Radek Kozieł ([@panr](https://rkoziel.com/))
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
@ -14,7 +14,6 @@ a.button {
|
|||||||
padding: 8px 18px;
|
padding: 8px 18px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 8;
|
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
@ -41,13 +40,13 @@ button.link,
|
|||||||
.button.link,
|
.button.link,
|
||||||
a.button.link {
|
a.button.link {
|
||||||
background: none;
|
background: none;
|
||||||
font-size: 1rem;
|
font-size: var(--font-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
button.small,
|
button.small,
|
||||||
.button.small,
|
.button.small,
|
||||||
a.button.small {
|
a.button.small {
|
||||||
font-size: 0.8rem;
|
font-size: calc(var(--font-size) * 0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
button.wide,
|
button.wide,
|
||||||
@ -72,22 +71,6 @@ a.button.inline:hover {
|
|||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.button.inline::before {
|
|
||||||
content: "["
|
|
||||||
}
|
|
||||||
|
|
||||||
a.button.inline::after {
|
|
||||||
content: "]"
|
|
||||||
}
|
|
||||||
|
|
||||||
a.button.inline.prev::before {
|
|
||||||
content: "< ["
|
|
||||||
}
|
|
||||||
|
|
||||||
a.button.inline.next::after {
|
|
||||||
content: "] >"
|
|
||||||
}
|
|
||||||
|
|
||||||
a.read-more,
|
a.read-more,
|
||||||
a.read-more:hover,
|
a.read-more:hover,
|
||||||
a.read-more:active {
|
a.read-more:active {
|
||||||
@ -99,20 +82,3 @@ a.read-more:active {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-button {
|
|
||||||
position: relative;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 3px 8px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
text-decoration: none;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
|
|
||||||
appearance: none;
|
|
||||||
cursor: pointer;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre:not(.chroma) {
|
pre:not(.chroma) {
|
||||||
margin: 20px 0;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,11 +19,14 @@ pre code {
|
|||||||
|
|
||||||
code {
|
code {
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
|
text-size-adjust: 100%;
|
||||||
|
-ms-text-size-adjust: 100%;
|
||||||
|
-moz-text-size-adjust: 100%;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 30px;
|
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
border: 1px solid var(--code-border);
|
border: 1px solid var(--code-border);
|
||||||
}
|
}
|
||||||
@ -33,25 +35,48 @@ code {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chroma code[data-lang]:before {
|
.code-title {
|
||||||
content: attr(data-lang);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: auto;
|
|
||||||
height: 30px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
background: color-mix(in srgb, var(--foreground) 5%, transparent);
|
background: color-mix(in srgb, var(--foreground) 5%, transparent);
|
||||||
border-bottom: 1px solid var(--code-border);
|
border-bottom: 1px solid var(--code-border);
|
||||||
color: var(--comment);
|
color: var(--comment);
|
||||||
text-transform:uppercase;
|
text-transform:uppercase;
|
||||||
font-size: .8em;
|
font-size: calc(var(--font-size) * 0.8);
|
||||||
padding: 0 10px;
|
padding: 6px 10px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.copy-button {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 3px 8px;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
|
||||||
|
appearance: none;
|
||||||
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-title .copy-button {
|
||||||
|
z-index: 1;
|
||||||
|
background: color-mix(in srgb, var(--foreground) 5%, var(--background));
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-title:hover .copy-button {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-title .copy-button:hover {
|
||||||
|
background: color-mix(in srgb, var(--accent) 10%, var(--background));
|
||||||
|
}
|
||||||
|
|
||||||
.collapsable-code {
|
.collapsable-code {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -69,7 +94,7 @@ code {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
font-size: .9em;
|
font-size: calc(var(--font-size) * 0.9);
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -93,16 +118,6 @@ code {
|
|||||||
background: color-mix(in srgb, var(--accent) 10%, transparent);
|
background: color-mix(in srgb, var(--accent) 10%, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapsable-code summary::marker {
|
|
||||||
/* content: "+"; */
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.collapsable-code[open] summary::marker {
|
|
||||||
/* content: "-"; */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.collapsable-code pre {
|
.collapsable-code pre {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
@ -110,21 +125,3 @@ code {
|
|||||||
.collapsable-code pre::first-line {
|
.collapsable-code pre::first-line {
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chroma .copy-button {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
margin: .5em;
|
|
||||||
z-index: 1;
|
|
||||||
background: color-mix(in srgb, var(--foreground) 5%, var(--background));
|
|
||||||
}
|
|
||||||
|
|
||||||
.chroma:hover .copy-button {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chroma .copy-button:hover {
|
|
||||||
background: color-mix(in srgb, var(--accent) 10%, var(--background));
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
.footer {
|
.footer {
|
||||||
padding: 40px 0;
|
padding: 40px 0;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
opacity: 0.5;
|
opacity: 0.65;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer__inner {
|
.footer__inner {
|
||||||
@ -9,7 +9,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 760px;
|
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,7 +21,6 @@
|
|||||||
flex-flow: row wrap;
|
flex-flow: row wrap;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 1rem;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ html {
|
|||||||
*::before,
|
*::before,
|
||||||
*::after {
|
*::after {
|
||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@ -66,7 +67,7 @@ img,
|
|||||||
figure,
|
figure,
|
||||||
video,
|
video,
|
||||||
table {
|
table {
|
||||||
margin: calc(var(--line-height) * 1.2) 0;
|
margin: 25px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@ -163,10 +164,10 @@ select:active {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
45deg,
|
45deg,
|
||||||
transparent 50%,
|
transparent 50%,
|
||||||
var(--foreground) 50%
|
var(--foreground) 50%
|
||||||
),
|
),
|
||||||
linear-gradient(135deg, var(--foreground) 50%, transparent 50%);
|
linear-gradient(135deg, var(--foreground) 50%, transparent 50%);
|
||||||
background-position: calc(100% - 20px), calc(100% - 1em);
|
background-position: calc(100% - 20px), calc(100% - 1em);
|
||||||
background-size:
|
background-size:
|
||||||
@ -238,7 +239,7 @@ figure figcaption {
|
|||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
color: var(--background);
|
color: var(--background);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1rem;
|
font-size: var(--font-size);
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin-top: -8px;
|
margin-top: -8px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
@ -284,7 +285,7 @@ kbd {
|
|||||||
border: 1px solid var(--code-border);
|
border: 1px solid var(--code-border);
|
||||||
padding: 1px 6px;
|
padding: 1px 6px;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
font-size: 0.95rem;
|
font-size: calc(var(--font-size) * 0.95);
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd {
|
kbd {
|
||||||
@ -306,7 +307,7 @@ pre {
|
|||||||
background: color-mix(in srgb, var(--foreground) 5%, transparent) !important;
|
background: color-mix(in srgb, var(--foreground) 5%, transparent) !important;
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
font-size: 0.95rem !important;
|
font-size: calc(var(--font-size) * 0.95) !important;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
|
border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
|
||||||
@ -316,7 +317,6 @@ pre code {
|
|||||||
background: none !important;
|
background: none !important;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: inherit;
|
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,8 +416,6 @@ hr {
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
blockquote.twitter-tweet {
|
blockquote.twitter-tweet {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
@ -469,8 +467,31 @@ blockquote.twitter-tweet::before {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.__h_video {
|
.__h_video {
|
||||||
padding-bottom: 58.23% !important;
|
position: relative;
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
|
height: auto !important;
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.__h_video a {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.__h_video a img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.__h_video a .play {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe[src*="youtube.com"] {
|
iframe[src*="youtube.com"] {
|
||||||
@ -479,18 +500,13 @@ iframe[src*="youtube.com"] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 684px) {
|
@media (max-width: 684px) {
|
||||||
body {
|
:root {
|
||||||
font-size: 1rem;
|
--font-size: 0.95rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul,
|
|
||||||
ol {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
color: color-mix(in srgb var(--foreground) 30%, transparent);
|
color: color-mix(in srgb var(--foreground) 30%, transparent);
|
||||||
font-size: 0.8rem;
|
font-size: calc(var(--font-size) * 0.8);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
@ -53,7 +53,7 @@
|
|||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 1rem;
|
font-size: inherit;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
@ -63,10 +63,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
text-decoration: none;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.button__text {
|
.button__text {
|
||||||
@ -83,12 +79,6 @@
|
|||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 684px) {
|
|
||||||
.button {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
.pagination {
|
.pagination {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.index-content {
|
.index-content {
|
||||||
margin-top: 20px;
|
margin: 25px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.framed {
|
.framed {
|
||||||
@ -22,7 +22,7 @@
|
|||||||
.post {
|
.post {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 40px 0;
|
padding: 30px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post:not(:last-of-type) {
|
.post:not(:last-of-type) {
|
||||||
@ -30,9 +30,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post-meta {
|
.post-meta {
|
||||||
font-size: 1rem;
|
font-size: inherit;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
color: color-mix(in srgb, var(--foreground) 50%, transparent);
|
color: color-mix(in srgb, var(--foreground) 65%, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-meta > *:not(:first-child)::before {
|
.post-meta > *:not(:first-child)::before {
|
||||||
@ -67,7 +67,7 @@
|
|||||||
.post-tags {
|
.post-tags {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
font-size: 1rem;
|
font-size: inherit;
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,11 +76,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
margin-top: 30px;
|
margin-top: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-cover {
|
.post-cover {
|
||||||
margin: 40px 0;
|
margin: 25px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post ul {
|
.post ul {
|
||||||
|
32
assets/js/code.js
Normal file
32
assets/js/code.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
const blockcodes = document.querySelectorAll(".chroma code[data-lang]");
|
||||||
|
|
||||||
|
for (const bc of blockcodes) {
|
||||||
|
const parent = bc.parentElement;
|
||||||
|
const content = bc.innerText.split("\n").filter(Boolean).join("\n");
|
||||||
|
|
||||||
|
// Code title
|
||||||
|
const title = document.createElement("div");
|
||||||
|
const lang = bc.dataset.lang;
|
||||||
|
title.classList.add("code-title");
|
||||||
|
title.innerText = lang;
|
||||||
|
|
||||||
|
// Copy to clipboard
|
||||||
|
if (navigator.clipboard !== undefined) {
|
||||||
|
const cpbutton = document.createElement("button");
|
||||||
|
cpbutton.classList.add("copy-button");
|
||||||
|
cpbutton.innerText = "Copy";
|
||||||
|
|
||||||
|
cpbutton.addEventListener("click", () => {
|
||||||
|
cpbutton.innerText = "Copied";
|
||||||
|
setTimeout(() => {
|
||||||
|
cpbutton.innerText = "Copy";
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
navigator.clipboard.writeText(content);
|
||||||
|
});
|
||||||
|
|
||||||
|
title.append(cpbutton);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.closest(".highlight").prepend(title);
|
||||||
|
}
|
@ -1,20 +0,0 @@
|
|||||||
const blockcodes = document.querySelectorAll(".chroma code[data-lang]");
|
|
||||||
|
|
||||||
for (const bc of blockcodes) {
|
|
||||||
const parent = bc.parentElement;
|
|
||||||
const content = bc.innerText.split("\n").filter(Boolean).join("\n");
|
|
||||||
const cpbutton = document.createElement("button");
|
|
||||||
cpbutton.classList.add("copy-button");
|
|
||||||
cpbutton.innerText = "Copy";
|
|
||||||
|
|
||||||
cpbutton.addEventListener("click", () => {
|
|
||||||
cpbutton.innerText = "Copied";
|
|
||||||
setTimeout(() => {
|
|
||||||
cpbutton.innerText = "Copy";
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
navigator.clipboard.writeText(content);
|
|
||||||
});
|
|
||||||
|
|
||||||
parent.prepend(cpbutton);
|
|
||||||
}
|
|
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
{{ if not .Params.showFullContent }}
|
{{ if not .Params.showFullContent }}
|
||||||
<div>
|
<div>
|
||||||
<a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
|
<a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</article>
|
</article>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
{{ if not .Params.showFullContent }}
|
{{ if not .Params.showFullContent }}
|
||||||
<div>
|
<div>
|
||||||
<a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
|
<a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</article>
|
</article>
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<h1>Posts for: #{{ .Title }}</h1>
|
<h1>Posts for: #{{ .Title }}</h1>
|
||||||
{{ with .Content }}
|
{{ with .Content }}
|
||||||
<div class="index-content">
|
<div class="index-content">
|
||||||
{{ . }}
|
{{ . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="posts">
|
<div class="posts">
|
||||||
{{ range .Paginator.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
<article class="post on-list">
|
<article class="post on-list">
|
||||||
<h1 class="post-title">
|
<h1 class="post-title">
|
||||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
{{- if .Date -}}
|
{{- if .Date -}}
|
||||||
<time class="post-date">
|
<time class="post-date">
|
||||||
{{- .Date.Format "2006-01-02" -}}
|
{{- .Date.Format "2006-01-02" -}}
|
||||||
</time>
|
</time>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- with .Params.Author -}}
|
{{- with .Params.Author -}}
|
||||||
<span class="post-author">{{- . -}}</span>
|
<span class="post-author">{{- . -}}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if .Params.tags }}
|
{{ if .Params.tags }}
|
||||||
<span class="post-tags">
|
<span class="post-tags">
|
||||||
{{ range .Params.tags }}
|
{{ range .Params.tags }}
|
||||||
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
|
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
|
||||||
{{- . -}}
|
{{- . -}}
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ partial "cover.html" . }}
|
{{ partial "cover.html" . }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ if .Params.showFullContent }}
|
{{ if .Params.showFullContent }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
{{ else if .Description }}
|
{{ else if .Description }}
|
||||||
<p>{{ .Description | markdownify }}</p>
|
<p>{{ .Description | markdownify }}</p>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if not .Params.showFullContent }}
|
{{ if not .Params.showFullContent }}
|
||||||
<div>
|
<div>
|
||||||
<a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
|
<a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ partial "pagination.html" . }}
|
{{ partial "pagination.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{{ $menu := resources.Get "js/menu.js" | js.Build }}
|
{{ $menu := resources.Get "js/menu.js" | js.Build }}
|
||||||
{{ $cp := resources.Get "js/copy-to-clipboard.js" | js.Build }}
|
{{ $cp := resources.Get "js/code.js" | js.Build }}
|
||||||
|
|
||||||
{{ $bundle := slice $menu $cp | resources.Concat "bundle.js" | resources.Minify }}
|
{{ $bundle := slice $menu $cp | resources.Concat "bundle.js" | resources.Minify }}
|
||||||
|
|
||||||
|
@ -2,12 +2,15 @@
|
|||||||
<div class="pagination__buttons">
|
<div class="pagination__buttons">
|
||||||
{{ if .Paginator.HasPrev }}
|
{{ if .Paginator.HasPrev }}
|
||||||
<a href="{{ .Paginator.Prev.URL }}" class="button inline prev">
|
<a href="{{ .Paginator.Prev.URL }}" class="button inline prev">
|
||||||
<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>
|
< [<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>]
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if and .Paginator.HasPrev .Paginator.HasNext }}
|
||||||
|
::
|
||||||
|
{{ end }}
|
||||||
{{ if .Paginator.HasNext }}
|
{{ if .Paginator.HasNext }}
|
||||||
<a href="{{ .Paginator.Next.URL }}" class="button inline next">
|
<a href="{{ .Paginator.Next.URL }}" class="button inline next">
|
||||||
<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>
|
[<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>] >
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<div class="pagination__buttons">
|
<div class="pagination__buttons">
|
||||||
{{ if .NextInSection }}
|
{{ if .NextInSection }}
|
||||||
<a href="{{ .NextInSection.Permalink }}" class="button inline prev">
|
<a href="{{ .NextInSection.Permalink }}" class="button inline prev">
|
||||||
{{ .NextInSection.Title }}
|
< [<span class="button__text">{{ .NextInSection.Title }}</span>]
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if and .NextInSection .PrevInSection }}
|
{{ if and .NextInSection .PrevInSection }}
|
||||||
@ -15,7 +15,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .PrevInSection }}
|
{{ if .PrevInSection }}
|
||||||
<a href="{{ .PrevInSection.Permalink }}" class="button inline next">
|
<a href="{{ .PrevInSection.Permalink }}" class="button inline next">
|
||||||
{{ .PrevInSection.Title }}
|
[<span class="button__text">{{ .PrevInSection.Title }}</span>] >
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,5 +10,4 @@ min_version = 0.90
|
|||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "panr"
|
name = "panr"
|
||||||
homepage = "https://radoslawkoziel.pl"
|
homepage = "https://rkoziel.com"
|
||||||
twitter = "https://twitter.com/panr"
|
|
||||||
|
Reference in New Issue
Block a user