Skip to content
Open
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
/node_modules
/coverage
/lighthouse
/lighthouse-reports

# Built files (generated by GitHub Actions)
/docs/*
!/docs/.nojekyll

# Ruby/Jekyll dependencies and build files
vendor/
.bundle/
Gemfile.lock

# OS-specific files
.DS_Store
Thumbs.db
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ GEM
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
ffi (1.17.2-x64-mingw-ucrt)
ffi (1.17.2-x86_64-linux-gnu)
forwardable-extended (2.6.0)
gemoji (4.1.0)
github-pages (232)
Expand Down Expand Up @@ -237,6 +238,8 @@ GEM
uri
nokogiri (1.18.9-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
Expand Down Expand Up @@ -276,6 +279,7 @@ GEM

PLATFORMS
x64-mingw-ucrt
x86_64-linux-gnu

DEPENDENCIES
github-pages
Expand Down
175 changes: 172 additions & 3 deletions _layouts/compress.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,174 @@
---
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: 'en' }}">
{% include compress.html %}
{% comment %}
HTML compression layout for Jekyll
This layout compresses HTML output by removing whitespace and comments
{% endcomment %}

{% capture _LINE_FEED %}
{% endcapture %}

{% comment %} Check if compression should be skipped for this environment {% endcomment %}
{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs contains jekyll.environment %}
{{ content }}
{% else %}
{% comment %} Start compression processing {% endcomment %}
{% capture _content %}{{ content }}{% endcapture %}
{% assign _profile = site.compress_html.profile %}

{% comment %} Configure ending tags to remove {% endcomment %}
{% if site.compress_html.endings == "all" %}
{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}
{% else %}
{% assign _endings = site.compress_html.endings %}
{% endif %}

{% comment %} Remove ending tags {% endcomment %}
{% for _element in _endings %}
{% capture _end %}</{{ _element }}>{% endcapture %}
{% assign _content = _content | remove: _end %}
{% endfor %}
{% if _profile and _endings %}
{% assign _profile_endings = _content | size | plus: 1 %}
{% endif %}

{% comment %} Remove starting tags {% endcomment %}
{% for _element in site.compress_html.startings %}
{% capture _start %}<{{ _element }}>{% endcapture %}
{% assign _content = _content | remove: _start %}
{% endfor %}
{% if _profile and site.compress_html.startings %}
{% assign _profile_startings = _content | size | plus: 1 %}
{% endif %}

{% comment %} Configure comments to remove {% endcomment %}
{% if site.compress_html.comments == "all" %}
{% assign _comments = "<!-- -->" | split: " " %}
{% else %}
{% assign _comments = site.compress_html.comments %}
{% endif %}

{% comment %} Remove HTML comments {% endcomment %}
{% if _comments.size == 2 %}
{% capture _comment_befores %}.{{ _content }}{% endcapture %}
{% assign _comment_befores = _comment_befores | split: _comments.first %}
{% for _comment_before in _comment_befores %}
{% if forloop.first %}{% continue %}{% endif %}
{% capture _comment_outside %}
{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}
{% endcapture %}
{% capture _comment %}
{% unless _carry %}{{ _comments.first }}{% endunless %}
{{ _comment_outside | split: _comments.last | first }}
{% if _comment_outside contains _comments.last %}
{{ _comments.last }}
{% assign _carry = false %}
{% else %}
{% assign _carry = true %}
{% endif %}
{% endcapture %}
{% assign _content = _content | remove_first: _comment %}
{% endfor %}
{% if _profile %}
{% assign _profile_comments = _content | size | plus: 1 %}
{% endif %}
{% endif %}

{% comment %} Handle pre-formatted content {% endcomment %}
{% assign _pre_befores = _content | split: "<pre" %}
{% assign _content = "" %}
{% for _pre_before in _pre_befores %}
{% assign _pres = _pre_before | split: "</pre>" %}
{% assign _pres_after = "" %}
{% if _pres.size != 0 %}
{% if site.compress_html.blanklines %}
{% assign _lines = _pres.last | split: _LINE_FEED %}
{% capture _pres_after %}
{% for _line in _lines %}
{% assign _trimmed = _line | split: " " | join: " " %}
{% if _trimmed != empty or forloop.last %}
{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}
{% endif %}
{% endfor %}
{% endcapture %}
{% else %}
{% assign _pres_after = _pres.last | split: " " | join: " " %}
{% endif %}
{% endif %}
{% capture _content %}
{{ _content }}
{% if _pre_before contains "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}
{% unless _pre_before contains "</pre>" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}
{% endcapture %}
{% endfor %}
{% if _profile %}
{% assign _profile_collapse = _content | size | plus: 1 %}
{% endif %}

{% comment %} Configure elements for whitespace clipping {% endcomment %}
{% if site.compress_html.clippings == "all" %}
{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}
{% else %}
{% assign _clippings = site.compress_html.clippings %}
{% endif %}

{% comment %} Clip whitespace around elements {% endcomment %}
{% for _element in _clippings %}
{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}
{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}
{% endfor %}
{% if _profile and _clippings %}
{% assign _profile_clippings = _content | size | plus: 1 %}
{% endif %}

{% comment %} Output the compressed content {% endcomment %}
{{ _content }}

{% comment %} Output profiling table if enabled {% endcomment %}
{% if _profile %}
<table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile">
<thead>
<tr>
<td>Step</td>
<td>Bytes</td>
</tr>
</thead>
<tbody>
<tr>
<td>raw</td>
<td>{{ content | size }}</td>
</tr>
{% if _profile_endings %}
<tr>
<td>endings</td>
<td>{{ _profile_endings }}</td>
</tr>
{% endif %}
{% if _profile_startings %}
<tr>
<td>startings</td>
<td>{{ _profile_startings }}</td>
</tr>
{% endif %}
{% if _profile_comments %}
<tr>
<td>comments</td>
<td>{{ _profile_comments }}</td>
</tr>
{% endif %}
{% if _profile_collapse %}
<tr>
<td>collapse</td>
<td>{{ _profile_collapse }}</td>
</tr>
{% endif %}
{% if _profile_clippings %}
<tr>
<td>clippings</td>
<td>{{ _profile_clippings }}</td>
</tr>
{% endif %}
</tbody>
</table>
{% endif %}
{% endif %}
1 change: 0 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: compress
---
<!DOCTYPE html>
<html lang="{{ site.lang | default: 'en' }}">
Expand Down
Binary file modified assets/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/favicon.ico
Binary file not shown.
120 changes: 62 additions & 58 deletions assets/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,59 +1,63 @@
{
"name": "Kristoffer Ekstrand Portfolio",
"short_name": "Kristoffer",
"description": "Digital Project Manager & Frontend Developer in Stockholm. 20+ years in digital products.",
"start_url": "/",
"display": "standalone",
"background_color": "#3c2252",
"theme_color": "#3c2252",
"orientation": "portrait-primary",
"scope": "/",
"icons": [
{
"src": "/assets/icon-192.png",
"type": "image/png",
"sizes": "192x192",
"purpose": "any"
},
{
"src": "/assets/icon-512.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "any"
},
{
"src": "/assets/icon-mask.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
"categories": ["business", "productivity", "portfolio"],
"lang": "en",
"shortcuts": [
{
"name": "View Experience",
"short_name": "Experience",
"description": "View work experience and background",
"url": "/#work",
"icons": [
{
"src": "/assets/icon-192.png",
"sizes": "192x192"
}
]
},
{
"name": "View Projects",
"short_name": "Projects",
"description": "View personal projects and AKWF",
"url": "/#projects",
"icons": [
{
"src": "/assets/icon-192.png",
"sizes": "192x192"
}
]
}
]
}
"name": "Kristoffer Ekstrand Portfolio",
"short_name": "Kristoffer",
"description": "Digital Project Manager & Frontend Developer in Stockholm. 20+ years in digital products.",
"start_url": "/",
"display": "standalone",
"background_color": "#3c2252",
"theme_color": "#3c2252",
"orientation": "portrait-primary",
"scope": "/",
"icons": [
{
"src": "/assets/icon-192.png",
"type": "image/png",
"sizes": "192x192",
"purpose": "any"
},
{
"src": "/assets/icon-512.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "any"
},
{
"src": "/assets/icon-mask.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
"categories": [
"business",
"productivity",
"portfolio"
],
"lang": "en",
"shortcuts": [
{
"name": "View Experience",
"short_name": "Experience",
"description": "View work experience and background",
"url": "/#work",
"icons": [
{
"src": "/assets/icon-192.png",
"sizes": "192x192"
}
]
},
{
"name": "View Projects",
"short_name": "Projects",
"description": "View personal projects and AKWF",
"url": "/#projects",
"icons": [
{
"src": "/assets/icon-192.png",
"sizes": "192x192"
}
]
}
]
}
Loading