Skip to content

Commit 3a61429

Browse files
author
robertmyslivecek
committed
Initial blog
0 parents  commit 3a61429

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6440
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_site
2+
.sass-cache
3+
.jekyll-cache
4+
.jekyll-metadata
5+
vendor

404.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
permalink: /404.html
3+
layout: default
4+
---
5+
6+
<style type="text/css" media="screen">
7+
.container {
8+
margin: 10px auto;
9+
max-width: 600px;
10+
text-align: center;
11+
}
12+
h1 {
13+
margin: 30px 0;
14+
font-size: 4em;
15+
line-height: 1;
16+
letter-spacing: -1px;
17+
}
18+
</style>
19+
20+
<div class="container">
21+
<h1>404</h1>
22+
23+
<p><strong>Page not found :(</strong></p>
24+
<p>The requested page could not be found.</p>
25+
</div>

Gemfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
source "https://rubygems.org"
2+
3+
4+
gem "jekyll"
5+
6+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
7+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
8+
# gem "github-pages", group: :jekyll_plugins
9+
# If you have any plugins, put them here!
10+
group :jekyll_plugins do
11+
gem "jekyll-feed", "~> 0.12"
12+
end
13+
14+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
15+
# and associated library.
16+
platforms :mingw, :x64_mingw, :mswin, :jruby do
17+
gem "tzinfo", "~> 1.2"
18+
gem "tzinfo-data"
19+
end
20+
21+
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
22+
# do not have a Java counterpart.
23+
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

Gemfile.lock

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.8.7)
5+
public_suffix (>= 2.0.2, < 7.0)
6+
base64 (0.3.0)
7+
bigdecimal (3.2.2)
8+
colorator (1.1.0)
9+
concurrent-ruby (1.3.5)
10+
csv (3.3.5)
11+
em-websocket (0.5.3)
12+
eventmachine (>= 0.12.9)
13+
http_parser.rb (~> 0)
14+
eventmachine (1.2.7)
15+
ffi (1.17.2-arm64-darwin)
16+
forwardable-extended (2.6.0)
17+
google-protobuf (4.31.1-arm64-darwin)
18+
bigdecimal
19+
rake (>= 13)
20+
http_parser.rb (0.8.0)
21+
i18n (1.14.7)
22+
concurrent-ruby (~> 1.0)
23+
jekyll (4.4.1)
24+
addressable (~> 2.4)
25+
base64 (~> 0.2)
26+
colorator (~> 1.0)
27+
csv (~> 3.0)
28+
em-websocket (~> 0.5)
29+
i18n (~> 1.0)
30+
jekyll-sass-converter (>= 2.0, < 4.0)
31+
jekyll-watch (~> 2.0)
32+
json (~> 2.6)
33+
kramdown (~> 2.3, >= 2.3.1)
34+
kramdown-parser-gfm (~> 1.0)
35+
liquid (~> 4.0)
36+
mercenary (~> 0.3, >= 0.3.6)
37+
pathutil (~> 0.9)
38+
rouge (>= 3.0, < 5.0)
39+
safe_yaml (~> 1.0)
40+
terminal-table (>= 1.8, < 4.0)
41+
webrick (~> 1.7)
42+
jekyll-feed (0.17.0)
43+
jekyll (>= 3.7, < 5.0)
44+
jekyll-sass-converter (3.1.0)
45+
sass-embedded (~> 1.75)
46+
jekyll-watch (2.2.1)
47+
listen (~> 3.0)
48+
json (2.13.2)
49+
kramdown (2.5.1)
50+
rexml (>= 3.3.9)
51+
kramdown-parser-gfm (1.1.0)
52+
kramdown (~> 2.0)
53+
liquid (4.0.4)
54+
listen (3.9.0)
55+
rb-fsevent (~> 0.10, >= 0.10.3)
56+
rb-inotify (~> 0.9, >= 0.9.10)
57+
mercenary (0.4.0)
58+
pathutil (0.16.2)
59+
forwardable-extended (~> 2.6)
60+
public_suffix (6.0.2)
61+
rake (13.3.0)
62+
rb-fsevent (0.11.2)
63+
rb-inotify (0.11.1)
64+
ffi (~> 1.0)
65+
rexml (3.4.1)
66+
rouge (4.6.0)
67+
safe_yaml (1.0.5)
68+
sass-embedded (1.90.0-arm64-darwin)
69+
google-protobuf (~> 4.31)
70+
terminal-table (3.0.2)
71+
unicode-display_width (>= 1.1.1, < 3)
72+
unicode-display_width (2.6.0)
73+
webrick (1.9.1)
74+
75+
PLATFORMS
76+
arm64-darwin-24
77+
78+
DEPENDENCIES
79+
http_parser.rb (~> 0.6.0)
80+
jekyll
81+
jekyll-feed (~> 0.12)
82+
tzinfo (~> 1.2)
83+
tzinfo-data
84+
85+
BUNDLED WITH
86+
2.4.10

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generative-computing-blog
2+
3+
## TODO
4+
5+
### Setup environment:
6+
```
7+
brew install rbenv ruby-build
8+
rbenv install 3.2.2
9+
rbenv global 3.2.2
10+
export PATH="$HOME/.rbenv/bin:$PATH"
11+
eval "$(rbenv init - zsh)"
12+
ruby -v # Should be 3.2.2
13+
gem install bundle
14+
bundle install
15+
bundle exec jekyll serve
16+
```

_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: Generative computing blog
2+
description: >-
3+
Generative computing blog
4+
baseurl: ""
5+
url: ""
6+
7+
plugins:
8+
- jekyll-feed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css">
2+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
3+
<!-- and it's easy to individually load additional languages -->
4+
<script charset="UTF-8"
5+
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"
6+
async></script>
7+
8+
{%- assign name = 'code_badge.enabled' -%}
9+
{%- include functions.html func='get_value' default='true' -%}
10+
{%- assign badge_enabled = return -%}
11+
12+
{%- assign name = 'code_badge.color' -%}
13+
{%- include functions.html func='get_value' default='#fff' -%}
14+
{%- assign badge_color = return -%}
15+
16+
{%- assign name = 'code_badge.background_color' -%}
17+
{%- include functions.html func='get_value' default='#ff4e00' -%}
18+
{%- assign badge_background_color = return -%}
19+
20+
{%- assign name = 'code_badge.text_transform' -%}
21+
{%- include functions.html func='get_value' default='uppercase' -%}
22+
{%- assign badge_text_transform = return -%}
23+
24+
<script>
25+
// Init highlight js
26+
document.addEventListener('DOMContentLoaded', function(event) {
27+
var els = document.querySelectorAll('pre code')
28+
29+
function addLangData(block) {
30+
var outer = block.parentElement.parentElement.parentElement;
31+
var lang = block.getAttribute('data-lang');
32+
for (var i = 0; i < outer.classList.length; i++) {
33+
var cls = outer.classList[i];
34+
if (cls.startsWith('language-')) {
35+
lang = cls;
36+
break;
37+
}
38+
}
39+
if (!lang) {
40+
cls = block.getAttribute('class');
41+
lang = cls ? cls.replace('hljs ', '') : '';
42+
}
43+
if (lang.startsWith('language-')) {
44+
lang = lang.substr(9);
45+
}
46+
block.setAttribute('class', 'hljs ' + lang);
47+
block.parentNode.setAttribute('data-lang', lang);
48+
}
49+
50+
function addBadge(block) {
51+
var enabled = ('{{ badge_enabled }}' || 'true').toLowerCase();
52+
if (enabled == 'true') {
53+
var pre = block.parentElement;
54+
pre.classList.add('badge');
55+
}
56+
}
57+
58+
function handle(block) {
59+
addLangData(block);
60+
addBadge(block)
61+
hljs.highlightBlock(block);
62+
}
63+
64+
for (var i = 0; i < els.length; i++) {
65+
var el = els[i];
66+
handle(el);
67+
}
68+
});
69+
</script>
70+
71+
<style>
72+
/* fix wrong badge display for firefox browser */
73+
code > table pre::before {
74+
display: none;
75+
}
76+
</style>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script>
2+
function hashLocate(hashValue) {
3+
hashValue = hashValue.replace(/^.*#h-/, '');
4+
hashValue = decodeURIComponent(hashValue);
5+
var element = document.getElementById(hashValue);
6+
7+
if (!element) {
8+
return;
9+
}
10+
11+
var header = document.querySelector('header.site-header');
12+
var headerRect = header.getBoundingClientRect();
13+
var headerTop = Math.floor(headerRect.top);
14+
var headerHeight = Math.floor(headerRect.height);
15+
var scrollPos = getScrollPos();
16+
var offsetY = element.offsetTop - (headerTop + headerHeight + 20);
17+
18+
if (offsetY == scrollPos.y) {
19+
return;
20+
}
21+
22+
if (headerTop == 0 && offsetY > scrollPos.y) {
23+
offsetY += headerHeight + 2;
24+
} else if (headerTop < 0 && offsetY < scrollPos.y) {
25+
offsetY -= headerHeight - 2;
26+
}
27+
28+
smoothScrollTo(offsetY);
29+
}
30+
31+
// The first event occurred
32+
window.addEventListener('load', function(event) {
33+
if (window.location.hash) {
34+
hashLocate(window.location.hash);
35+
}
36+
});
37+
38+
// The first event occurred
39+
window.addEventListener('click', function(event) {
40+
if (event.target.tagName.toLowerCase() == 'a') {
41+
hashLocate(event.target.getAttribute('href'));
42+
}
43+
});
44+
</script>

_includes/functions.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{%- assign params = include -%}
2+
{%- if params.func -%}
3+
{%- assign func = params.func -%}
4+
{%- endif -%}
5+
6+
{%- assign include_path = func -%}
7+
{%- assign path_array = include_path | split: '.' -%}
8+
{%- if path_array.size == 1 -%}
9+
{%- assign include_path = include_path | append: '.html' -%}
10+
{%- endif -%}
11+
12+
{%- if func == 'log' -%}
13+
{%- include functions/log.html level=include.level msg=include.msg -%}
14+
{%- else -%}
15+
{%- assign include_path = 'functions/' | append: include_path -%}
16+
{%- include {{ include_path }} params=params-%}
17+
{%- endif -%}
18+
19+
{%- if return == nil -%}
20+
{%- assign return = include.default -%}
21+
{%- endif -%}
22+
23+
{%- if func != 'log' -%}
24+
{%- assign msg = '[function]['
25+
| append: {{func}}
26+
| append: '] '
27+
| append: {{return}}
28+
-%}
29+
{%- include functions.html func='log' level='info' -%}
30+
{%- endif -%}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{% if include.params.article %}
2+
{% assign article = include.params.article %}
3+
{% endif %}
4+
5+
{% if include.params.lang %}
6+
{% assign lang = include.params.lang %}
7+
{% else %}
8+
{% assign lang = lang | default: site.lang | default: "en" %}
9+
{% endif %}
10+
11+
{% if include.params.excerpt_size %}
12+
{% assign excerpt_size = include.params.excerpt_size %}
13+
{% else %}
14+
{% assign excerpt_size = excerpt_size
15+
| default: site.excerpt.text_size
16+
| default: 350 %}
17+
{% endif %}
18+
19+
{%- include functions.html func='get_article_words' -%}
20+
{% assign words = return %}
21+
22+
{% assign _article = article | strip_html %}
23+
{% assign _words = _article | size %}
24+
25+
{% assign _size = excerpt_size %}
26+
27+
{% if lang != "en" %}
28+
{% assign _size = words
29+
| times: 1.0
30+
| divided_by: _words
31+
| times: _size
32+
| round %}
33+
{% endif %}
34+
35+
{% if _size > excerpt_size %}
36+
{% assign _size = excerpt_size %}
37+
{% endif %}
38+
39+
{% assign return = _article | truncate: _size %}

0 commit comments

Comments
 (0)