Compare commits
85 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7e13d24d10 | ||
|
3a5a676118 | ||
|
4a8f9aa798 | ||
|
c560d941ae | ||
|
653c3a1b7e | ||
|
bcbd22ba8a | ||
|
7926417fc8 | ||
|
52ab4d5609 | ||
|
e121cb427f | ||
|
b49a0c1ae5 | ||
|
10f6da7e8d | ||
|
3760c42316 | ||
|
8b0eca9632 | ||
|
e1f667702c | ||
|
051275fd7a | ||
|
7d877e0fcd | ||
|
4a42c4df0a | ||
|
a0c0370113 | ||
|
672ab557a4 | ||
|
70f40eb3e1 | ||
|
05bbfa3050 | ||
|
e1355294e7 | ||
|
3a9b3bffef | ||
|
ef7108798b | ||
|
3a04ec15a5 | ||
|
fb50e39b15 | ||
|
0085fc68b9 | ||
|
729543fbd1 | ||
|
823168e161 | ||
|
32df60e801 | ||
|
e76c7ebb66 | ||
|
74e7e40de1 | ||
|
9726b8d806 | ||
|
dd74597617 | ||
|
641c5a27ac | ||
|
a81c5ae24f | ||
|
1252b09ca9 | ||
|
5aac274434 | ||
|
194fc9b1c3 | ||
|
5d7c29f916 | ||
|
5e4e359e89 | ||
|
f069aede2d | ||
|
75c034ddd3 | ||
|
35e18fcf2c | ||
|
2b14b3d4e5 | ||
|
1093ce9610 | ||
|
9e657da94a | ||
|
bf0dc1643b | ||
|
3d894d14be | ||
|
415337451b | ||
|
e06649f8c8 | ||
|
de960997bc | ||
|
94d8927676 | ||
|
12d439387d | ||
|
7fa36fe0ee | ||
|
1f676558df | ||
|
985bed75ff | ||
|
893ded398f | ||
|
20fc1079fa | ||
|
1d7e65f42e | ||
|
613325cba0 | ||
|
007d7f3df6 | ||
|
5b9dff342a | ||
|
c1952eb7d5 | ||
|
0b5cc9b75f | ||
|
2654974bdd | ||
|
1e65ffdf24 | ||
|
b931e14ece | ||
|
39ba3a4ea9 | ||
|
09628b6b3d | ||
|
8b28b06e72 | ||
|
3a101141d0 | ||
|
c5febe957a | ||
|
1023b03b77 | ||
|
45dd9bd29e | ||
|
1c93397784 | ||
|
6601fd0b14 | ||
|
4a77a89ea7 | ||
|
6250dca5a0 | ||
|
4d906006aa | ||
|
c0595bfe3c | ||
|
855855cd60 | ||
|
0e14937d31 | ||
|
661243194d | ||
|
628c104026 |
@ -18,7 +18,7 @@ rules:
|
||||
- as-needed
|
||||
semi:
|
||||
- 2
|
||||
- never
|
||||
- always
|
||||
class-methods-use-this: 0
|
||||
comma-dangle:
|
||||
- 2
|
||||
@ -33,7 +33,7 @@ rules:
|
||||
func-names: 0
|
||||
quotes:
|
||||
- 2
|
||||
- single
|
||||
- double
|
||||
- allowTemplateLiterals: true
|
||||
no-underscore-dangle: 0
|
||||
object-curly-newline: 0
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -88,6 +88,6 @@ typings/
|
||||
.dynamodb/
|
||||
|
||||
# End of https://www.gitignore.io/api/node
|
||||
|
||||
public
|
||||
resources
|
||||
.hugo_build.lock
|
||||
|
@ -2,6 +2,7 @@
|
||||
"parser": "babel",
|
||||
"printWidth": 100,
|
||||
"trailingComma": "all",
|
||||
"arrowParens": "avoid",
|
||||
"overrides": [{
|
||||
"files": ".html",
|
||||
"options": {
|
||||
|
10
.stylelintrc.json
Normal file
10
.stylelintrc.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": [
|
||||
"stylelint-config-standard-scss",
|
||||
"stylelint-config-prettier-scss"
|
||||
],
|
||||
"rules": {
|
||||
"max-empty-lines": 1
|
||||
}
|
||||
}
|
||||
|
54
README.md
54
README.md
@ -1,9 +1,20 @@
|
||||
# Terminal
|
||||
|
||||
## The theme is no longer maintained, but can still be used
|
||||
|
||||
Even if the repository is archived you can still use the theme, fork it, download it, expand it, etc. Remember that each Hugo theme is a module that can be modified to match your needs. The theme is fully "open" and it depends only on the internal engines implemented in Hugo.
|
||||
|
||||
The theme brings many useful features thanks to [all people that contributed to it](https://github.com/panr/hugo-theme-terminal/graphs/contributors) (I want to thank you all!). At the time of archiving the theme has reached 9th place on the [official Hugo Themes list](https://themes.gohugo.io/). This is huge! Thanks to you!
|
||||
|
||||
----
|
||||
|
||||

|
||||
|
||||
|
||||
### DEMO - https://hugo-terminal.now.sh/
|
||||
|
||||
### ⚠️ The theme needs at least Hugo **Extended** v0.90.x.
|
||||
|
||||
---
|
||||
|
||||
- [Features](#features)
|
||||
@ -14,11 +25,11 @@
|
||||
- [How to configure](#how-to-configure)
|
||||
- [Post archetype](#post-archetype)
|
||||
- [Add-ons](#add-ons)
|
||||
- [How to (safely) edit the theme](#how-to-edit)
|
||||
- [How to edit the theme](#how-to-edit)
|
||||
- [Found a bug?](#bug)
|
||||
- [New cool idea or feature](#feature)
|
||||
- [Terminal theme user?](#terminal-theme-user)
|
||||
- [Licence](#licence)
|
||||
- [License](#license)
|
||||
|
||||
## Features
|
||||
|
||||
@ -82,11 +93,23 @@ A custom syntax highlighting based on PrismJS. All you need to do is to wrap you
|
||||
|
||||
You can download the theme manually by going to [https://github.com/panr/hugo-theme-terminal.git](https://github.com/panr/hugo-theme-terminal.git) and pasting it to `themes/terminal` in your root directory.
|
||||
|
||||
You can also choose **one of the 3 possibilities** to install the theme:
|
||||
|
||||
1. as Hugo Module
|
||||
2. as a standalone local directory
|
||||
3. as a git submodule
|
||||
|
||||
⚠️ The theme needs at least Hugo **Extended** v0.90.x.
|
||||
|
||||
### Install theme as Hugo Module
|
||||
|
||||
```bash
|
||||
hugo mod init github.com/panr/hugo-theme-terminal
|
||||
hugo mod get github.com/panr/hugo-theme-terminal
|
||||
# If this is the first time you're using Hugo Modules
|
||||
# in your project. You have to initiate your own module before
|
||||
# you fetch the theme module.
|
||||
#
|
||||
# hugo mod init [your website/module name]
|
||||
hugo mod get github.com/panr/hugo-theme-terminal/v3
|
||||
```
|
||||
|
||||
and in your config file add:
|
||||
@ -96,14 +119,7 @@ and in your config file add:
|
||||
# this is needed when you fetch the theme as a submodule to your repo.
|
||||
# replacements = "github.com/panr/hugo-theme-terminal -> themes/terminal"
|
||||
[[module.imports]]
|
||||
path = 'github.com/panr/hugo-theme-terminal'
|
||||
```
|
||||
|
||||
and also remove reference to the theme (since Hugo Module don't need it):
|
||||
|
||||
```toml
|
||||
# REMOVE OR COMMENT THIS LINE
|
||||
theme = "terminal"
|
||||
path = 'github.com/panr/hugo-theme-terminal/v3'
|
||||
```
|
||||
|
||||
Keep in mind that the theme by default won't show up in the `themes` directory. This means that you are using the theme as it was on the repository at the moment you fetched it. Your local `go.sum` file keeps all the references. Read more about Hugo Modules in the [official documentation](https://gohugo.io/hugo-modules/).
|
||||
@ -124,12 +140,16 @@ git submodule add -f https://github.com/panr/hugo-theme-terminal.git themes/term
|
||||
|
||||
This will install the repository as a sumbodule in the `themes/terminal` directory.
|
||||
|
||||
⚠️ **The theme needs at least Hugo version 0.90.x**.
|
||||
⚠️ If you encounter any issues with:
|
||||
|
||||
```bash
|
||||
Error: module "terminal" not found; either add it as a Hugo Module or store it in "[...your custom path]/themes".: module does not exist
|
||||
```
|
||||
|
||||
then please try to remove `theme = "terminal"` from your config file.
|
||||
|
||||
## How to run your site
|
||||
|
||||
If you installed all needed `npm` dependencies, then you can run:
|
||||
|
||||
```bash
|
||||
hugo server -t terminal
|
||||
```
|
||||
@ -143,6 +163,8 @@ The theme doesn't require any advanced configuration. Just copy:
|
||||
```toml
|
||||
baseurl = "/"
|
||||
languageCode = "en-us"
|
||||
# Add it only if you keep the theme in the `themes` directory.
|
||||
# Remove it if you use the theme as a remote Hugo Module.
|
||||
theme = "terminal"
|
||||
paginate = 5
|
||||
|
||||
@ -218,6 +240,8 @@ paginate = 5
|
||||
olderPosts = "Older posts"
|
||||
missingContentMessage = "Page not found..."
|
||||
missingBackButtonLabel = "Back to home page"
|
||||
minuteReadingTime = "min read"
|
||||
words = "words"
|
||||
|
||||
[languages.en.params.logo]
|
||||
logoText = "Terminal"
|
||||
|
25
USERS.md
25
USERS.md
@ -1,27 +1,20 @@
|
||||
# Meet the users of Terminal theme!
|
||||
|
||||
- https://xicode.se **magistern** (Teacher)
|
||||
- https://devmaster64.com **devmaster64** (Software Developer)
|
||||
- https://mickie1.gitlab.io/blog/ **mickie** (Engineer)
|
||||
- https://calloc.net **Vaibhav Yenamandra** (Software Engineer)
|
||||
- https://potatofrom.space **Kevin Liu** (Software)
|
||||
- https://horochx.org **horochx** (Software Developer)
|
||||
- https://feng.si **Si Feng** (Software Engineer)
|
||||
- https://ben-on-vms.com **Benedikt Frenzel** (Technical Support Engineer)
|
||||
- https://johngazzini.com **John Gazzini** (Software Engineer)
|
||||
- https://geekx.tech/ **Sagar Ladla** (Student Developer & Cyber Security Specialist)
|
||||
- https://tears.io/ **Alex** (SRE)
|
||||
- https://ayushkarn.me/ **Ayush Karn** (Student Developer)
|
||||
- https://ssgram.dev **Ramaseshan Parthasarathy** (Software Developer)
|
||||
- https://zaine.me **Amine Zaine** (Cloud Engineer)
|
||||
- https://notes.dmaitre.phyip3.dur.ac.uk/computing-club/ **Ryan Moodie** (Physics PhD student)
|
||||
- https://thecodecousins.com **Stanley Nguyen** (Software Engineer) & **Hoang Do** (Software & IoT Engineer)
|
||||
- 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://qbunt.com **Jeremy Bunting** (Software Engineer)
|
||||
- https://smeik.org **Smeik** (Embedded Developer)
|
||||
- https://code.willstocks.co.uk **Will Stocks** (Blogger & Developer)
|
||||
@ -30,12 +23,9 @@
|
||||
- https://bgameiro.me/ **Bernardo Gameiro** (Engineer Physicist student)
|
||||
- https://return-to-libc.com/ **elraro** (Cyber Security Specialist)
|
||||
- https://pablart.com/ **Pablo Diaz-Gutierrez** (Software Engineer, General Tinkerer)
|
||||
- https://waterloos.niflheimr.blue/ **cindrmon** (Student and Aspiring Software Engineer)
|
||||
- https://monocle.rpod.club/ **classx** (DevOps Engineer)
|
||||
- https://wjdevschool.com/ **Wojciech Bogócki** (Making Things & Teaching / W&J Dev School)
|
||||
- https://dongzhi.me **Joe** (Software Developer)
|
||||
- https://erisianrite.com/ **ErisianRite** (Coding, Engineering, Tools for Thought)
|
||||
- https://isaes.com.tr/ **Isa Es** (Software Engineer)
|
||||
- https://conight.com **Conight Wang** (Software Engineer)
|
||||
- https://blog.m5e.de/ **Christoph Miksche** (Software Developer)
|
||||
- https://mpostument.com/ **Maksym Postument** (DevOps Engineer)
|
||||
- https://mathiejosh.xyz **Josh Mathie** (Electrical Engineering Technology Student/Sales and Engineering Tech)
|
||||
@ -43,8 +33,6 @@
|
||||
- https://blog.puvvadi.me **KD Puvvadi** (Software Dev & Cloud Orchestrator)
|
||||
- https://hidden.land/ **Louisload** (Game Developer & Musician)
|
||||
- https://linuxbase.nl **Michael Trip** (DevOps Engineer)
|
||||
- https://markopolo123.github.io **Markopolo** (DevOps Engineer)
|
||||
- https://openfoxblog.leven.dev/ **Damon Leven** (Student & Software Developer)
|
||||
- https://blog.sethforprivacy.com **Seth For Privacy** (Security, privacy, and cryptocurrency writer, podcaster)
|
||||
- https://thesprawl.city **crish** (Software and stuff)
|
||||
- https://justinnuwin.com **Justin Nguyen** (Software & Hardware Developer)
|
||||
@ -54,16 +42,20 @@
|
||||
- https://biplav.xyz **Biplav's Blog** (Student)
|
||||
- https://santiago.wtf **Nicholas Santiago** (DevOps Engineer)
|
||||
- https://2200g.github.io/ **2200g** (Blogger/Student)
|
||||
- https://cristiioan.me **Cristian Margine** (Student)
|
||||
- https://they.mint.lgbt **Joey Aliaga** (Software Developer & Student)
|
||||
- https://tatewilhelm.me **Tate Wilhelm** (Student, Programmer & Tinkerer)
|
||||
- https://mikefoden.com **Mike Foden** (Software Developer)
|
||||
- https://undemalum.github.io/portfolio/ **Mateusz Konat** (Student)
|
||||
- https://ku0hn.radio **Ben Kuhn** (Ham Radio Operator, InfoSec Engineer, Tinkerer)
|
||||
- https://bg117.xyz/projects **bg117** (Student and Hobby Programmer)
|
||||
- https://www.grumpymetalguy.com **GrumpyMetalGuy** (General Grumper and Developer)
|
||||
- https://blog.jontes.page **Jonte** (general tech geek)
|
||||
- https://nazdarthegame.com/ **Michal Skoula** (Software Developer)
|
||||
- https://1mup.myorange.house **Antonio Garosi** (Street art gallery)
|
||||
- https://kitchvx.github.io **Nathan Kitching** (IT Student)
|
||||
- https://dgood.win **Dom Goodwin** (Platform Engineer)
|
||||
- https://sir-photch.xyz **Sir-Photch** (ComSci-student. German Blog)
|
||||
- https://drewmorris.info **Drew Morris** (Mathematician && Computer Scientist)
|
||||
- https://blog.darkiiiiiice.com **MarioMang** (Software Developer)
|
||||
|
||||
<!--
|
||||
TEMPLATE:
|
||||
@ -71,3 +63,4 @@
|
||||
- https://radoslawkoziel.pl **Radek Kozieł** (Software Designer and Developer)
|
||||
|
||||
-->
|
||||
|
||||
|
@ -12,12 +12,13 @@ a.button {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 18px;
|
||||
margin-bottom: 5px;
|
||||
margin: 5px 0;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
border-radius: 0;
|
||||
border-radius: 8;
|
||||
border: 1px solid $accent;
|
||||
background: $accent;
|
||||
color: $background;
|
||||
font: inherit;
|
||||
font-weight: bold;
|
||||
appearance: none;
|
||||
@ -25,7 +26,7 @@ a.button {
|
||||
outline: none;
|
||||
|
||||
&:hover {
|
||||
background: opacify($accent, .9);
|
||||
background: transparentize($accent, .1);
|
||||
}
|
||||
|
||||
/* variants */
|
||||
|
@ -4,7 +4,6 @@
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("../fonts/FiraCode-Regular.woff") format("woff");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
@ -13,5 +12,4 @@
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
src: url("../fonts/FiraCode-Bold.woff") format("woff");
|
||||
font-display: swap;
|
||||
}
|
||||
|
@ -22,9 +22,11 @@
|
||||
|
||||
.copyright {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-flow: row wrap;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
font-size: 1rem;
|
||||
justify-content: center;
|
||||
|
||||
&--user {
|
||||
margin: auto;
|
||||
@ -33,17 +35,10 @@
|
||||
|
||||
& > *:first-child:not(:only-child) {
|
||||
margin-right: 10px;
|
||||
|
||||
@media ($tablet) {
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media ($tablet) {
|
||||
flex-direction: column;
|
||||
margin-top: 10px;
|
||||
span {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ input, textarea, select {
|
||||
border: 1px solid $accent;
|
||||
border-radius: 0;
|
||||
padding: 10px;
|
||||
margin: 5px 0;
|
||||
font: inherit;
|
||||
appearance: none;
|
||||
|
||||
@ -26,5 +27,17 @@ select {
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
color: color-mod($accent) a(50%);
|
||||
color: transparentize($accent, .5);
|
||||
}
|
||||
|
||||
input {
|
||||
&[type="checkbox"] {
|
||||
vertical-align: middle;
|
||||
padding: 10px;
|
||||
box-shadow: inset 0 0 0 3px $background;
|
||||
|
||||
&:checked {
|
||||
background: $accent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,3 @@
|
||||
@mixin menu {
|
||||
$shadow-color: opacify($background, .8);
|
||||
$shadow: 0 10px $shadow-color, -10px 10px $shadow-color, 10px 10px $shadow-color;
|
||||
position: absolute;
|
||||
background: $background;
|
||||
box-shadow: $shadow;
|
||||
color: white;
|
||||
border: 2px solid;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
list-style: none;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -45,128 +31,4 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.menu {
|
||||
margin: 20px 1px;
|
||||
|
||||
@media ($phone) {
|
||||
@include menu;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
|
||||
&.hidden-on-mobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__inner {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
&--desktop {
|
||||
@media ($phone) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&--mobile {
|
||||
display: none;
|
||||
|
||||
@media ($phone) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
&:not(:last-of-type) {
|
||||
margin-right: 20px;
|
||||
margin-bottom: 10px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media ($phone) {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__sub-inner {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
&:not(:only-child) {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
&-more {
|
||||
@include menu;
|
||||
top: 35px;
|
||||
left: 0;
|
||||
|
||||
&-trigger {
|
||||
color: $accent;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.language-selector {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
|
||||
&-current {
|
||||
list-style-type: none;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
color: $accent;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&__more {
|
||||
@include menu;
|
||||
top: 35px;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-trigger {
|
||||
display: none;
|
||||
color: $accent;
|
||||
border: 2px solid;
|
||||
margin-left: 10px;
|
||||
height: 100%;
|
||||
padding: 3px 8px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
@media ($phone) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ figure {
|
||||
code, kbd {
|
||||
font-family: 'Fira Code', Monaco, Consolas, Ubuntu Mono, monospace !important;
|
||||
font-feature-settings: normal;
|
||||
background: color-mod($accent) a(20%);
|
||||
background: transparentize($accent, .8);
|
||||
color: $accent;
|
||||
padding: 1px 6px;
|
||||
margin: 0 2px;
|
||||
@ -203,7 +203,7 @@ blockquote {
|
||||
|
||||
&.twitter-tweet {
|
||||
position: relative;
|
||||
background: color-mod($accent) a(10%);
|
||||
background: transparentize($accent, .9);
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
border: 1px solid $accent;
|
||||
@ -263,28 +263,28 @@ ol {
|
||||
list-style: none;
|
||||
counter-reset: li;
|
||||
|
||||
li {
|
||||
> li {
|
||||
counter-increment: li;
|
||||
}
|
||||
|
||||
li:before {
|
||||
content: counter(li);
|
||||
position: absolute;
|
||||
right: calc(100% + 10px);
|
||||
color: $accent;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
ol {
|
||||
margin-left: 38px;
|
||||
|
||||
li {
|
||||
counter-increment: li;
|
||||
&:before {
|
||||
content: counter(li);
|
||||
position: absolute;
|
||||
right: calc(100% + 10px);
|
||||
color: $accent;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
li:before {
|
||||
content: counters(li, ".") " ";
|
||||
> ol {
|
||||
margin-left: 38px;
|
||||
|
||||
> li {
|
||||
counter-increment: li;
|
||||
|
||||
&:before {
|
||||
content: counters(li, ".") " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
157
assets/css/menu.scss
Normal file
157
assets/css/menu.scss
Normal file
@ -0,0 +1,157 @@
|
||||
@mixin menu {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
$shadow-color: transparentize($background, .2);
|
||||
$shadow: 0 10px $shadow-color, -10px 10px $shadow-color, 10px 10px $shadow-color;
|
||||
position: absolute;
|
||||
background: $background;
|
||||
box-shadow: $shadow;
|
||||
color: white;
|
||||
border: 2px solid;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
top: 10px;
|
||||
left: 0;
|
||||
list-style: none;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
@mixin header-menu-trigger {
|
||||
color: $accent;
|
||||
border: 2px solid;
|
||||
margin-left: 10px;
|
||||
height: 100%;
|
||||
padding: 3px 8px;
|
||||
margin-bottom: 0 !important;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.navigation-menu {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
margin: 20px 1px;
|
||||
|
||||
@media ($phone) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&__inner {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
> li {
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 10px;
|
||||
white-space: nowrap;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media ($phone) {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex-grow: 1 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
&__trigger {
|
||||
margin-right: 0 !important;
|
||||
color: $accent;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&__dropdown {
|
||||
@include menu;
|
||||
|
||||
.open & {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
> li {
|
||||
flex: 0 0 auto;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&--desktop {
|
||||
@media ($phone) {
|
||||
display: none
|
||||
}
|
||||
}
|
||||
|
||||
&--mobile {
|
||||
.menu__trigger {
|
||||
@include header-menu-trigger;
|
||||
display: none;
|
||||
|
||||
@media ($phone) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.menu__dropdown {
|
||||
@media ($phone) {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
flex: 0 0 auto;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&--language-selector {
|
||||
.menu__trigger {
|
||||
@include header-menu-trigger;
|
||||
|
||||
@media ($phone) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.menu__dropdown {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -15,7 +15,8 @@
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
padding: 5px 10px;
|
||||
background: mix($accent, #1D1E28, 98%);
|
||||
background: $background;
|
||||
color: transparentize($color, .7);
|
||||
font-size: .8rem;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
@ -37,6 +38,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-flow: row wrap;
|
||||
gap: 10px;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
@ -47,22 +50,20 @@
|
||||
.button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1rem;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
overflow: hidden;
|
||||
|
||||
+ .button {
|
||||
margin-left: 10px;
|
||||
@media($phone) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
padding: 8px 16px;
|
||||
text-decoration: none;
|
||||
text-overflow: ellipsis;
|
||||
|
@ -32,7 +32,15 @@
|
||||
&-meta {
|
||||
font-size: 1rem;
|
||||
margin-bottom: 10px;
|
||||
color: opcift($accent, 70%);
|
||||
color: transparentize($accent, .3);
|
||||
|
||||
& > *:not(:first-child) {
|
||||
&::before {
|
||||
content: "::";
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-title {
|
||||
@ -113,7 +121,7 @@
|
||||
}
|
||||
|
||||
.hanchor {
|
||||
color: opacify($accent, .9);
|
||||
color: transparentize($accent, .1);
|
||||
text-decoration: none;
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
@ -124,5 +132,5 @@ h1:hover a, h2:hover a, h3:hover a, h4:hover a {
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
color: opacify($color, .5);
|
||||
color: transparentize($color, .5);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
@import "form";
|
||||
|
||||
@import "header";
|
||||
@import "menu";
|
||||
@import "logo";
|
||||
@import "main";
|
||||
@import "post";
|
||||
|
@ -34,7 +34,7 @@ code.language-scss,
|
||||
.token.class-name,
|
||||
.token.constant,
|
||||
.token.symbol {
|
||||
color: opacify($accent, .7) !important;
|
||||
color: transparentize($accent, .3) !important;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
@ -80,7 +80,7 @@ pre[class*="language-"] {
|
||||
right: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: opacify(mix($accent, #999, 90%), .08);
|
||||
background: transparentize(mix($accent, #999, 90%), .92);
|
||||
pointer-events: none;
|
||||
line-height: inherit;
|
||||
white-space: pre;
|
||||
|
@ -1,9 +1,22 @@
|
||||
.terms {
|
||||
h1 {
|
||||
color: $accent;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: initial;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
a {
|
||||
color: $accent;
|
||||
}
|
||||
}
|
||||
|
||||
li:not(:empty):before {
|
||||
content: '-';
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
color: $accent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,5 @@ $color: white;
|
||||
$border-color: rgba(255, 255, 255, .1);
|
||||
|
||||
/* MEDIA QUERIES */
|
||||
$phone: (max-width: 684px);
|
||||
$tablet: (max-width: 900px);
|
||||
|
||||
/* variables for js, must be the same as these in @custom-media queries */
|
||||
:root {
|
||||
--phoneWidth: (max-width: 684px);
|
||||
--tabletWidth: (max-width: 900px);
|
||||
}
|
||||
$phone: "max-width: 684px";
|
||||
$tablet: "max-width: 900px";
|
||||
|
@ -1,23 +0,0 @@
|
||||
const mobileQuery = getComputedStyle(document.body).getPropertyValue("--phoneWidth");
|
||||
const isMobile = () => window.matchMedia(mobileQuery).matches;
|
||||
|
||||
const languageSelector = document.querySelector(".language-selector-current");
|
||||
const moreLanguagesContainer = document.querySelector(".language-selector__more");
|
||||
|
||||
document.body.addEventListener("click", () => {
|
||||
if (
|
||||
!isMobile() &&
|
||||
moreLanguagesContainer &&
|
||||
!moreLanguagesContainer.classList.contains("hidden")
|
||||
) {
|
||||
moreLanguagesContainer.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
languageSelector &&
|
||||
languageSelector.addEventListener("click", (e) => {
|
||||
if (!isMobile()) {
|
||||
e.stopPropagation();
|
||||
moreLanguagesContainer.classList.toggle("hidden");
|
||||
}
|
||||
});
|
@ -1,49 +1,44 @@
|
||||
const container = document.querySelector(".container");
|
||||
const menu = document.querySelector(".menu");
|
||||
const mobileMenuTrigger = document.querySelector(".menu-trigger");
|
||||
const desktopMenu = document.querySelector(".menu__inner--desktop");
|
||||
const desktopMenuTrigger = document.querySelector(".menu__sub-inner-more-trigger");
|
||||
const menuMore = document.querySelector(".menu__sub-inner-more");
|
||||
const mobileQuery = getComputedStyle(document.body).getPropertyValue("--phoneWidth");
|
||||
const isMobile = () => window.matchMedia(mobileQuery).matches;
|
||||
const handleMenuClasses = () => {
|
||||
menuMore && menuMore.classList.toggle("hidden-on-mobile", !isMobile());
|
||||
};
|
||||
|
||||
// Common
|
||||
|
||||
menu && menu.addEventListener("click", (e) => e.stopPropagation());
|
||||
menuMore && menuMore.addEventListener("click", (e) => e.stopPropagation());
|
||||
|
||||
// handleMenuClasses();
|
||||
const allMenus = document.querySelectorAll(".menu");
|
||||
|
||||
// Hide menus on body click
|
||||
document.body.addEventListener("click", () => {
|
||||
if (!isMobile() && menuMore && !menuMore.classList.contains("hidden")) {
|
||||
menuMore.classList.add("hidden");
|
||||
} else if (isMobile() && !menu.classList.contains("hidden")) {
|
||||
menu.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("resize", handleMenuClasses);
|
||||
|
||||
// Mobile menu
|
||||
|
||||
mobileMenuTrigger &&
|
||||
mobileMenuTrigger.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
menu && menu.classList.toggle("hidden-on-mobile");
|
||||
});
|
||||
|
||||
// Desktop menu
|
||||
|
||||
desktopMenuTrigger &&
|
||||
desktopMenuTrigger.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
menuMore && menuMore.classList.toggle("hidden");
|
||||
|
||||
if (menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {
|
||||
menuMore.style.left = "auto";
|
||||
menuMore.style.right = 0;
|
||||
allMenus.forEach(menu => {
|
||||
if (menu.classList.contains("open")) {
|
||||
menu.classList.remove("open");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Reset menus on resize
|
||||
window.addEventListener("resize", () => {
|
||||
allMenus.forEach(menu => {
|
||||
menu.classList.remove("open");
|
||||
});
|
||||
});
|
||||
|
||||
// Handle desktop menu
|
||||
allMenus.forEach(menu => {
|
||||
const trigger = menu.querySelector(".menu__trigger");
|
||||
const dropdown = menu.querySelector(".menu__dropdown");
|
||||
|
||||
trigger.addEventListener("click", e => {
|
||||
e.stopPropagation();
|
||||
|
||||
if (menu.classList.contains("open")) {
|
||||
menu.classList.remove("open");
|
||||
} else {
|
||||
// Close all menus...
|
||||
allMenus.forEach(m => m.classList.remove("open"));
|
||||
// ...before opening the current one
|
||||
menu.classList.add("open");
|
||||
}
|
||||
|
||||
if (dropdown.getBoundingClientRect().right > container.getBoundingClientRect().right) {
|
||||
dropdown.style.left = "auto";
|
||||
dropdown.style.right = 0;
|
||||
}
|
||||
});
|
||||
|
||||
dropdown.addEventListener("click", e => e.stopPropagation());
|
||||
});
|
||||
|
@ -0,0 +1,4 @@
|
||||
[module]
|
||||
[module.hugoVersion]
|
||||
extended = true
|
||||
min = '0.90.0'
|
4
go.mod
4
go.mod
@ -1,3 +1,3 @@
|
||||
module github.com/panr/hugo-theme-terminal
|
||||
module github.com/panr/hugo-theme-terminal/v3
|
||||
|
||||
go 1.16
|
||||
go 1.19
|
||||
|
@ -21,14 +21,14 @@
|
||||
</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
{{ with .Date }}
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{ .Format "2006-01-02" }}
|
||||
{{- .Date.Format "2006-01-02" -}}
|
||||
</time>
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author">:: {{ . }}</span>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- with .Params.Author -}}
|
||||
<span class="post-author">{{ . }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
@ -49,7 +49,7 @@
|
||||
{{ else if .Description }}
|
||||
{{ .Description | markdownify }}
|
||||
{{ else }}
|
||||
{{ .Summary | markdownify }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
@ -11,14 +11,14 @@
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-meta">
|
||||
{{ with .Date }}
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{ .Format "2006-01-02" }} ::
|
||||
{{- .Date.Format "2006-01-02" -}}
|
||||
</time>
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
<span class="post-author">{{ . }}</span>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- with .Params.Author -}}
|
||||
<span class="post-author">{{- . -}}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
@ -39,7 +39,7 @@
|
||||
{{ else if .Description }}
|
||||
{{ .Description | markdownify }}
|
||||
{{ else }}
|
||||
{{ .Summary | markdownify }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
@ -4,20 +4,20 @@
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-meta">
|
||||
{{ with .Date }}
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{ .Format "2006-01-02" }} ::
|
||||
{{ if $.Site.Params.showLastUpdated }}
|
||||
[{{or $.Site.Params.updatedDatePrefix "Updated"}} :: {{ .Lastmod.Format "2006-01-02" }}]
|
||||
{{ end }}
|
||||
{{- .Date.Format "2006-01-02" -}}
|
||||
{{- if $.Site.Params.showLastUpdated -}}
|
||||
[{{- or $.Site.Params.updatedDatePrefix "Updated" -}} :: {{- .Lastmod.Format "2006-01-02" -}}]
|
||||
{{- end -}}
|
||||
</time>
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}
|
||||
{{- end -}}
|
||||
{{- with .Params.Author -}}
|
||||
<span class="post-author">{{ . }}</span>
|
||||
{{ end }}
|
||||
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
|
||||
<span class="post-reading-time">:: {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
|
||||
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
|
57
layouts/_default/term.html
Normal file
57
layouts/_default/term.html
Normal file
@ -0,0 +1,57 @@
|
||||
{{ define "main" }}
|
||||
<h1>Posts for: #{{ .Title }}</h1>
|
||||
{{ with .Content }}
|
||||
<div class="index-content">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
<article class="post on-list">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h1>
|
||||
<div class="post-meta">
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{- .Date.Format "2006-01-02" -}}
|
||||
</time>
|
||||
{{- end -}}
|
||||
{{- with .Params.Author -}}
|
||||
<span class="post-author">{{- . -}}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<span class="post-tags">
|
||||
{{ range .Params.tags }}
|
||||
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
|
||||
{{- . -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "cover.html" . }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.showFullContent }}
|
||||
{{ .Content }}
|
||||
{{ else if .Description }}
|
||||
{{ .Description | markdownify }}
|
||||
{{ else }}
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if not .Params.showFullContent }}
|
||||
<div>
|
||||
<a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
@ -1,6 +1,11 @@
|
||||
{{ define "main" }}
|
||||
<div class="terms">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Content }}
|
||||
<div class="index-content">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<ul>
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
@ -8,7 +13,7 @@
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li>
|
||||
<a class="terms-title" href="{{ .Permalink }}">{{ .Name }} ({{ $count }})</a>
|
||||
<a class="terms-title" href="{{ .Permalink }}">{{ .Name }} [{{ $count }}]</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -5,18 +5,17 @@
|
||||
<span>{{ $.Site.Copyright | safeHTML }}</span>
|
||||
{{ else }}
|
||||
<div class="copyright">
|
||||
<span>© {{ now.Year }} Powered by <a href="http://gohugo.io">Hugo</a></span>
|
||||
<span>© {{ now.Year }} Powered by <a href="https://gohugo.io">Hugo</a></span>
|
||||
{{ end }}
|
||||
<span>:: Theme made by <a href="https://twitter.com/panr">panr</a></span>
|
||||
<span>:: <a href="https://github.com/panr/hugo-theme-terminal" target="_blank">Theme</a> made by <a href="https://github.com/panr" target="_blank">panr</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{{ $menu := resources.Get "js/menu.js" | js.Build }}
|
||||
{{ $languageSelector := resources.Get "js/languageSelector.js" | js.Build }}
|
||||
{{ $prism := resources.Get "js/prism.js" | js.Build }}
|
||||
|
||||
{{ $bundle := slice $menu $languageSelector $prism | resources.Concat "bundle.js" | resources.Minify }}
|
||||
{{ $bundle := slice $menu $prism | resources.Concat "bundle.js" | resources.Minify }}
|
||||
|
||||
<script type="text/javascript" src="{{ $bundle.RelPermalink }}"></script>
|
||||
|
||||
|
@ -2,30 +2,36 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta name="keywords" content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}" />
|
||||
<meta name="robots" content="noodp" />
|
||||
{{ if .Params.noindex }}
|
||||
{{ if or (eq (.Param "noindex") true) (eq (.Param "noindex") "true") }}
|
||||
<meta name="robots" content="noindex" />
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<meta name="robots" content="noodp" />
|
||||
{{ end }}
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
{{ $defaultStyles := resources.Get "css/style.scss" }}
|
||||
<!-- Local Theme Variables -->
|
||||
{{ if (isset .Params "color") }}
|
||||
{{ if and (isset .Params "color") (not (eq .Params.color "")) }}
|
||||
{{ $localColorCss := resources.Get (printf "css/color/%s.scss" .Params.color) }}
|
||||
{{ $localCss := slice $localColorCss $defaultStyles | resources.Concat (printf "css/%s-local.scss" .Params.color) }}
|
||||
{{ $localColorStyles := $localCss | resources.ToCSS }}
|
||||
<link rel="stylesheet" href="{{ $localColorStyles.RelPermalink }}">
|
||||
<link rel="stylesheet" href="{{ $localColorStyles.Permalink }}">
|
||||
{{ else }}
|
||||
<!-- Theme Variables -->
|
||||
{{ $colorCss := resources.Get (printf "css/color/%s.scss" ($.Site.Params.ThemeColor | default "orange")) }}
|
||||
{{ $css := slice $colorCss $defaultStyles | resources.Concat "css/base.scss" }}
|
||||
{{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" true "precision" 6 "includePaths" (slice "node_modules")) }}
|
||||
{{ $options := (dict "targetPath" "styles.css" "outputStyle" "compressed" "enableSourceMap" true "precision" 6 "includePaths" (slice "node_modules")) }}
|
||||
{{ $styles := $css | resources.ToCSS $options }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}">
|
||||
<link rel="stylesheet" href="{{ $styles.Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
<!-- Custom CSS to override theme properties (/static/style.scss) -->
|
||||
{{ if (fileExists "static/style.scss") -}}
|
||||
<link rel="stylesheet" href="{{ "style.scss" | absURL }}">
|
||||
<!-- Custom CSS to override theme properties (/static/style.css) -->
|
||||
{{ if (fileExists "static/style.css") -}}
|
||||
<link rel="stylesheet" href="{{ "style.css" | absURL }}">
|
||||
{{- end }}
|
||||
|
||||
<!-- Icons -->
|
||||
@ -52,8 +58,12 @@
|
||||
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else if .Description}}{{ .Description | plainify }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:site_name" content="{{ $.Site.Title }}" />
|
||||
{{ if and (not .IsHome) (isset .Params "cover") }}
|
||||
<meta property="og:image" content="{{ .Param "cover" | absURL }}">
|
||||
{{ if (isset .Params "cover") }}
|
||||
{{ $pageCover := .Param "cover" }}
|
||||
{{ with (.Resources.GetMatch (.Param "cover")) }}
|
||||
{{ $pageCover = .RelPermalink }}
|
||||
{{ end }}
|
||||
<meta property="og:image" content="{{ $pageCover | absURL }}">
|
||||
{{ else }}
|
||||
{{ if isset $.Site.Params "favicon" }}
|
||||
<meta property="og:image" content="{{ $.Site.Params.favicon | absURL }}">
|
||||
@ -61,8 +71,8 @@
|
||||
<meta property="og:image" content="{{ printf "img/favicon/%s.png" $.Site.Params.ThemeColor | absURL }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<meta property="og:image:width" content="2048">
|
||||
<meta property="og:image:height" content="1024">
|
||||
<meta property="og:image:width" content="1200">
|
||||
<meta property="og:image:height" content="627">
|
||||
{{ range .Params.categories }}
|
||||
<meta property="article:section" content="{{ . }}" />
|
||||
{{ end }}
|
||||
|
@ -4,7 +4,10 @@
|
||||
{{ partial "logo.html" . }}
|
||||
</div>
|
||||
{{ if len $.Site.Menus }}
|
||||
<div class="menu-trigger">menu</div>
|
||||
{{ partial "mobile-menu.html" . }}
|
||||
{{ end }}
|
||||
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
||||
{{ partial "language-menu.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if len $.Site.Menus }}
|
||||
|
10
layouts/partials/language-menu.html
Normal file
10
layouts/partials/language-menu.html
Normal file
@ -0,0 +1,10 @@
|
||||
<ul class="menu menu--desktop menu--language-selector">
|
||||
<li class="menu__trigger">{{ .Language.LanguageName }} ▾</li>
|
||||
<li>
|
||||
<ul class="menu__dropdown">
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
@ -1,60 +1,33 @@
|
||||
<nav class="menu hidden-on-mobile">
|
||||
<ul class="menu__inner menu__inner--desktop">
|
||||
<nav class="navigation-menu">
|
||||
<ul class="navigation-menu__inner menu--desktop">
|
||||
{{ if or $.Site.Params.showMenuItems ( eq .Site.Params.showMenuItems 0 ) }}
|
||||
{{ range first $.Site.Params.showMenuItems $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
<li><a href="{{ .URL }}" {{ if .Params.NewTab -}} target="_blank" {{- end }}>{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if gt (len $.Site.Menus.main) $.Site.Params.showMenuItems }}
|
||||
<ul class="menu__sub-inner">
|
||||
<li class="menu__sub-inner-more-trigger">{{ $.Site.Params.MenuMore }} ▾</li>
|
||||
|
||||
<ul class="menu__sub-inner-more hidden">
|
||||
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<li>
|
||||
<ul class="menu">
|
||||
<li class="menu__trigger">{{ $.Site.Params.MenuMore }} ▾</li>
|
||||
<li>
|
||||
<ul class="menu__dropdown">
|
||||
{{ range last (sub (len $.Site.Menus.main) $.Site.Params.showMenuItems) $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}" {{ if .Params.NewTab -}} target="_blank" {{- end }}>{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
<li><a href="{{ .URL }}" {{ if .Params.NewTab -}} target="_blank" {{- end }}>{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
||||
<div class="spacer"></div>
|
||||
<ul class="language-selector">
|
||||
<ul class="language-selector-current">
|
||||
<li>{{ .Language.LanguageName }} ▾</li>
|
||||
</ul>
|
||||
<ul class="language-selector__more hidden">
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</ul>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
<ul class="menu__inner menu__inner--mobile">
|
||||
{{ range $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
||||
<hr />
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
20
layouts/partials/mobile-menu.html
Normal file
20
layouts/partials/mobile-menu.html
Normal file
@ -0,0 +1,20 @@
|
||||
<ul class="menu menu--mobile">
|
||||
<li class="menu__trigger">Menu ▾</li>
|
||||
<li>
|
||||
<ul class="menu__dropdown">
|
||||
{{ range $.Site.Menus.main }}
|
||||
{{ if not .HasChildren }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if and $.Site.Params.showLanguageSelector (len $.Site.Home.AllTranslations) }}
|
||||
<hr />
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
@ -1,20 +1,16 @@
|
||||
<div class="pagination">
|
||||
<div class="pagination__buttons">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<span class="button previous">
|
||||
<a href="{{ .Paginator.Prev.URL }}">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>
|
||||
</a>
|
||||
</span>
|
||||
<a href="{{ .Paginator.Prev.URL }}" class="button previous">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if .Paginator.HasNext }}
|
||||
<span class="button next">
|
||||
<a href="{{ .Paginator.Next.URL }}">
|
||||
<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
<a href="{{ .Paginator.Next.URL }}" class="button next">
|
||||
<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,3 +1,3 @@
|
||||
{{ if .Get "src" }}
|
||||
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
|
||||
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} {{ with .Get "width" }} width="{{ . | plainify }}" {{ end }} {{ with .Get "height" }} height="{{ . | plainify }}" {{ end }} />
|
||||
{{ end }}
|
||||
|
@ -20,6 +20,7 @@
|
||||
>{{ $inner }}</code></pre>
|
||||
{{ else }}
|
||||
<pre class="language-{{ .Get 0 }}">
|
||||
<code class="language-{{ .Get 0 }}">{{ $inner }}</code></pre>
|
||||
<code class="language-{{ .Get 0 }}">{{ $inner }}</code>
|
||||
</pre>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
6743
package-lock.json
generated
Normal file
6743
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@ -1,5 +1,12 @@
|
||||
{
|
||||
"name": "terminal",
|
||||
"version": "3.1.0",
|
||||
"author": "Radosław Kozieł <@panr> <radoslaw.koziel@gmail.com>",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "echo 'Test'"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 2 versions",
|
||||
">1%",
|
||||
@ -24,16 +31,13 @@
|
||||
"devDependencies": {
|
||||
"browserslist": "^4.16.5",
|
||||
"clipboard": "^2.0.4",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb": "^18.2.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"husky": "^5.1.3"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "terminal",
|
||||
"scripts": {
|
||||
"test": "echo 'Test'"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
"husky": "^5.1.3",
|
||||
"stylelint": "^14.14.1",
|
||||
"stylelint-config-prettier-scss": "^0.0.1",
|
||||
"stylelint-config-standard-scss": "^6.1.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
const url = require("postcss-url");
|
||||
const imports = require("postcss-import");
|
||||
const nested = require("postcss-nested");
|
||||
const postcssCustomMedia = require("postcss-custom-media");
|
||||
const cssnano = require("cssnano");
|
||||
const color = require("postcss-color-mod-function");
|
||||
const mixins = require("postcss-mixins");
|
||||
|
||||
module.exports = () => ({
|
||||
plugins: [
|
||||
url,
|
||||
imports,
|
||||
mixins,
|
||||
nested,
|
||||
postcssCustomMedia,
|
||||
cssnano({
|
||||
preset: "default",
|
||||
}),
|
||||
color,
|
||||
],
|
||||
});
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
{"Target":"style.css","MediaType":"text/css","Data":{}}
|
@ -5,7 +5,7 @@ description = "A simple, retro theme for Hugo."
|
||||
homepage = "https://github.com/panr/hugo-theme-terminal/"
|
||||
tags = ["blog", "clean", "customizable", "dark", "highlighting", "minimal", "monotone", "multilingual", "personal", "responsive", "simple", "technical", "retro"]
|
||||
features = ["blog", "shortcode", "syntax highlighting"]
|
||||
min_version = 0.74
|
||||
min_version = 0.90
|
||||
|
||||
[author]
|
||||
name = "panr"
|
||||
|
Loading…
x
Reference in New Issue
Block a user