diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..262d6bd --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore index f40fbd8..2f6f888 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..58062c5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "assets/lib"] + path = assets/lib + url = https://github.com/cotes2020/chirpy-static-assets.git diff --git a/Gemfile b/Gemfile index 4cc8c39..ef0c671 100644 --- a/Gemfile +++ b/Gemfile @@ -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 @@ -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] + + diff --git a/Gemfile.lock b/Gemfile.lock index 06085f6..050304e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) @@ -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) @@ -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) @@ -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 @@ -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) diff --git a/README.md b/README.md index 78d6c24..1f0d163 100644 --- a/README.md +++ b/README.md @@ -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 -``` \ No newline at end of file +``` diff --git a/_config.yml b/_config.yml index c4440cc..06036df 100644 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/_data/contact.yml b/_data/contact.yml new file mode 100644 index 0000000..1ed228a --- /dev/null +++ b/_data/contact.yml @@ -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 +# url: '' # Fill with your Mastodon account page, rel="me" will be applied for verification +# +# - type: linkedin +# icon: 'fab fa-linkedin' # icons powered by +# url: '' # Fill with your Linkedin homepage +# +# - type: stack-overflow +# icon: 'fab fa-stack-overflow' +# url: '' # Fill with your stackoverflow homepage diff --git a/_data/share.yml b/_data/share.yml new file mode 100644 index 0000000..d572e6d --- /dev/null +++ b/_data/share.yml @@ -0,0 +1,38 @@ +# Sharing options at the bottom of the post. +# Icons from + +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/" diff --git a/_plugins/custom-posts.rb b/_plugins/custom-posts.rb new file mode 100644 index 0000000..9f17d07 --- /dev/null +++ b/_plugins/custom-posts.rb @@ -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 \ No newline at end of file diff --git a/_plugins/posts-lastmod-hook.rb b/_plugins/posts-lastmod-hook.rb new file mode 100644 index 0000000..1fd6ecf --- /dev/null +++ b/_plugins/posts-lastmod-hook.rb @@ -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 diff --git a/_posts/2024-02-27-welcome-to-jekyll.markdown b/_posts/2024-02-27-welcome-to-jekyll.markdown index 15cc29e..1149bad 100644 --- a/_posts/2024-02-27-welcome-to-jekyll.markdown +++ b/_posts/2024-02-27-welcome-to-jekyll.markdown @@ -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. diff --git a/_tabs/about.md b/_tabs/about.md new file mode 100644 index 0000000..ddb2bc4 --- /dev/null +++ b/_tabs/about.md @@ -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 } diff --git a/_tabs/archives.md b/_tabs/archives.md new file mode 100644 index 0000000..c3abc59 --- /dev/null +++ b/_tabs/archives.md @@ -0,0 +1,5 @@ +--- +layout: archives +icon: fas fa-archive +order: 3 +--- diff --git a/_tabs/categories.md b/_tabs/categories.md new file mode 100644 index 0000000..2d241be --- /dev/null +++ b/_tabs/categories.md @@ -0,0 +1,5 @@ +--- +layout: categories +icon: fas fa-stream +order: 1 +--- diff --git a/_tabs/tags.md b/_tabs/tags.md new file mode 100644 index 0000000..ded3adc --- /dev/null +++ b/_tabs/tags.md @@ -0,0 +1,5 @@ +--- +layout: tags +icon: fas fa-tags +order: 2 +---