hacked-jekyll 2.1.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55d1fd537d32c92f49852229191e33ce237356176b9324dad15a47633eb2b166
4
- data.tar.gz: 359460146e276417743ccf0d549016ec3f27fe0bed71b727308d3fd8c3b22ba1
3
+ metadata.gz: 3ba592fe39f6f44ba9ad4d91fbc85ecd2587904e82ce601faa654f499bf5416b
4
+ data.tar.gz: 23db9b8e6fe72b9c7a051d43cfd891dd7f013eeb1534902785f5761b8cd00a91
5
5
  SHA512:
6
- metadata.gz: 35f4a06f70084c6b9e4a84f553fbc1ca745a90276bc78dde87a8e8c1eb86ad1e98547aecda2c5b32ddce6d49b9c32f3e7b99ef86ecee767350ffe647b7b55dac
7
- data.tar.gz: 58e3fc21dc6e35eaad055b4a67bae09a0559f412e4729027b6919df0aad612180285e010e8b66669867e393343b9f2f547dbde574497f7ce9dae38d2ebcc2d27
6
+ metadata.gz: cf735d4913817a341b9fc6e548d211dc051ba5a83dc130e7701035fee18441aa6c3a001ea4f08179c888e9a6cdc885f4195d266c6f34fc3e4b0ea9e301c0fb51
7
+ data.tar.gz: a9fe7ea5f9bb4f68bd3e09a91076984a5927924217093162f1046081f75157c56339559d688c28d930b3bf5fb43315d93c6b191c21cb3eb960e8e0ff24660d32
data/README.md CHANGED
@@ -90,27 +90,36 @@ Finally, it is possible to render `value` as a hash, which is a list of key-valu
90
90
 
91
91
  You can customize the appearance of the rendered JSON object using site variables. These have default values that can be overridden by specifying a new value in your `_config.yml` file.
92
92
 
93
- | Variable | Default | Purpose |
94
- | -------------- | :-----------------: | ----------------------------------------------------- |
95
- | `lowercase` | `true` | Set all keys and values to lowercase |
96
- | `color_bg` | `var(--oc-gray-9)` | Set the background color |
97
- | `color_punct` | `var(--oc-green-9)` | Set the color of quote marks, commas, and parentheses |
98
- | `color_keyval` | `var(--oc-green-4)` | Set the color of all keys and values |
99
- | `color_hover` | `var(--oc-green-5)` | Set the color of values on hover (if they are links) |
100
- | `show_quotes` | `true` | Display quote marks around keys and values |
101
- | `show_commas` | `true` | Display commas between key-value pairs |
102
- | `target` | `_self` | Set the target tab/window of hyperlinks |
103
-
104
- All color defaults use the naming convention of the Open Color library ([read here](https://yeun.github.io/open-color/documents.html)). You can change them to any other color in the library, any base CSS color, or any three or six-digit hex color. For example:
93
+ | Variable | Default | Purpose |
94
+ | ------------- | :-------: | ---------------------------------------------------- |
95
+ | `color_bg` | `gray-9` | Set the background color |
96
+ | `color_punct` | `green-9` | Set the color of quotes, commas, and brackets |
97
+ | `color_key` | `green-4` | Set the color of keys |
98
+ | `color_value` | `green-4` | Set the color of values |
99
+ | `color_hover` | `green-5` | Set the color of values on hover (if they are links) |
100
+ | `quotes` | `true` | Display quote marks around keys and/or values |
101
+ | `commas` | `true` | Display commas between key-value pairs |
102
+ | `lowercase` | `true` | Transform all keys and/or values to lowercase |
103
+ | `newtab` | `false` | Open links in a new tab |
104
+
105
+ The `color_*` variables follow the Open Color library's naming convention ([read here](https://yeun.github.io/open-color/documents.html)). You can change them to any color in the library using the same convention. For example:
105
106
 
106
107
  ```yaml
107
- color_bg: var(--oc-indigo-8)
108
- color_punct: black
109
- color_keyval: '#fff'
110
- color_hover: '#cc5de8'
108
+ color_bg: indigo-5
109
+ color_punct: teal-6
110
+ color_key: grape-7
111
+ color_value: lime-8
112
+ color_hover: cyan-9
111
113
  ```
112
114
 
113
- If you use Open Color names, remember to wrap them in a CSS variable.
115
+ The variables `quotes` and `lowercase` are true by default and can be set to false, but they can also be set to `keys` or `values` in order to restrict their effect to either keys or values. For example, the following code will display quote marks only around values and transform only keys to lowercase:
116
+
117
+ ```yaml
118
+ quotes: values
119
+ lowercase: keys
120
+ ```
121
+
122
+ It is possible to customize the CSS by creating a file `_sass/_custom.scss`. You can use this to define new styles as well as overwrite the theme's defaults. The file will be automatically compiled during build.
114
123
 
115
124
  ## Bugs
116
125
 
data/_layouts/home.html CHANGED
@@ -2,13 +2,32 @@
2
2
  layout: default
3
3
  ---
4
4
 
5
- {% if site.show_quotes -%}
6
- {% assign quote = '"' -%}
7
- {% endif -%}
8
- {% if site.show_commas -%}
5
+ {% case site.quotes -%}
6
+ {% when 'keys' -%}
7
+ {% assign quote_key = '"' -%}
8
+ {% assign quote_value = '' -%}
9
+ {% when 'values' -%}
10
+ {% assign quote_key = '' -%}
11
+ {% assign quote_value = '"' -%}
12
+ {% when false -%}
13
+ {% assign quote_key = '' -%}
14
+ {% assign quote_value = '' -%}
15
+ {% else -%}
16
+ {% assign quote_key = '"' -%}
17
+ {% assign quote_value = '"' -%}
18
+ {% endcase -%}
19
+
20
+ {% if site.commas == false -%}
21
+ {% assign comma = '' -%}
22
+ {% else -%}
9
23
  {% assign comma = ',' -%}
10
24
  {% endif -%}
11
- {% assign target = site.target | prepend: 'target="' | append: '"' -%}
25
+
26
+ {% if site.newtab == true -%}
27
+ {% assign tab = '_blank' -%}
28
+ {% else -%}
29
+ {% assign tab = '_self' -%}
30
+ {% endif -%}
12
31
 
13
32
  <div id="json">
14
33
  {% for pair in site.data.json %}
@@ -19,23 +38,23 @@ layout: default
19
38
  <span>{{ value }}</span>
20
39
  {%- endfor %}
21
40
  </div>
22
- {{ quote }}<span class="key">{{ pair.key }}</span>{{ quote }}:
23
- {{ quote }}<span class="value"><span id="typed"></span></span>{{ quote }}
41
+ {{ quote_key }}<span class="key">{{ pair.key }}</span>{{ quote_key }}:
42
+ {{ quote_value }}<span class="value"><span id="typed"></span></span>{{ quote_value }}
24
43
  {%- elsif pair.value.first.key -%}
25
- {{ quote }}<span class="key">{{ pair.key }}</span>{{ quote }}: [
44
+ {{ quote_key }}<span class="key">{{ pair.key }}</span>{{ quote_key }}: [
26
45
  {% for value in pair.value -%}
27
46
  {% if value.url -%}
28
47
  <p class="ms">
29
- {{ quote }}<span class="key">{{ value.key }}</span>{{ quote }}:
30
- {{ quote }}<a class="value" href="{{ value.url | relative_url }}" {{ target }}>{{ value.value }}</a>{{ quote }}
48
+ {{ quote_key }}<span class="key">{{ value.key }}</span>{{ quote_key }}:
49
+ {{ quote_value }}<a class="value" href="{{ value.url | relative_url }}" target="{{ tab }}">{{ value.value }}</a>{{ quote_value }}
31
50
  {%- unless forloop.last -%}
32
51
  {{ comma }}
33
52
  {%- endunless %}
34
53
  </p>
35
54
  {% else -%}
36
55
  <p class="ms">
37
- {{ quote }}<span class="key">{{ value.key }}</span>{{ quote }}:
38
- {{ quote }}<span class="value">{{ value.value }}</span>{{ quote }}
56
+ {{ quote_key }}<span class="key">{{ value.key }}</span>{{ quote_key }}:
57
+ {{ quote_value }}<span class="value">{{ value.value }}</span>{{ quote_value }}
39
58
  {%- unless forloop.last -%}
40
59
  {{ comma }}
41
60
  {%- endunless %}
@@ -44,18 +63,18 @@ layout: default
44
63
  {%- endfor -%}
45
64
  ]
46
65
  {%- elsif pair.value.first -%}
47
- {{ quote }}<span class="key">{{ pair.key }}</span>{{ quote }}: [
66
+ {{ quote_key }}<span class="key">{{ pair.key }}</span>{{ quote_key }}: [
48
67
  {% for value in pair.value -%}
49
68
  {% if value.url -%}
50
69
  <p class="ms">
51
- {{ quote }}<a class="value" href="{{ value.url | relative_url }}" {{ target }}>{{ value.value }}</a>{{ quote }}
70
+ {{ quote_value }}<a class="value" href="{{ value.url | relative_url }}" target="{{ tab }}">{{ value.value }}</a>{{ quote_value }}
52
71
  {%- unless forloop.last -%}
53
72
  {{ comma }}
54
73
  {%- endunless %}
55
74
  </p>
56
75
  {% else -%}
57
76
  <p class="ms">
58
- {{ quote }}<span class="value">{{ value }}</span>{{ quote }}
77
+ {{ quote_value }}<span class="value">{{ value }}</span>{{ quote_value }}
59
78
  {%- unless forloop.last -%}
60
79
  {{ comma }}
61
80
  {%- endunless %}
@@ -64,11 +83,11 @@ layout: default
64
83
  {%- endfor -%}
65
84
  ]
66
85
  {%- elsif pair.url -%}
67
- {{ quote }}<span class="key">{{ pair.key }}</span>{{ quote }}:
68
- {{ quote }}<a class="value" href="{{ pair.url | relative_url }}" {{ target }}>{{ pair.value }}</a>{{ quote }}
86
+ {{ quote_key }}<span class="key">{{ pair.key }}</span>{{ quote_key }}:
87
+ {{ quote_value }}<a class="value" href="{{ pair.url | relative_url }}" target="{{ tab }}">{{ pair.value }}</a>{{ quote_value }}
69
88
  {%- else -%}
70
- {{ quote }}<span class="key">{{ pair.key }}</span>{{ quote }}:
71
- {{ quote }}<span class="value">{{ pair.value }}</span>{{ quote }}
89
+ {{ quote_key }}<span class="key">{{ pair.key }}</span>{{ quote_key }}:
90
+ {{ quote_value }}<span class="value">{{ pair.value }}</span>{{ quote_value }}
72
91
  {%- endif -%}
73
92
  {%- unless forloop.last -%}
74
93
  {{ comma }}
File without changes
@@ -1,28 +1,25 @@
1
- ---
2
- ---
3
-
4
1
  @font-face {
5
2
  font-family: "hack";
6
- src: url("../webfonts/hack-regular-subset.woff2") format("woff2");
3
+ font-display: swap;
7
4
  font-style: normal;
8
5
  font-weight: 400;
9
- text-rendering: optimizeLegibility;
6
+ src: url("../webfonts/hack-regular-subset.woff2") format("woff2");
10
7
  }
11
8
 
12
9
  @font-face {
13
10
  font-family: "hack";
14
- src: url("../webfonts/hack-italic-subset.woff2") format("woff2");
11
+ font-display: swap;
15
12
  font-style: italic;
16
13
  font-weight: 400;
17
- text-rendering: optimizeLegibility;
14
+ src: url("../webfonts/hack-italic-subset.woff2") format("woff2");
18
15
  }
19
16
 
20
17
  body {
21
18
  font-family: "hack", monospace;
22
19
  font-size: 16px;
23
20
  font-weight: 400;
24
- background-color: {{ site.color_bg }};
25
- color: {{ site.color_punct }};
21
+ background-color: $color_bg;
22
+ color: $color_punct;
26
23
  }
27
24
 
28
25
  main {
@@ -59,7 +56,7 @@ a {
59
56
 
60
57
  a:hover,
61
58
  a:active {
62
- color: {{ site.color_hover }};
59
+ color: $color_hover;
63
60
  }
64
61
 
65
62
  #json {
@@ -87,11 +84,13 @@ a:active {
87
84
  margin-left: 1.5rem;
88
85
  }
89
86
 
87
+ .key {
88
+ color: $color_key;
89
+ text-transform: $transform_key;
90
+ }
91
+
90
92
  .error,
91
- .key,
92
93
  .value {
93
- {% if site.lowercase -%}
94
- text-transform: lowercase;
95
- {% endif -%}
96
- color: {{ site.color_keyval }};
94
+ color: $color_value;
95
+ text-transform: $transform_value;
97
96
  }
@@ -0,0 +1,26 @@
1
+ ---
2
+ ---
3
+
4
+ $color_bg: var(--oc-{{ site.color_bg | default: 'gray-9' }});
5
+ $color_punct: var(--oc-{{ site.color_punct | default: 'green-9' }});
6
+ $color_key: var(--oc-{{ site.color_key | default: 'green-4' }});
7
+ $color_value: var(--oc-{{ site.color_value | default: 'green-4' }});
8
+ $color_hover: var(--oc-{{ site.color_hover | default: 'green-5' }});
9
+
10
+ {% case site.lowercase -%}
11
+ {% when 'keys' -%}
12
+ $transform_key: lowercase;
13
+ $transform_value: none;
14
+ {% when 'values' -%}
15
+ $transform_key: none;
16
+ $transform_value: lowercase;
17
+ {% when false -%}
18
+ $transform_key: none;
19
+ $transform_value: none;
20
+ {% else -%}
21
+ $transform_key: lowercase;
22
+ $transform_value: lowercase;
23
+ {% endcase -%}
24
+
25
+ @import "default";
26
+ @import "custom";
metadata CHANGED
@@ -1,63 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hacked-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - piazzai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-03 00:00:00.000000000 Z
11
+ date: 2024-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: jekyll
14
+ name: github-pages
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.3'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 4.3.3
19
+ version: '231'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '4.3'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 4.3.3
26
+ version: '231'
33
27
  - !ruby/object:Gem::Dependency
34
- name: jekyll-seo-tag
28
+ name: webrick
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '2.8'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
33
+ version: '1.8'
34
+ - - '='
45
35
  - !ruby/object:Gem::Version
46
- version: '2.8'
47
- - !ruby/object:Gem::Dependency
48
- name: jekyll-sitemap
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.4'
36
+ version: 1.8.1
54
37
  type: :runtime
55
38
  prerelease: false
56
39
  version_requirements: !ruby/object:Gem::Requirement
57
40
  requirements:
58
41
  - - "~>"
59
42
  - !ruby/object:Gem::Version
60
- version: '1.4'
43
+ version: '1.8'
44
+ - - '='
45
+ - !ruby/object:Gem::Version
46
+ version: 1.8.1
61
47
  description:
62
48
  email:
63
49
  - 42124135+piazzai@users.noreply.github.com
@@ -67,17 +53,18 @@ extra_rdoc_files: []
67
53
  files:
68
54
  - LICENSE
69
55
  - README.md
70
- - _config.yml
71
56
  - _data/json.yml
72
57
  - _layouts/404.html
73
58
  - _layouts/default.html
74
59
  - _layouts/home.html
60
+ - _sass/_custom.scss
61
+ - _sass/_default.scss
75
62
  - assets/android-chrome-192x192.png
76
63
  - assets/android-chrome-512x512.png
77
64
  - assets/apple-touch-icon.png
78
65
  - assets/css/normalize.css
79
66
  - assets/css/open-color.css
80
- - assets/css/styles.css
67
+ - assets/css/styles.scss
81
68
  - assets/favicon-16x16.png
82
69
  - assets/favicon-32x32.png
83
70
  - assets/favicon.ico
data/_config.yml DELETED
@@ -1,17 +0,0 @@
1
- title: ""
2
- description: ""
3
- baseurl: ""
4
- url: ""
5
-
6
- lowercase: true
7
- color_bg: var(--oc-gray-9)
8
- color_punct: var(--oc-green-9)
9
- color_keyval: var(--oc-green-4)
10
- color_hover: var(--oc-green-5)
11
- show_quotes: true
12
- show_commas: true
13
- target: "_self"
14
-
15
- plugins:
16
- - jekyll-seo-tag
17
- - jekyll-sitemap