Skip to content

Commit b480361

Browse files
committed
This is the next set of changes, brings in a lot, but also not yet complete. Its going to add some interesting things, though.
First its the real start of using the command line to make additions, which is not yet complete as I am working on the traversal of the schema to dictate the questions so its always up to date. It moves the _sass folder inside the includes folder. Why? Well its simple, so we can include critical CSS in the future without moving the rest of our SCSS and SASS apart from each other. Its odd that they make it so difficult but this greatly enables us to speed up page loads in the future be cherry-picking out critical CSS.
1 parent 5506e84 commit b480361

16 files changed

+114
-23
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
docker tag acceptbitcoincash/acceptbitcoincash acceptbitcoincash/acceptbitcoincash:"$NEXT_BUILD_TAG";
4848
fi
4949
- cp ./_site/js/main.js ./js/main.js
50+
- rm -rf ./_site/assets
5051
deploy:
5152
- provider: script
5253
skip-cleanup: true

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ source 'https://rubygems.org'
44
group :jekyll_plugins do
55
gem 'github-pages'
66
gem 'jekyll-minifier'
7+
gem 'jekyll-seo-tag'
78
end
89

910
group :test do
1011
gem 'diff-lcs'
1112
gem 'diffy'
1213
gem 'fastimage'
14+
gem 'highline'
1315
gem 'html-proofer'
1416
gem 'kwalify'
1517
gem 'rake'

Rakefile

+86-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,95 @@ namespace :add do
5555
require 'safe_yaml/load'
5656
require 'open-uri'
5757
require 'kwalify'
58+
require 'highline/import'
5859

5960
desc 'adding data to the site'
6061

61-
task :github_listing do
62+
# rubocop:disable Semicolon
63+
def yesno(prompt = 'Continue?', default = true, details = nil)
64+
a = ''
65+
s = default ? '[Y/n]' : '[y/N]'
66+
d = default ? 'y' : 'n'
67+
puts details unless details.nil?
68+
until %w[y n].include? a
69+
a = ask("#{prompt} #{s} ") { |q| q.limit = 1; q.case = :downcase }
70+
a = d if a.length.zero?
71+
end
72+
a == 'y'
73+
end
74+
# rubocop:enable Semicolon
75+
76+
task :test do
77+
tags = tags_from_schema
78+
tags.each do |tag|
79+
prompt_tag(tag[0], tag[1])
80+
end
81+
end
82+
83+
def tags_from_schema
84+
schema = YAML.load_file(File.join(__dir__, 'websites_schema.yml'))
85+
Kwalify::Util.traverse_schema(schema) do |rule|
86+
# puts rule
87+
return rule['mapping'] if rule['name'] == 'Website'
88+
end
89+
end
90+
91+
task :manual do
92+
listing = {}
93+
loop do
94+
category = value_prompt('category')
95+
section_file = File.join(__dir__, "_data/#{category}.yml")
96+
break if File.exist?(section_file)
97+
end
98+
tags = tags_from_schema
99+
tags.each do |tag|
100+
prompt_tag(tag[0], tag[1])
101+
listing[tag[0]] = data unless data.nil?
102+
end
103+
puts listing
104+
end
105+
106+
# rubocop:disable AbcSize, CyclomaticComplexity
107+
def prompt_tag(name, rules)
108+
output = nil
109+
required = rules['required']
110+
if required || yesno("Include #{name} tag?", false, rules['desc'])
111+
case rules['type']
112+
when 'bool'
113+
output = yesno("#{name} value?", rules['default'])
114+
115+
when 'str'
116+
output = value_prompt(name)
117+
118+
when 'seq'
119+
output = []
120+
rules['sequence'].each do |entry|
121+
entry.each do |tag|
122+
data = prompt_tag(tag[0], tag[1])
123+
output[tag[0]] = data unless data.nil?
124+
end
125+
end
126+
127+
when 'map'
128+
output = {}
129+
130+
rules['mapping'].each do |entry|
131+
entry.each do |tag|
132+
data = prompt_tag(tag[0], tag[1])
133+
output[tag[0]] = data unless data.nil?
134+
end
135+
end
136+
137+
else
138+
output = value_prompt(name)
139+
end
140+
end
141+
142+
output
143+
end
144+
# rubocop:enable AbcSize, CyclomaticComplexity
145+
146+
task :github do
62147
url = 'https://api.github.com/repos/acceptbitcoincash/acceptbitcoincash/issues/'
63148
url += value_prompt('issue number')
64149
uri = URI(url)

_config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
permalink: pretty
22
markdown: kramdown
3-
theme: jekyll-theme-hacker
3+
theme: null
44

55
title: The Accept Bitcoin Cash Initiative
66
author: n9jd34x04l151ho4 + topolino + kenman345
@@ -14,9 +14,11 @@ google_analytics: UA-107218359-1
1414
twitter:
1515
username: useBitcoinCash
1616
sass:
17+
sass_dir: _includes/_sass
1718
style: compressed
1819
plugins:
1920
- jekyll-minifier
21+
- jekyll-seo-tag
2022

2123
defaults:
2224
-
@@ -58,5 +60,4 @@ exclude:
5860

5961
jekyll-minifier:
6062
compress_javascript: true # Default: true
61-
compress_js_templates: false
6263
exclude: ['data.json', 'stats.json'] # Keeping these files sexy guys
File renamed without changes.
File renamed without changes.
File renamed without changes.

css/base.scss _includes/_sass/base.scss

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
---
3-
41
@import 'mixins';
52
@import 'colors';
63

@@ -96,7 +93,7 @@ body {
9693
font-family: Ubuntu, Lato, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
9794
color: #505050;
9895
line-height: 22px;
99-
background: url(../img/pcb-subtle-green.png) repeat;
96+
background: url(/img/pcb-subtle-green.png) repeat;
10097
}
10198

10299
h1, h2, h3, h4, h5, .ui.header {
@@ -1237,7 +1234,7 @@ span.progress {
12371234
}
12381235

12391236
.ui.segment.twitter-panel {
1240-
background: url(../img/twitter-logo-alpha-large.png) no-repeat bottom right #fff;
1237+
background: url(/img/twitter-logo-alpha-large.png) no-repeat bottom right #fff;
12411238
background-size: contain;
12421239
padding: 2rem 0;
12431240
margin-bottom: 5rem;
File renamed without changes.

css/corner.scss _includes/_sass/corner.scss

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
---
3-
41
@import 'colors';
52

63
.github-corner {

css/z-switch.sass _includes/_sass/z-switch.sass

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
---
3-
41
@import 'colors'
52

63
.z-switch

_layouts/default.html

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717
<meta name="theme-color" content="#ffffff">
1818

1919
<!-- Google Fonts should not use SRI hashes as the CSS served dynamically changes depending on browser -->
20-
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,300i,400,400i,500,500i,700" rel="stylesheet">
21-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.7/semantic.min.css"
22-
integrity="sha384-OWA++c6zXatjdqJdL8H+05IXMubqBVwUdl1Cd9GzMwpjc9lBoy0rSYmTLtj1IDKv" crossorigin="anonymous">
20+
21+
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
22+
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,300i,400,400i,500,500i,700" rel="stylesheet">
23+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.7/semantic.min.css"
24+
integrity="sha384-OWA++c6zXatjdqJdL8H+05IXMubqBVwUdl1Cd9GzMwpjc9lBoy0rSYmTLtj1IDKv" crossorigin="anonymous">
2325

24-
<link rel="stylesheet" href="/css/base.css">
25-
<link rel="stylesheet" href="/css/corner.css">
2626
{%- if page.has_search -%}
27-
<link rel="stylesheet" href="/css/z-switch.css">
27+
<link rel="stylesheet" href="/css/search-style.css">
28+
{%- else -%}
29+
<link rel="stylesheet" href="/css/style.css">
2830
{%- endif -%}
2931
</head>
3032

css/search-style.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
---
3+
4+
@import 'base';
5+
@import 'corner';
6+
@import 'z-switch';

css/style.scss

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
---
3+
4+
@import 'base';
5+
@import 'corner';

js/main.js

-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
---
33
{% capture page_js %}
44
{% include_relative jquery.unveil.min.js %}
5-
65
{% include_relative ticker.js %}
7-
86
{% include_relative fixto.min.js %}
9-
107
{% include_relative app.js %}
118
{% endcapture %}
129

websites_schema.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mapping:
99
"name":
1010
type: str
1111
required: yes
12+
ident: yes
1213
unique: yes
1314
"url":
1415
type: str

0 commit comments

Comments
 (0)