Skip to content

Cleanup of Site Files #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/move.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ closeSourceIssue: true
# Lock the source issue after moving
lockSourceIssue: false
# Set custom aliases for targets
aliases:
main: bpkg/bpkg
aliases:
main: bpkg/bpkg

#EOF
58 changes: 57 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
Sorry this page does not exist =(
<!DOCTYPE html>
<html>
<head>
<title>404 - Page Not Found - BPKG</title>
<style>
@font-face {
font-family: 'UbuntuMono-B';
src: url('/assets/themes/the-program/font/UbuntuMono-B-webfont.eot');
src: url('/assets/themes/the-program/font/UbuntuMono-B-webfont.eot?#iefix') format('embedded-opentype'),
url('/assets/themes/the-program/font/UbuntuMono-B-webfont.woff') format('woff'),
url('/assets/themes/the-program/font/UbuntuMono-B-webfont.ttf') format('truetype'),
url('/assets/themes/the-program/font/UbuntuMono-B-webfont.svg#UbuntuMono-B') format('svg');
font-weight: normal !important;
font-style: normal;
}
html, body {
background: black;
height: 100%;
margin: 0;
color: rgba(255,255,255,0.75);
font-family: UbuntuMono-B;
font-size: 32px;
font-size: 3vw;
}
.center-middle {
align-items: center;
display: flex;
height: 100%;
justify-content: center;
}
p {
margin: 0;
text-align: center;
line-height: 3vi;
}
.sorry {
font-size: 2.25vw;
}
.pnf {
font-family: 'Courier New', Courier, monospace;
}
img {
filter: invert(75%);
height: 50vmin;
}
</style>
</head>
<body>
<div class="center-middle">
<p>
<img src="/assets/logo.svg" /><br />
<span class="sorry">Sorry this page does not exist =(</span><br />
<span class="pnf">404 - Page Not Found</span>
</p>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bpkg.sh
bpkg.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Alternative way to create a new page, on this case it will be `./about.html`.
This site uses [Jekyll Bootstrap][boots] with a heavily customized version of
[the_program][theme] theme, originally made by [Yuya Saito][saito].

[home]: http://bpkg.sh/
[home]: https://bpkg.sh/
[hub]: https://github.com/bpkg/bpkg
[org]: https://github.com/bpkg
[jekyll]: http://jekyllrb.com/
Expand Down
48 changes: 24 additions & 24 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module JB
:theme_packages => "_theme_packages",
:posts => "_posts"
}

def self.base
SOURCE
end
Expand All @@ -36,7 +36,7 @@ module JB
path.compact!
File.__send__ :join, path
end

end #Path
end #JB

Expand All @@ -59,7 +59,7 @@ task :post do
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end

puts "Creating new post: #{filename}"
open(filename, 'w') do |post|
post.puts "---"
Expand All @@ -85,7 +85,7 @@ task :page do
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end

mkdir_p File.dirname(filename)
puts "Creating new page: #{filename}"
open(filename, 'w') do |post|
Expand All @@ -107,7 +107,7 @@ end # task :preview
task :switch_theme => "theme:switch"

namespace :theme do

# Public: Switch from one theme to another for your blog.
#
# name - String, Required. name of the theme you want to switch to.
Expand Down Expand Up @@ -142,16 +142,16 @@ namespace :theme do
page.puts "---"
page.puts "layout: default"
page.puts "---"
end
end
page.puts "{% include JB/setup %}"
page.puts "{% include themes/#{theme_name}/#{File.basename(filename)} %}"
page.puts "{% include themes/#{theme_name}/#{File.basename(filename)} %}"
end
end

puts "=> Theme successfully switched!"
puts "=> Reload your web-page to check it out =)"
end # task :switch

# Public: Install a theme using the theme packager.
# Version 0.1.0 simple 1:1 file matching.
#
Expand All @@ -175,28 +175,28 @@ namespace :theme do
end

packaged_theme_path = JB::Path.build(:theme_packages, :node => name)

abort("rake aborted!
=> ERROR: 'name' cannot be blank") if name.empty?
abort("rake aborted!
abort("rake aborted!
=> ERROR: '#{packaged_theme_path}' directory not found.
=> Installable themes can be added via git. You can find some here: http://github.com/jekyllbootstrap
=> To download+install run: `rake theme:install git='[PUBLIC-CLONE-URL]'`
=> example : rake theme:install git='[email protected]:jekyllbootstrap/theme-the-program.git'
") unless FileTest.directory?(packaged_theme_path)

manifest = verify_manifest(packaged_theme_path)

# Get relative paths to packaged theme files
# Exclude directories as they'll be recursively created. Exclude meta-data files.
packaged_theme_files = []
FileUtils.cd(packaged_theme_path) {
Dir.glob("**/*.*") { |f|
Dir.glob("**/*.*") { |f|
next if ( FileTest.directory?(f) || f =~ /^(manifest|readme|packager)/i )
packaged_theme_files << f
packaged_theme_files << f
}
}

# Mirror each file into the framework making sure to prompt if already exists.
packaged_theme_files.each do |filename|
file_install_path = File.join(JB::Path.base, filename)
Expand All @@ -207,7 +207,7 @@ namespace :theme do
cp_r File.join(packaged_theme_path, filename), file_install_path
end
end

puts "=> #{name} theme has been installed!"
puts "=> ---"
if ask("=> Want to switch themes now?", ['y', 'n']) == 'y'
Expand All @@ -220,7 +220,7 @@ namespace :theme do
# In other words packaging is essentially the reverse of installing.
#
# name - String, Required name of the theme you want to package.
#
#
# Examples
#
# rake theme:package name="twitter"
Expand All @@ -235,12 +235,12 @@ namespace :theme do
abort("rake aborted: name cannot be blank") if name.empty?
abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path)
abort("rake aborted: '#{asset_path}' directory not found.") unless FileTest.directory?(asset_path)

## Mirror theme's template directory (_includes)
packaged_theme_path = JB::Path.build(:themes, :root => JB::Path.build(:theme_packages, :node => name))
mkdir_p packaged_theme_path
cp_r theme_path, packaged_theme_path

## Mirror theme's asset directory
packaged_theme_assets_path = JB::Path.build(:theme_assets, :root => JB::Path.build(:theme_packages, :node => name))
mkdir_p packaged_theme_assets_path
Expand All @@ -251,18 +251,18 @@ namespace :theme do
open(JB::Path.build(:theme_packages, :node => "#{name}/packager.yml"), "w") do |page|
page.puts packager.to_yaml
end

puts "=> '#{name}' theme is packaged and available at: #{JB::Path.build(:theme_packages, :node => name)}"
end

end # end namespace :theme

# Internal: Download and process a theme from a git url.
# Notice we don't know the name of the theme until we look it up in the manifest.
# So we'll have to change the folder name once we get the name.
#
# url - String, Required url to git repository.
#
#
# Returns theme manifest hash
def theme_from_git_url(url)
tmp_path = JB::Path.build(:theme_packages, :node => "_tmp")
Expand All @@ -282,7 +282,7 @@ end
# Internal: Process theme package manifest file.
#
# theme_path - String, Required. File path to theme package.
#
#
# Returns theme manifest hash
def verify_manifest(theme_path)
manifest_path = File.join(theme_path, "manifest.yml")
Expand Down
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exclude: [
# Else if you are pushing to username.github.io, replace with your username.
# Finally if you are pushing to a GitHub project page, include the project name at the end.
#
production_url : http://bpkg.github.io
production_url : https://bpkg.sh/

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Jekyll-Bootstrap specific configurations
Expand Down Expand Up @@ -165,4 +165,4 @@ JB :
# where [HELPER] is the name of the helper you are overriding.


theme: jekyll-theme-minimal
theme: jekyll-theme-minimal
2 changes: 1 addition & 1 deletion _includes/JB/analytics
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
{% include custom/analytics %}
{% endcase %}

{% endif %}
{% endif %}
18 changes: 9 additions & 9 deletions _includes/JB/analytics-providers/getclicky
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ site.JB.analytics.getclicky.site_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.getclicky.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ site.JB.analytics.getclicky.site_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.getclicky.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/{{ site.JB.analytics.getclicky.site_id }}ns.gif" /></p></noscript>
2 changes: 1 addition & 1 deletion _includes/JB/analytics-providers/google
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</script>
20 changes: 10 additions & 10 deletions _includes/JB/analytics-providers/mixpanel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script type="text/javascript">
var mpq = [];
mpq.push(["init", "{{ site.JB.analytics.mixpanel.token}}"]);
(function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";
b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+
"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];
a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push(
[f].concat(Array.prototype.slice.call(arguments,0)))}};d=["init","track","track_links",
"track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<
d.length;c++){mpq[d[c]]=e(d[c])}})();
</script>
var mpq = [];
mpq.push(["init", "{{ site.JB.analytics.mixpanel.token}}"]);
(function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";
b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+
"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];
a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push(
[f].concat(Array.prototype.slice.call(arguments,0)))}};d=["init","track","track_links",
"track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<
d.length;c++){mpq[d[c]]=e(d[c])}})();
</script>
12 changes: 7 additions & 5 deletions _includes/JB/analytics-providers/piwik
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ site.JB.analytics.piwik.baseURL }}/" : "http://{{ site.JB.analytics.piwik.baseURL }}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
var pkBaseURL = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//{{ site.JB.analytics.piwik.baseURL }}/';
document.write(unescape('%3Cscript src="' + pkBaseURL + 'piwik.js" type="text/javascript"%3E%3C/script%3E'));
</script>
<script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {{ site.JB.analytics.piwik.idsite }});
var piwikTracker = Piwik.getTracker(pkBaseURL + 'piwik.php', {{ site.JB.analytics.piwik.idsite }});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://{{ site.JB.analytics.piwik.baseURL }}/piwik.php?idsite={{ site.JB.analytics.piwik.idsite }}" style="border:0" alt="" /></p></noscript>
</script>
<noscript><p><img src="//{{ site.JB.analytics.piwik.baseURL }}/piwik.php?idsite={{ site.JB.analytics.piwik.idsite }}" style="border:0" alt="" /></p></noscript>
30 changes: 15 additions & 15 deletions _includes/JB/categories_list
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ Usage:
2) include JB/categories_list
example:
<ul>
{% assign categories_list = site.categories %}
{% include JB/categories_list %}
</ul>
Notes:
{% assign categories_list = site.categories %}
{% include JB/categories_list %}
</ul>

Notes:
Categories can be either a Hash of Category objects (hashes) or an Array of category-names (strings).
The encapsulating 'if' statement checks whether categories_list is a Hash or Array.
site.categories is a Hash while page.categories is an array.

This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}

{% if site.JB.categories_list.provider == "custom" %}
{% include custom/categories_list %}
{% else %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category }}-ref">
{{ category | join: "/" }} <span>{{ site.categories[category].size }}</span>
</a></li>
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category }}-ref">
{{ category | join: "/" }} <span>{{ site.categories[category].size }}</span>
</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category[0] }}-ref">
{{ category[0] | join: "/" }} <span>{{ category[1].size }}</span>
</a></li>
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category[0] }}-ref">
{{ category[0] | join: "/" }} <span>{{ category[1].size }}</span>
</a></li>
{% endfor %}
{% endif %}
{% endif %}
{% assign categories_list = nil %}
{% assign categories_list = nil %}
2 changes: 1 addition & 1 deletion _includes/JB/comments
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
{% include custom/comments %}
{% endcase %}

{% endif %}
{% endif %}
Loading