jekyll-theme-console 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +52 -12
- data/_includes/head.html +19 -10
- data/_includes/header.html +4 -1
- data/_layouts/default.html +25 -2
- data/_sass/_dark.scss +29 -27
- data/_sass/_hacker.scss +29 -27
- data/_sass/_light.scss +29 -27
- data/_sass/_nord.scss +34 -0
- data/_sass/base.scss +0 -1
- data/assets/main-dark.scss +4 -2
- data/assets/main-hacker.scss +4 -2
- data/assets/main-light.scss +4 -2
- data/assets/main-nord.scss +8 -0
- data/assets/main.scss +6 -3
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce79df1a37fb335f98b3c8bdd335e79d92ef57f46912da2b38fa582a3bd9829
|
4
|
+
data.tar.gz: ce234b9afbba1c227555777092bd70f527b4e4f24eed098dcb18234684f3ff71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4108a94e6c68a654c8feef20787ea538bd7a3197ead66723ebd85efc6472e47b0dbdbf8fd4002c41ab97763762173b0c09dab8ae26acafd3c8908b7e792ff1
|
7
|
+
data.tar.gz: 9cbd86883fb80275e010148b363993629d15243b62c3bdf7c916d6a0bac8a4ab33727ac3fc5cabd5592bec3706e86a8194224b108ffb36112cb98a4060cfc9b5
|
data/README.md
CHANGED
@@ -65,14 +65,15 @@ To update the theme run `bundle update`.
|
|
65
65
|
|
66
66
|
## Usage
|
67
67
|
|
68
|
-
### _config.
|
68
|
+
### _config.yml
|
69
69
|
|
70
70
|
In addition to jekyll's default configuration options, you can provide:
|
71
|
-
- `header_pages
|
72
|
-
- `footer
|
73
|
-
- `google_analytics
|
74
|
-
- `listen_for_clients_preferred_style
|
75
|
-
- `style
|
71
|
+
- `header_pages`: list of pages displayed in the navbar
|
72
|
+
- `footer`: HTML string inserted at the end of the page
|
73
|
+
- `google_analytics`: tracking id (only loaded in production when set)
|
74
|
+
- `listen_for_clients_preferred_style`: allow users to pick light/dark based on OS preference
|
75
|
+
- `style`: predefined color style (`dark` default, or `light`, `hacker`)
|
76
|
+
- `disable_google_fonts`: set `true` to avoid loading fonts from Google and use system fonts only
|
76
77
|
|
77
78
|
```yaml
|
78
79
|
header_pages:
|
@@ -85,6 +86,7 @@ listen_for_clients_preferred_style: true # false (default) or true
|
|
85
86
|
footer: 'follow us on <a href="https://twitter.com/xxx">twitter</a>'
|
86
87
|
|
87
88
|
google_analytics: UA-NNNNNNNN-N
|
89
|
+
disable_google_fonts: false
|
88
90
|
```
|
89
91
|
|
90
92
|
### front matter variables
|
@@ -100,18 +102,56 @@ If you want to customize this theme, follow this steps:
|
|
100
102
|
1. Fork this repository (you can use the fork as your own theme or directly as your website)
|
101
103
|
2. Create or modify files in `_layouts` directory for html-based changes
|
102
104
|
3. Create or modify files in `_sass` and `assets` for css-based changes
|
103
|
-
- You can change things which are used in
|
104
|
-
- Style-specific definitions are in `_sass/_dark.scss
|
105
|
+
- You can change things which are used in all styles (like font-size) in `_sass/base.scss`. You'll find style variables at the top.
|
106
|
+
- Style-specific definitions are in `_sass/_dark.scss`, `_sass/_light.scss`, `_sass/_hacker.scss`.
|
107
|
+
- Fonts are loaded via `<link>` tags for better performance. Set `disable_google_fonts: true` to avoid external font requests.
|
105
108
|
|
106
|
-
|
109
|
+
### Performance tips
|
107
110
|
|
108
|
-
|
111
|
+
- Enable Sass compression in your site by adding to `_config.yml`:
|
112
|
+
|
113
|
+
```yaml
|
114
|
+
sass:
|
115
|
+
style: compressed
|
116
|
+
```
|
117
|
+
|
118
|
+
- Consider adding `jekyll-feed` to your site's plugins for an RSS/Atom feed.
|
119
|
+
|
120
|
+
### Content Security Policy
|
121
|
+
|
122
|
+
This theme ships with a strict but practical CSP to improve security. By default it allows:
|
123
|
+
- self-hosted content plus images from `https:` and `data:` URIs
|
124
|
+
- Google Fonts (if not disabled)
|
125
|
+
- Google Analytics (only when `google_analytics` is set, including inline init script)
|
126
|
+
|
127
|
+
If you need additional sources (e.g., to embed iframes), extend the policy via `_config.yml`:
|
128
|
+
|
129
|
+
```yaml
|
130
|
+
csp_extra: "frame-src https:;"
|
131
|
+
```
|
132
|
+
|
133
|
+
Tip: To remove the top border line in the menu, override CSS in your site (e.g., add a small stylesheet) with:
|
134
|
+
|
135
|
+
```css
|
136
|
+
.menu { border-top: none; }
|
137
|
+
```
|
109
138
|
|
110
139
|
## Development
|
111
140
|
|
112
|
-
|
141
|
+
Your theme is setup just like a normal Jekyll site. You can run it either natively or in Docker.
|
142
|
+
|
143
|
+
### Run in Docker (recommended)
|
144
|
+
|
145
|
+
|
146
|
+
`docker compose up --build`
|
147
|
+
|
148
|
+
Then open `http://localhost:4000`.
|
149
|
+
|
150
|
+
### Run locally (without Docker)
|
113
151
|
|
114
|
-
|
152
|
+
1. `bundle install`
|
153
|
+
2. `bundle exec jekyll serve`
|
154
|
+
3. Open `http://localhost:4000`
|
115
155
|
|
116
156
|
When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
|
117
157
|
To add a custom directory to your theme-gem, please edit the regexp in `jekyll-theme-console.gemspec` accordingly.
|
data/_includes/head.html
CHANGED
@@ -2,26 +2,35 @@
|
|
2
2
|
<meta charset="utf-8">
|
3
3
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
5
|
+
<meta name="color-scheme" content="dark light">
|
5
6
|
<title>{{ page.title }}</title>
|
6
7
|
{%- seo title=false -%}
|
7
8
|
|
8
9
|
{% if page.robots %}
|
9
|
-
|
10
|
+
<meta name="robots" content="{{page.robots}}" />
|
10
11
|
{% endif %}
|
11
12
|
|
13
|
+
{%- unless site.disable_google_fonts -%}
|
14
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
15
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
16
|
+
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700" rel="stylesheet">
|
17
|
+
{%- endunless -%}
|
18
|
+
|
12
19
|
{%- if site.listen_for_clients_preferred_style -%}
|
13
|
-
|
20
|
+
<link rel="stylesheet" type="text/css" href="{{ "/assets/main.css" | relative_url }}">
|
21
|
+
{%- else -%}
|
22
|
+
{%- if site.style == 'nord' -%}
|
23
|
+
<link rel="stylesheet" type="text/css" href="{{ "/assets/main-nord.css" | relative_url }}">
|
24
|
+
{%- elsif site.style == 'light' -%}
|
25
|
+
<link rel="stylesheet" type="text/css" href="{{ "/assets/main-light.css" | relative_url }}">
|
26
|
+
{%- elsif site.style == 'hacker' -%}
|
27
|
+
<link rel="stylesheet" type="text/css" href="{{ "/assets/main-hacker.css" | relative_url }}">
|
14
28
|
{%- else -%}
|
15
|
-
|
16
|
-
|
17
|
-
{%- elsif site.style == 'hacker' -%}
|
18
|
-
<link rel="stylesheet" type="text/css" href="{{ "/assets/main-hacker.css" | relative_url }}">
|
19
|
-
{%- else -%}
|
20
|
-
<link rel="stylesheet" type="text/css" href="{{ "/assets/main-dark.css" | relative_url }}">
|
21
|
-
{%- endif -%}
|
29
|
+
<link rel="stylesheet" type="text/css" href="{{ "/assets/main-dark.css" | relative_url }}">
|
30
|
+
{%- endif -%}
|
22
31
|
{%- endif -%}
|
23
32
|
|
24
33
|
{%- if jekyll.environment == 'production' and site.google_analytics -%}
|
25
|
-
|
34
|
+
{%- include google-analytics.html -%}
|
26
35
|
{%- endif -%}
|
27
36
|
</head>
|
data/_includes/header.html
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
{%- assign default_paths = site.html_pages | map: 'path' -%}
|
1
2
|
{%- assign page_paths = site.header_pages | default: default_paths -%}
|
2
3
|
<header>
|
3
4
|
<div class="menu">
|
@@ -5,7 +6,9 @@
|
|
5
6
|
{%- for path in page_paths -%}
|
6
7
|
{%- assign my_page = site.pages | where: "path", path | first -%}
|
7
8
|
{%- if my_page.title -%}
|
8
|
-
<li
|
9
|
+
<li>
|
10
|
+
<a href="{{ my_page.url | relative_url }}"{% if page.url == my_page.url %} aria-current="page"{% endif %}>{{ my_page.title | escape }}</a>
|
11
|
+
</li>
|
9
12
|
{%- endif -%}
|
10
13
|
{%- endfor -%}
|
11
14
|
</ul>
|
data/_layouts/default.html
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
|
-
<html lang="{{ page.lang | default: site.lang | default:
|
3
|
-
|
2
|
+
<html lang="{{ page.lang | default: site.lang | default: 'en' }}">
|
3
|
+
{%- comment -%}
|
4
|
+
Build a practical CSP. It remains strict by default while allowing
|
5
|
+
common use cases: external images and Google Fonts. If Google Analytics
|
6
|
+
is enabled, allow its domains and inline init script.
|
7
|
+
{%- endcomment -%}
|
8
|
+
{%- capture csp -%}
|
9
|
+
default-src 'none';
|
10
|
+
connect-src 'self';
|
11
|
+
base-uri 'self';
|
12
|
+
form-action 'none';
|
13
|
+
img-src 'self' https: data:;
|
14
|
+
style-src 'self' https://fonts.googleapis.com;
|
15
|
+
font-src 'self' https://fonts.gstatic.com data:;
|
16
|
+
media-src 'self';
|
17
|
+
object-src 'none';
|
18
|
+
child-src 'self';
|
19
|
+
{%- if jekyll.environment == 'production' and site.google_analytics -%}
|
20
|
+
script-src 'self' https://www.googletagmanager.com 'unsafe-inline';
|
21
|
+
{%- else -%}
|
22
|
+
script-src 'self';
|
23
|
+
{%- endif -%}
|
24
|
+
{%- endcapture -%}
|
25
|
+
{%- capture csp_final -%}{{ csp | strip | replace: '\n', ' ' }} {%- if site.csp_extra %} {{ site.csp_extra }}{%- endif -%}{%- endcapture -%}
|
26
|
+
<meta http-equiv="Content-Security-Policy" content="{{ csp_final | strip }}" />
|
4
27
|
<meta http-equiv="X-XSS-Protection" content="1;mode=block" always>
|
5
28
|
<meta http-equiv="Referrer-Policy" content="no-referrer, strict-origin-when-cross-origin">
|
6
29
|
|
data/_sass/_dark.scss
CHANGED
@@ -2,31 +2,33 @@
|
|
2
2
|
* Dark theme variables
|
3
3
|
*/
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
5
|
+
@mixin theme() {
|
6
|
+
:root {
|
7
|
+
--base-color: #DBDBDB;
|
8
|
+
--border: dashed 1px rgba(219, 219, 219, 0.9);
|
9
|
+
--selection-background: rgba(219, 219, 219, 0.99);
|
10
|
+
--selection-text: #000;
|
11
|
+
--background-color: #000;
|
12
|
+
--text-color: var(--base-color);
|
13
|
+
--placeholder-color: var(--base-color);
|
14
|
+
--link-color: var(--base-color);
|
15
|
+
--code-color-1: #aaaaaa;
|
16
|
+
--code-color-2: #ffffcc;
|
17
|
+
--code-color-3: #F00000;
|
18
|
+
--code-color-4: #F0A0A0;
|
19
|
+
--code-color-5: #b38aff;
|
20
|
+
--code-color-6: #5ba711;
|
21
|
+
--code-color-7: #e4e477;
|
22
|
+
--code-color-8: #000080;
|
23
|
+
--code-color-9: #05ca05;
|
24
|
+
--code-color-10: #888888;
|
25
|
+
--code-color-11: #555555;
|
26
|
+
--code-color-12: #800080;
|
27
|
+
--code-color-13: #00d4d4;
|
28
|
+
--code-color-14: #00c1c1;
|
29
|
+
--code-color-15: #ed9d13;
|
30
|
+
--code-color-16: #1e90ff;
|
31
|
+
--code-color-17: #800000;
|
32
|
+
--code-color-18: #bbbbbb;
|
33
|
+
}
|
32
34
|
}
|
data/_sass/_hacker.scss
CHANGED
@@ -2,31 +2,33 @@
|
|
2
2
|
* Hacker theme variables
|
3
3
|
*/
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
5
|
+
@mixin theme() {
|
6
|
+
:root {
|
7
|
+
--base-color: #00ff00;
|
8
|
+
--border: dashed 1px rgba(0, 255, 0, 0.9);
|
9
|
+
--selection-background: rgba(0, 255, 0, 0.99);
|
10
|
+
--selection-text: #000;
|
11
|
+
--background-color: #000;
|
12
|
+
--text-color: var(--base-color);
|
13
|
+
--placeholder-color: var(--base-color);
|
14
|
+
--link-color: var(--base-color);
|
15
|
+
--code-color-1: #aaaaaa;
|
16
|
+
--code-color-2: #ffffcc;
|
17
|
+
--code-color-3: #F00000;
|
18
|
+
--code-color-4: #F0A0A0;
|
19
|
+
--code-color-5: #b38aff;
|
20
|
+
--code-color-6: #5ba711;
|
21
|
+
--code-color-7: #e4e477;
|
22
|
+
--code-color-8: #000080;
|
23
|
+
--code-color-9: #05ca05;
|
24
|
+
--code-color-10: #888888;
|
25
|
+
--code-color-11: #555555;
|
26
|
+
--code-color-12: #800080;
|
27
|
+
--code-color-13: #00d4d4;
|
28
|
+
--code-color-14: #00c1c1;
|
29
|
+
--code-color-15: #ed9d13;
|
30
|
+
--code-color-16: #1e90ff;
|
31
|
+
--code-color-17: #800000;
|
32
|
+
--code-color-18: #bbbbbb;
|
33
|
+
}
|
32
34
|
}
|
data/_sass/_light.scss
CHANGED
@@ -2,31 +2,33 @@
|
|
2
2
|
* Light theme variables
|
3
3
|
*/
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
5
|
+
@mixin theme() {
|
6
|
+
:root {
|
7
|
+
--base-color: #000;
|
8
|
+
--border: dashed 1px rgba(0, 0, 0, 1);
|
9
|
+
--selection-background: rgba(0, 0, 0, 0.99);
|
10
|
+
--selection-text: #FFF;
|
11
|
+
--background-color: #FFF;
|
12
|
+
--text-color: var(--base-color);
|
13
|
+
--placeholder-color: var(--base-color);
|
14
|
+
--link-color: var(--base-color);
|
15
|
+
--code-color-1: #aaaaaa;
|
16
|
+
--code-color-2: #ffffcc;
|
17
|
+
--code-color-3: #F00000;
|
18
|
+
--code-color-4: #F0A0A0;
|
19
|
+
--code-color-5: #0000aa;
|
20
|
+
--code-color-6: #4c8317;
|
21
|
+
--code-color-7: #aa0000;
|
22
|
+
--code-color-8: #000080;
|
23
|
+
--code-color-9: #00aa00;
|
24
|
+
--code-color-10: #888888;
|
25
|
+
--code-color-11: #555555;
|
26
|
+
--code-color-12: #800080;
|
27
|
+
--code-color-13: #00aaaa;
|
28
|
+
--code-color-14: #009999;
|
29
|
+
--code-color-15: #aa5500;
|
30
|
+
--code-color-16: #1e90ff;
|
31
|
+
--code-color-17: #800000;
|
32
|
+
--code-color-18: #bbbbbb;
|
33
|
+
}
|
32
34
|
}
|
data/_sass/_nord.scss
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* Nord theme variables
|
3
|
+
*/
|
4
|
+
|
5
|
+
@mixin theme() {
|
6
|
+
:root {
|
7
|
+
--base-color: #D8DEE9;
|
8
|
+
--border: dashed 1px #3B4252;
|
9
|
+
--selection-background: #E5E9F0;
|
10
|
+
--selection-text: #434C5E;
|
11
|
+
--background-color: #2E3440;
|
12
|
+
--text-color: var(--base-color);
|
13
|
+
--placeholder-color: var(--base-color);
|
14
|
+
--link-color: var(--base-color);
|
15
|
+
--code-color-1: #aaaaaa;
|
16
|
+
--code-color-2: #ffffcc;
|
17
|
+
--code-color-3: #F00000;
|
18
|
+
--code-color-4: #F0A0A0;
|
19
|
+
--code-color-5: #0000aa;
|
20
|
+
--code-color-6: #4c8317;
|
21
|
+
--code-color-7: #aa0000;
|
22
|
+
--code-color-8: #000080;
|
23
|
+
--code-color-9: #00aa00;
|
24
|
+
--code-color-10: #888888;
|
25
|
+
--code-color-11: #555555;
|
26
|
+
--code-color-12: #800080;
|
27
|
+
--code-color-13: #00aaaa;
|
28
|
+
--code-color-14: #009999;
|
29
|
+
--code-color-15: #aa5500;
|
30
|
+
--code-color-16: #1e90ff;
|
31
|
+
--code-color-17: #800000;
|
32
|
+
--code-color-18: #bbbbbb;
|
33
|
+
}
|
34
|
+
}
|
data/_sass/base.scss
CHANGED
data/assets/main-dark.scss
CHANGED
data/assets/main-hacker.scss
CHANGED
data/assets/main-light.scss
CHANGED
data/assets/main.scss
CHANGED
@@ -2,9 +2,12 @@
|
|
2
2
|
# Only the main Sass file needs front matter (the dashes are enough)
|
3
3
|
---
|
4
4
|
|
5
|
-
@
|
6
|
-
@
|
5
|
+
@use "light";
|
6
|
+
@use "dark";
|
7
|
+
@use "base";
|
8
|
+
|
9
|
+
@include light.theme();
|
7
10
|
|
8
11
|
@media (prefers-color-scheme: dark) {
|
9
|
-
|
12
|
+
@include dark.theme();
|
10
13
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- b2a3e8
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -86,10 +86,12 @@ files:
|
|
86
86
|
- _sass/_dark.scss
|
87
87
|
- _sass/_hacker.scss
|
88
88
|
- _sass/_light.scss
|
89
|
+
- _sass/_nord.scss
|
89
90
|
- _sass/base.scss
|
90
91
|
- assets/main-dark.scss
|
91
92
|
- assets/main-hacker.scss
|
92
93
|
- assets/main-light.scss
|
94
|
+
- assets/main-nord.scss
|
93
95
|
- assets/main.scss
|
94
96
|
homepage: https://github.com/b2a3e8/jekyll-theme-console
|
95
97
|
licenses:
|
@@ -110,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
112
|
- !ruby/object:Gem::Version
|
111
113
|
version: '0'
|
112
114
|
requirements: []
|
113
|
-
rubygems_version: 3.0.3
|
115
|
+
rubygems_version: 3.0.3.1
|
114
116
|
signing_key:
|
115
117
|
specification_version: 4
|
116
118
|
summary: A jekyll theme with inspiration from linux consoles for hackers, developers
|