Skip to content

Commit

Permalink
Up and running
Browse files Browse the repository at this point in the history
  • Loading branch information
einari committed Feb 27, 2024
1 parent 832d266 commit 07765c2
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 43 deletions.
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set default behavior to automatically normalize line endings.
* text=auto

# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf

# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.ico binary
24 changes: 22 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor

# Bundler cache
.bundle
vendor
Gemfile.lock

# Jekyll cache
.jekyll-cache
_site

# RubyGems
*.gem

# NPM dependencies
node_modules
package-lock.json

# IDE configurations
.idea

# Misc
assets/js/dist
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "assets/lib"]
path = assets/lib
url = https://github.com/cotes2020/chirpy-static-assets.git
31 changes: 11 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.3.3"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem 'jekyll-feed'
gem 'jekyll-paginate'
gem 'jekyll-seo-tag'
gem 'jekyll-sitemap'

# frozen_string_literal: true

source "https://rubygems.org"

gem "jekyll-theme-chirpy", "~> 6.5", ">= 6.5.1"

group :test do
gem "html-proofer", "~> 4.4"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
Expand All @@ -34,3 +23,5 @@ gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]


60 changes: 49 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ GEM
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
ffi (1.16.3)
forwardable-extended (2.6.0)
Expand All @@ -17,6 +19,15 @@ GEM
google-protobuf (3.25.3-x86-linux)
google-protobuf (3.25.3-x86_64-darwin)
google-protobuf (3.25.3-x86_64-linux)
html-proofer (4.4.3)
addressable (~> 2.3)
mercenary (~> 0.3)
nokogiri (~> 1.13)
parallel (~> 1.10)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
zeitwerk (~> 2.5)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
Expand All @@ -36,15 +47,27 @@ GEM
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll-archives (2.2.1)
jekyll (>= 3.6, < 5.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-theme-chirpy (6.5.1)
jekyll (~> 4.3)
jekyll-archives (~> 2.2)
jekyll-include-cache (~> 0.2)
jekyll-paginate (~> 1.1)
jekyll-redirect-from (~> 0.16)
jekyll-seo-tag (~> 2.8)
jekyll-sitemap (~> 1.4)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
Expand All @@ -56,13 +79,28 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
mini_portile2 (2.8.5)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.2-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.2-arm-linux)
racc (~> 1.4)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86-linux)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down Expand Up @@ -99,8 +137,12 @@ GEM
google-protobuf (~> 3.25)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
yell (2.2.2)
zeitwerk (2.6.13)

PLATFORMS
aarch64-linux
Expand All @@ -122,13 +164,9 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
html-proofer (~> 4.4)
http_parser.rb (~> 0.6.0)
jekyll (~> 4.3.3)
jekyll-feed
jekyll-paginate
jekyll-seo-tag
jekyll-sitemap
minima (~> 2.5)
jekyll-theme-chirpy (~> 6.5, >= 6.5.1)
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc
echo "chruby ruby-3.2.3" >> ~/.zshrc # run 'chruby' to see actual version
```

```shell
bundle
```

```shell
bundle exec jekyll serve --drafts --livereload
```
```
32 changes: 25 additions & 7 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,35 @@ url: "https://ingebrigtsen.blog" # the base hostname & protocol for your site, e
twitter_username: einari
github_username: einari

social:
name: Einar Ingebrigtsen
links:
- https://twitter.com/einari
- https://github.com/einari


# collections:
# posts:
# output: true
# permalink: /:year/:month/:day/:title/

defaults:
-
scope:
path: "_posts/**/*"
type: "posts"
values:
layout: "post"
permalink: /:year/:month/:day/:title/

# Site settings
#permalink: /:title/
layout: post
markdown: kramdown
paginate: 5
paginate_path: "/:num/"
date_format: "%b %-d, %Y"

# Build settings
theme: minima
plugins:
- jekyll-feed
- jekyll-paginate
- jekyll-seo-tag
- jekyll-sitemap
theme: jekyll-theme-chirpy
theme_mode: dark
lang: en
28 changes: 28 additions & 0 deletions _data/contact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The contact options.

- type: github
icon: "fab fa-github"

- type: twitter
icon: "fa-brands fa-x-twitter"

- type: email
icon: "fas fa-envelope"
noblank: true # open link in current tab

- type: rss
icon: "fas fa-rss"
noblank: true
# Uncomment and complete the url below to enable more contact options
#
# - type: mastodon
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
# url: '' # Fill with your Mastodon account page, rel="me" will be applied for verification
#
# - type: linkedin
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
# url: '' # Fill with your Linkedin homepage
#
# - type: stack-overflow
# icon: 'fab fa-stack-overflow'
# url: '' # Fill with your stackoverflow homepage
38 changes: 38 additions & 0 deletions _data/share.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Sharing options at the bottom of the post.
# Icons from <https://fontawesome.com/>

platforms:
- type: Twitter
icon: "fa-brands fa-square-x-twitter"
link: "https://twitter.com/intent/tweet?text=TITLE&url=URL"

- type: Facebook
icon: "fab fa-facebook-square"
link: "https://www.facebook.com/sharer/sharer.php?title=TITLE&u=URL"

- type: Telegram
icon: "fab fa-telegram"
link: "https://t.me/share/url?url=URL&text=TITLE"

# Uncomment below if you need to.
#
# - type: Linkedin
# icon: "fab fa-linkedin"
# link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
#
# - type: Weibo
# icon: "fab fa-weibo"
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
#
# - type: Mastodon
# icon: "fa-brands fa-mastodon"
# # See: https://github.com/justinribeiro/share-to-mastodon#properties
# instances:
# - label: mastodon.social
# link: "https://mastodon.social/"
# - label: mastodon.online
# link: "https://mastodon.online/"
# - label: fosstodon.org
# link: "https://fosstodon.org/"
# - label: photog.social
# link: "https://photog.social/"
25 changes: 25 additions & 0 deletions _plugins/custom-posts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Jekyll
class CustomPosts < Generator
safe true
priority :high

def generate(site)
custom_files_path = "_posts"
Dir.glob(File.join(site.source, custom_files_path, "**/*.md")).each do |post_file|
process_post(site, post_file)
end
end

def process_post(site, custom_file)
post = Document.new(custom_file, {
site: site,
collection: site.collections['posts']
})

post.read

post.data["slug"] = post.data["title"]
site.collections['posts'].docs << post
end
end
end
14 changes: 14 additions & 0 deletions _plugins/posts-lastmod-hook.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
#
# Check for changed posts

Jekyll::Hooks.register :posts, :post_init do |post|

commit_num = `git rev-list --count HEAD "#{ post.path }"`

if commit_num.to_i > 1
lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"`
post.data['last_modified_at'] = lastmod_date
end

end
2 changes: 0 additions & 2 deletions _posts/2024-02-27-welcome-to-jekyll.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
layout: post
title: "Welcome to Jekyll!"
date: 2024-02-27 17:10:01 +0100
categories: jekyll update
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.

Expand Down
8 changes: 8 additions & 0 deletions _tabs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# the default layout is 'page'
icon: fas fa-info-circle
order: 4
---

> Add Markdown syntax content to file `_tabs/about.md`{: .filepath } and it will show up on this page.
{: .prompt-tip }
5 changes: 5 additions & 0 deletions _tabs/archives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: archives
icon: fas fa-archive
order: 3
---
Loading

0 comments on commit 07765c2

Please sign in to comment.