Skip to content

Commit

Permalink
Size optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kotet committed Sep 22, 2023
1 parent 087fbc7 commit b4704e2
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 70 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
},
"terminal.integrated.defaultProfile.linux": "bash",
"files.insertFinalNewline": false
},
"extensions": [
"ms-azuretools.vscode-docker",
Expand Down
5 changes: 1 addition & 4 deletions 404.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
Expand All @@ -15,10 +14,8 @@
letter-spacing: -1px;
}
</style>

<div class="container">
<div>
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
source 'https://rubygems.org'
gem "github-pages", "~> 228", group: :jekyll_plugins

gem "webrick", "~> 1.8"
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ markdown: kramdown
sass:
style: compressed

# use custom theme
theme: null

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
Expand All @@ -42,3 +45,4 @@ exclude:
- vendor/gems/
- vendor/ruby/
- README.md
- LICENSE
11 changes: 1 addition & 10 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% include head/style.html %}
<title>{% if page.tags %}#{{ page.tags[0] }} {% endif %}{% if page.title %}{{ page.title | escape }} - {{ site.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">
{% if page.mathjax %}{% include head/mathjax.html %}{% endif %}
{% if jekyll.environment == 'production' and site.google_analytics %}{% include head/google-analytics.html %}{% endif %}
{% if jekyll.environment == 'production' and site.twitter_cards %}{% include head/twitter-cards.html %}{% endif %}
</head>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">{% include head/style.html %}<title>{% if page.tags %}#{{ page.tags[0] }} {% endif %}{% if page.title %}{{ page.title | escape }} - {{ site.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title><meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">{% if page.mathjax %}{% include head/mathjax.html %}{% endif %}{% if jekyll.environment == 'production' and site.google_analytics %}{% include head/google-analytics.html %}{% endif %}{% if jekyll.environment == 'production' and site.twitter_cards %}{% include head/twitter-cards.html %}{% endif %}</head>
8 changes: 1 addition & 7 deletions _includes/head/google-analytics.html
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
<script defer src="//www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
<script defer src="//www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '{{ site.google_analytics }}');</script>
2 changes: 1 addition & 1 deletion _includes/head/style.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% capture styles %}{% include head/style.scss %}{% endcapture %}<style>{{ styles | scssify }}</style>
<link rel="stylesheet" href="{% include relative %}/style.css">
2 changes: 0 additions & 2 deletions _includes/head/style.scss

This file was deleted.

12 changes: 2 additions & 10 deletions _includes/head/twitter-cards.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@{{ site.twitter_username }}" />
{% if page.title %}
<meta name="twitter:title" content="{{ page.title | escape }} - {{ site.title | escape }}" />
{% else %}
<meta name="twitter:title" content="{{ site.title }}" />
{% endif %}
{% if page.title %}<meta name="twitter:title" content="{{ page.title | escape }} - {{ site.title | escape }}" />{% else %}<meta name="twitter:title" content="{{ site.title }}" />{% endif %}
<meta name="twitter:description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}" />
{% if page.image %}
<meta name="twitter:image" content="{{ site.url }}/assets/{{ page.image }}" />
{% else %}
<meta name="twitter:image" content="{{ site.url }}/assets/logo.png" />
{% endif %}
{% if page.image %}<meta name="twitter:image" content="{{ site.url }}/assets/{{ page.image }}" />{% else %}<meta name="twitter:image" content="{{ site.url }}/assets/logo.png" />{% endif %}
13 changes: 3 additions & 10 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@
<header>
<a class="site-title" href="{% include relative %}" >{{ site.title }}</a>
<div style="display: inline-block">
{% for my_page in site.pages %}{% if my_page.title and my_page.noindex != true %}
| <a href="{% include relative %}{{ my_page.url | relative_url }}">{{ my_page.title }}</a>
{% endif %}{% endfor %}
{% for my_page in site.pages %}{% if my_page.title and my_page.noindex != true %} | <a href="{% include relative %}{{ my_page.url | relative_url }}">{{ my_page.title }}</a>{% endif %}{% endfor %}
</div>

</header>
<hr>
<main>
<div class="content-wrapper">
{{ content }}
</div>
</main>
<main><div class="content-wrapper">{{ content }}</div></main>
<hr>
<footer>
{% capture footer-md %}{% include footer.md %}{% endcapture %}{{ footer-md | markdownify }}
</footer>
</body>
</html>
</html>
10 changes: 4 additions & 6 deletions _layouts/home.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
layout: default
---
<div class="home">
<span class="post-counter" >{{ site.posts | size }} Posts</span>
<div style="padding: 1em;">
<span style="font-weight: bold;" >{{ site.posts | size }} Posts</span>
<ul>
{% for post in site.posts %}
<li>
<a href="{% include relative %}{{ post.url | relative_url }}">{{ post.title | escape }}</a>
<p class="post-info">
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%b %-d, %Y" }}</time>
{% for tag in post.tags %}
| <a href="{% include relative %}/tags/#{{ tag | downcase }}">#{{ tag }}</a>
{% endfor %}
{% for tag in post.tags %} | <a href="{% include relative %}/tags/#{{ tag | downcase }}">#{{ tag }}</a>{% endfor %}
</p>
</li>
{% endfor %}
</ul>
</div>
</div>
6 changes: 2 additions & 4 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
layout: default
---
<article>
<div class="post-header">
<h1>{{ page.title | escape }}</h1>
</div>
<div class="post-header"><h1>{{ page.title | escape }}</h1></div>
{{ content }}
</article>
</article>
9 changes: 3 additions & 6 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
<article>
<div class="post-header">
<h1>
<a href="{% include relative %}/tags/#{{ page.tags[0] | downcase }}">#{{ page.tags[0] }}</a>
{{ page.title | escape }}
<a href="{% include relative %}/tags/#{{ page.tags[0] | downcase }}">#{{ page.tags[0] }}</a> {{ page.title | escape }}
</h1>
<p class="post-info">
<time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%b %-d, %Y" }}</time>
{% for tag in page.tags %}
| <a href="{% include relative %}/tags/#{{ tag | downcase }}">#{{ tag }}</a>
{% endfor %}
{% for tag in page.tags %} | <a href="{% include relative %}/tags/#{{ tag | downcase }}">#{{ tag }}</a>{% endfor %}
</p>
</div>
{{ content }}
</article>
</article>
12 changes: 2 additions & 10 deletions _sass/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,9 @@ header,footer {
padding: 10px;
}

.home {
padding: 1em;
}

.site-title {
color: $text-color;
font-weight: bold;
}

.post-counter {
font-weight: bold;
font-weight: bold;
}

.post-info {
Expand All @@ -57,4 +49,4 @@ table {
* {
max-width: 100%;
}
}
}
4 changes: 4 additions & 0 deletions style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---
@import "base";
@import "syntax-highlighting";

0 comments on commit b4704e2

Please sign in to comment.