diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..39c428d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "Jekyll", + "image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye", + "onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", + "postCreateCommand": "bash .devcontainer/post-create.sh", + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh" + }, + "extensions": [ + // Liquid tags auto-complete + "killalau.vscode-liquid-snippets", + // Liquid syntax highlighting and formatting + "Shopify.theme-check-vscode", + // Shell + "timonwong.shellcheck", + "mkhl.shfmt", + // Common formatter + "EditorConfig.EditorConfig", + "esbenp.prettier-vscode", + "stylelint.vscode-stylelint", + "yzhang.markdown-all-in-one", + // Git + "mhutchie.git-graph" + ] + } + } +} diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100644 index 0000000..a4bc282 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +if [ -f package.json ]; then + bash -i -c "nvm install --lts && nvm install-latest-npm" + npm i + npm run build +fi + +# Install dependencies for shfmt extension +curl -sS https://webi.sh/shfmt | sh &>/dev/null + +# Add OMZ plugins +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions +sed -i -E "s/^(plugins=\()(git)(\))/\1\2 zsh-syntax-highlighting zsh-autosuggestions\3/" ~/.zshrc + +# Avoid git log use less +echo -e "\nunset LESS" >>~/.zshrc diff --git a/.djlintrc b/.djlintrc deleted file mode 100644 index b3fba34..0000000 --- a/.djlintrc +++ /dev/null @@ -1 +0,0 @@ -{"ignore": "D018"} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2b740bf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +# Unix-style newlines with a newline ending every file +end_of_line = lf +insert_final_newline = true + +[*.{js,css,scss}] +quote_type = single + +[*.{yml,yaml}] +quote_type = double + +[*.md] +trim_trailing_whitespace = false 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/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index d95cf1d..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Bug report -about: Did you run into an issue? -title: '' -labels: '' -assignees: '' - ---- - -# Bug Report - -## Environment - -Zola version: -tabi commit: - -## Expected Behavior -Tell us what should have happened. - -## Current Behavior -Tell us what happens instead of the expected behavior. - -## Step to reproduce -Please provide the steps to reproduce the issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index c109080..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project. -title: '' -labels: enhancement -assignees: '' - ---- - -# Feature Request - -## Summary -Briefly describe what this feature request is about. - -## Motivation -Why should this feature be implemented? How will it benefit the project and its users? - -## Detailed Description -Please provide a detailed description of the proposed feature, including any suggestions you have for how it could be implemented. - -## Additional Context -Add any other context or screenshots about the feature request here. If this feature request is related to a problem, please describe it. diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index e728fd4..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "monthly" diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml new file mode 100644 index 0000000..cc28f99 --- /dev/null +++ b/.github/workflows/pages-deploy.yml @@ -0,0 +1,73 @@ +name: "Build and Deploy" +on: + push: + branches: + - main + - master + paths-ignore: + - .gitignore + - README.md + - LICENSE + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + # submodules: true + # If using the 'assets' git submodule from Chirpy Starter, uncomment above + # (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets) + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3 + bundler-cache: true + + - name: Build site + run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: "production" + + - name: Test site + run: | + bundle exec htmlproofer _site \ + \-\-disable-external \ + \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" + + - name: Upload site artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "_site${{ steps.pages.outputs.base_path }}" + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/zolatogithubpages.yml b/.github/workflows/zolatogithubpages.yml deleted file mode 100644 index edb9414..0000000 --- a/.github/workflows/zolatogithubpages.yml +++ /dev/null @@ -1,19 +0,0 @@ -# On every push this script is executed -on: push -name: Build and deploy GH Pages -jobs: - build: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - steps: - - name: checkout - uses: actions/checkout@v4 - - name: build_and_deploy - uses: shalzz/zola-deploy-action@v0.19.1 - env: - # Target branch - PAGES_BRANCH: gh-pages - # Provide personal access token - TOKEN: ${{ secrets.TOKEN }} - # Or if publishing to the same repo, use the automatic token - #TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index f15100b..0082d90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,27 @@ -node_modules/ -npm-debug.log -public/ -.python-version \ No newline at end of file +# Bundler cache +.bundle +vendor +Gemfile.lock + +# Jekyll cache +.jekyll-cache +.jekyll-metadata +_site + +# RubyGems +*.gem + +# NPM dependencies +node_modules +package-lock.json + +# IDE configurations +.idea +.vscode/* +!.vscode/settings.json +!.vscode/extensions.json +!.vscode/tasks.json + +# Misc +_sass/dist +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/.nojekyll b/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..082bc94 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["ms-vscode-remote.remote-containers"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5e8a04f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,30 @@ +{ + // Prettier + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + // Shopify Liquid + "files.associations": { + "*.html": "liquid" + }, + "[markdown]": { + "editor.defaultFormatter": "yzhang.markdown-all-in-one" + }, + // Formatter + "[html][liquid]": { + "editor.defaultFormatter": "Shopify.theme-check-vscode" + }, + "[shellscript]": { + "editor.defaultFormatter": "mkhl.shfmt" + }, + // Disable vscode built-in stylelint + "css.validate": false, + "scss.validate": false, + "less.validate": false, + // Stylint extension settings + "stylelint.snippet": ["css", "scss"], + "stylelint.validate": ["css", "scss"], + // Run tasks in macOS + "terminal.integrated.profiles.osx": { + "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..7f0fdb8 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,26 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Run Jekyll Server", + "type": "shell", + "command": "./tools/run.sh", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [], + "detail": "Runs the Jekyll server with live reload." + }, + { + "label": "Build Jekyll Site", + "type": "shell", + "command": "./tools/test.sh", + "group": { + "kind": "build" + }, + "problemMatcher": [], + "detail": "Build the Jekyll site for production." + } + ] +} diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..dbd3872 --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem "jekyll-theme-chirpy", "~> 7.1", ">= 7.1.1" + +gem "html-proofer", "~> 5.0", group: :test + +platforms :mingw, :x64_mingw, :mswin, :jruby do + gem "tzinfo", ">= 1", "< 3" + gem "tzinfo-data" +end + +gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] diff --git a/LICENSE b/LICENSE index 87ae70e..a35af74 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Ian Andwati +Copyright (c) 2024 Ian Andwati Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile deleted file mode 100644 index 7f8afb4..0000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/make -f - -.PHONY: all build - -BUILD_DIR := public - -all: clean build - -clean: - rm -rfd ./$(BUILD_DIR) - -build: - zola build - -serve: - zola serve - -update-zola: - @./scripts/update-zola \ No newline at end of file diff --git a/README.md b/README.md index 6f8199e..0a7b2df 100644 --- a/README.md +++ b/README.md @@ -1,67 +1 @@ -# https://andwati.github.io - - - -MY personal page and blog site. - -

- word counter pro logo - word counter pro logo -

- -

- word counter pro logo - word counter pro logo -

- -## Features - -- [ ] Dark and light themes. Defaults to the OS setting, with a switcher in the navigation bar. -- [x] Support for comments using utterances -- [x] Perfect Lighthouse score (Performance, Accessibility, Best Practices and SEO). -- [ ] [KaTeX](https://katex.org/) support. -- [x] [feed](https://andwati.github.io/rss.xml). -- [x] [Archive page](https://andwati.github.io/archive/). -- [x] [Tags](<(https://andwati.github.io/tags/)>) -- [x] Responsive design. -- [x] Code syntax highlighting. -- [x] Word Count and Reading time -- [x] Pagination - -# Generating the site - -## Steps - -1. Clone this site and enter the directory. - -``` -repo='andwati.github.io'; git clone git@github.com:andwati/${repo}.git && cd $repo -``` - -2. Install or update to the latest Zola. - -``` -make update-zola -``` - -or install zola from [Github](https://github.com/getzola/zola) - -3. Build the site! - -``` -make build -``` - -or - -``` -zola build -``` - -# Inspiration - -This website was inspired by [gruvbox](https://github.com/morhetz/gruvbox),[Reilly Tucker Siemens](https://github.com/reillysiemens/tuckersiemens.com) and many more. - -# License - -This repo is licensed under [MIT License](./LICENSE) +# Chirpy Starter \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..4382a39 --- /dev/null +++ b/_config.yml @@ -0,0 +1,225 @@ +# The Site Configuration + +# Import the theme +theme: jekyll-theme-chirpy + +# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm +# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed, +# otherwise, the layout language will use the default value of 'en'. +lang: en + +# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker +timezone: Africa/Nairobi + +# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md +# ↓ -------------------------- + +title: andwati # the main title + +tagline: Thoughts and musings # it will display as the subtitle + +description: >- # used by seo meta and the atom feed + andwati's site + +# Fill in the protocol & hostname for your site. +# E.g. 'https://username.github.io', note that it does not end with a '/'. +url: "" + +github: + username: andwati # change to your GitHub username + +twitter: + username: andwati_ # change to your Twitter username + +social: + # Change to your full name. + # It will be displayed as the default author of the posts and the copyright owner in the Footer + name: Ian Andwati + email: andwatiian@gmail.com # change to your email address + links: + # The first element serves as the copyright owner's link + - https://twitter.com/andwati_ # change to your Twitter homepage + - https://github.com/andwati # change to your GitHub homepage + # Uncomment below to add more social links + # - https://www.facebook.com/username + - https://www.linkedin.com/in/andwati + +# Site Verification Settings +webmaster_verifications: + google: lBZ8ofF4rZJjQDf6ngTrI20wzaDq9GVMCsxfZfTcllI # fill in your Google verification code + bing: # fill in your Bing verification code + alexa: # fill in your Alexa verification code + yandex: # fill in your Yandex verification code + baidu: # fill in your Baidu verification code + facebook: # fill in your Facebook verification code + +# ↑ -------------------------- +# The end of `jekyll-seo-tag` settings + +# Web Analytics Settings +analytics: + google: + id: G-3QJCKHZT3J # fill in your Google Analytics ID + goatcounter: + id: andwati # fill in your GoatCounter ID + umami: + id: # fill in your Umami ID + domain: # fill in your Umami domain + matomo: + id: # fill in your Matomo ID + domain: # fill in your Matomo domain + cloudflare: + id: # fill in your Cloudflare Web Analytics token + fathom: + id: # fill in your Fathom Site ID + +# Page views settings +pageviews: + provider: goatcounter # now only supports 'goatcounter' + +# Prefer color scheme setting. +# +# Note: Keep empty will follow the system prefer color by default, +# and there will be a toggle to switch the theme between dark and light +# on the bottom left of the sidebar. +# +# Available options: +# +# light — Use the light color scheme +# dark — Use the dark color scheme +# +theme_mode: # [light | dark] + +# The CDN endpoint for media resources. +# Notice that once it is assigned, the CDN url +# will be added to all media resources (site avatar, posts' images, audio and video files) paths starting with '/' +# +# e.g. 'https://cdn.com' +cdn: + +# the avatar on sidebar, support local or CORS resources +avatar: + +# The URL of the site-wide social preview image used in SEO `og:image` meta tag. +# It can be overridden by a customized `page.image` in front matter. +social_preview_image: # string, local or CORS resources + +# boolean type, the global switch for TOC in posts. +toc: true + +comments: + # Global switch for the post-comment system. Keeping it empty means disabled. + provider: utterances # [disqus | utterances | giscus] + # The provider options are as follows: + disqus: + shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname + # utterances settings › https://utteranc.es/ + utterances: + repo: andwati/andwati.github.io # / + issue_term: # < url | pathname | title | ...> + # Giscus options › https://giscus.app + giscus: + repo: # / + repo_id: + category: + category_id: + mapping: # optional, default to 'pathname' + strict: # optional, default to '0' + input_position: # optional, default to 'bottom' + lang: # optional, default to the value of `site.lang` + reactions_enabled: # optional, default to the value of `1` + +# Self-hosted static assets, optional › https://github.com/cotes2020/chirpy-static-assets +assets: + self_host: + enabled: # boolean, keep empty means false + # specify the Jekyll environment, empty means both + # only works if `assets.self_host.enabled` is 'true' + env: # [development | production] + +pwa: + enabled: true # The option for PWA feature (installable) + cache: + enabled: true # The option for PWA offline cache + # Paths defined here will be excluded from the PWA cache. + # Usually its value is the `baseurl` of another website that + # shares the same domain name as the current website. + deny_paths: + # - "/example" # URLs match `/example/*` will not be cached by the PWA + +paginate: 10 + +# The base URL of your site +baseurl: "" + +# ------------ The following options are not recommended to be modified ------------------ + +kramdown: + footnote_backlink: "↩︎" + syntax_highlighter: rouge + syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options + css_class: highlight + # default_lang: console + span: + line_numbers: false + block: + line_numbers: true + start_line: 1 + +collections: + tabs: + output: true + sort_by: order + +defaults: + - scope: + path: "" # An empty string here means all files in the project + type: posts + values: + layout: post + comments: true # Enable comments in posts. + toc: true # Display TOC column in posts. + # DO NOT modify the following parameter unless you are confident enough + # to update the code of all other post links in this project. + permalink: /posts/:title/ + - scope: + path: _drafts + values: + comments: false + - scope: + path: "" + type: tabs # see `site.collections` + values: + layout: page + permalink: /:title/ + +sass: + style: compressed + +compress_html: + clippings: all + comments: all + endings: all + profile: false + blanklines: false + ignore: + envs: [development] + +exclude: + - "*.gem" + - "*.gemspec" + - docs + - tools + - README.md + - LICENSE + - "*.config.js" + - package*.json + +jekyll-archives: + enabled: [categories, tags] + layouts: + category: category + tag: tag + permalinks: + tag: /tags/:name/ + category: /categories/:name/ diff --git a/_data/contact.yml b/_data/contact.yml new file mode 100644 index 0000000..5c6a518 --- /dev/null +++ b/_data/contact.yml @@ -0,0 +1,40 @@ +# The contact options. + +- type: github + icon: "fab fa-github" + +- type: twitter + icon: "fa-brands fa-x-twitter" + +- type: email + icon: "fas fa-envelope" + noblank: false # open link in current tab + +- type: rss + icon: "fas fa-rss" + noblank: false +# 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: 'https://stackoverflow.com/users/12246264/ian-andwati' # Fill with your stackoverflow homepage +# +# - type: bluesky +# icon: 'fa-brands fa-bluesky' +# url: '' # Fill with your Bluesky profile link +# +# - type: reddit +# icon: 'fa-brands fa-reddit' +# url: '' # Fill with your Reddit profile link +# +# - type: threads +# icon: 'fa-brands fa-threads' +# url: '' # Fill with your Threads profile link diff --git a/_data/share.yml b/_data/share.yml new file mode 100644 index 0000000..885231c --- /dev/null +++ b/_data/share.yml @@ -0,0 +1,50 @@ +# 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: "https://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/" + # + - type: Bluesky + icon: "fa-brands fa-bluesky" + link: "https://bsky.app/intent/compose?text=TITLE%20URL" + # + - type: Reddit + icon: "fa-brands fa-square-reddit" + link: "https://www.reddit.com/submit?url=URL&title=TITLE" + # + # - type: Threads + # icon: "fa-brands fa-square-threads" + # link: "https://www.threads.net/intent/post?text=TITLE%20URL" 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/content/posts/hello-world.md b/_posts/2022-11-04-hello-world.md similarity index 92% rename from content/posts/hello-world.md rename to _posts/2022-11-04-hello-world.md index e0eb680..f8a2bdc 100644 --- a/content/posts/hello-world.md +++ b/_posts/2022-11-04-hello-world.md @@ -1,11 +1,9 @@ -+++ -title = "Hello World" -description = "Hello world" -date = 2022-11-04 -author = "Ian Andwati" -[taxonomies] -tags = ["hugo", "blog", "go"] -+++ +--- +title : Hello World +description : Hello world +date : 2022-11-04 +tags : [hugo, blog, go] +--- How it begins diff --git a/content/posts/generate-django-secret-key.md b/_posts/2022-11-11-generate-django-secret-key.md similarity index 88% rename from content/posts/generate-django-secret-key.md rename to _posts/2022-11-11-generate-django-secret-key.md index 58b5ea2..26dccb4 100644 --- a/content/posts/generate-django-secret-key.md +++ b/_posts/2022-11-11-generate-django-secret-key.md @@ -1,11 +1,9 @@ -+++ -title = "Django Secret Key Tutorial" -description = "Managing secrets" -author = "Ian Andwati" -date = 2022-11-11T15:34:14.160Z -[taxonomies] -tags = ["tutorial", "django", "python", ".env"] -+++ +--- +title : Django Secret Key Tutorial +description : Managing secrets +date : 2022-11-11 +tags : [tutorial, django, python, .env] +--- Managing the Django SECRET_KEY variable. diff --git a/content/posts/integrating-netlify.md b/_posts/2022-11-24-integrating-netlify.md similarity index 97% rename from content/posts/integrating-netlify.md rename to _posts/2022-11-24-integrating-netlify.md index 56cc85b..03d4c20 100644 --- a/content/posts/integrating-netlify.md +++ b/_posts/2022-11-24-integrating-netlify.md @@ -1,11 +1,9 @@ -+++ -title = "Integrating Netlify CMS" -description = "Integrating netlify cms" -date = 2022-11-24T15:34:14.160Z -author = "Ian Andwati" -[taxonomies] -tags = ["blog", "hugo", "netlify","netlify-cms","github"] -+++ +--- +title : Integrating Netlify CMS +description : Integrating netlify cms +date : 2022-11-24 +tags : [blog, hugo, netlify,netlify-cms,github] +--- Migrating to a better content management system through Netlify CMS diff --git a/content/posts/semantic-version-and-conventional-commits.md b/_posts/2023-01-24-semantic-version-and-conventional-commits.md similarity index 93% rename from content/posts/semantic-version-and-conventional-commits.md rename to _posts/2023-01-24-semantic-version-and-conventional-commits.md index fb85220..3a640df 100644 --- a/content/posts/semantic-version-and-conventional-commits.md +++ b/_posts/2023-01-24-semantic-version-and-conventional-commits.md @@ -1,11 +1,10 @@ -+++ -title= "Semantic Versioning(SemVer) and Conventional Commits" -description = "Adopting best practices in your git and build workflows." -date= 2023-01-24T15:34:14.160Z -author = "Ian Andwati" -[taxonomies] -tags= ["git", "semver","workflow", "conventional commits"] -+++ +--- +title: Semantic Versioning(SemVer) and Conventional Commits +description : Adopting best practices in your git and build workflows. +date: 2023-01-24 +media_subpath: /static/ +tags: [git, semver,workflow, conventional commits] +--- Adopting best practices in your git and build workflows. diff --git a/content/posts/install-postgresql-15-on-arch-manjaro-garuda-linux.md b/_posts/2023-02-16-install-postgresql-15-on-arch-manjaro-garuda-linux.md similarity index 91% rename from content/posts/install-postgresql-15-on-arch-manjaro-garuda-linux.md rename to _posts/2023-02-16-install-postgresql-15-on-arch-manjaro-garuda-linux.md index 6a93358..8bdd562 100644 --- a/content/posts/install-postgresql-15-on-arch-manjaro-garuda-linux.md +++ b/_posts/2023-02-16-install-postgresql-15-on-arch-manjaro-garuda-linux.md @@ -1,11 +1,9 @@ -+++ -title ="Install PostgreSQL 15 on Arch | Manjaro | Garuda Linux" -description = "Installing postgresql" -date = 2023-02-16T15:34:14.160Z -author = "Ian Andwati" -[taxonomies] -tags = ["postgresql", "archlinux", "manjaro", "garuda", "linux"] -+++ +--- +title : Install PostgreSQL 15 on Arch | Manjaro | Garuda Linux +description : Installing postgresql +date : 2023-02-16 +tags : [postgresql, archlinux, manjaro, garuda, linux] +--- Getting PostgreSQL up and running on Arch Linux-based distros @@ -47,12 +45,12 @@ Postgres offers a lot of advantages that make it an excellent choice for highly Now with all that fluff out of the way, let's get to business. The steps have been tested on Arch Linux with the KDE desktop. -> **Note:** Commands that should be run as the *postgres* user are prefixed by `[postgres]$` in this article. +> **Note:** Commands that should be run as the *postgres* user are prefixed by `[postgres]` in this article. ## Step 1: Installing the PostgreSQL Package ```sh -$ sudo pacman -Syu postgresql + sudo pacman -Syu postgresql ``` This command will update the package database and update all packages on the system then install the PostgreSQL package from your distribution mirrors. Never install a package without updating the system first. On a rolling release, this can lead to an unbootable system. Installing the package will also create a system user called *postgres*. You can now switch to the *postgres* user using a privilege elevation program. @@ -62,13 +60,13 @@ You can switch to the PostgreSQL user by executing the following command: - If you have sudo and are in sudoers ```sh - $ sudo -iu postgres + sudo -iu postgres ``` - Otherwise using su: ```sh - $ su + su # su -l postgres ``` @@ -79,20 +77,20 @@ Before PostgreSQL can function correctly, the database cluster must be initializ ### 2.1 We can confirm the installed PostgreSQL version by running: ```sh -$ postgres --version ─╯ + postgres --version ─╯ postgres (PostgreSQL) 15.1 ``` ### 2.2 Set applicable entries in **/etc/locale.gen** ```sh -$ echo "en_US.UTF-8 UTF-8" | sudo tee /etc/locale.gen + echo "en_US.UTF-8 UTF-8" | sudo tee /etc/locale.gen ``` ### 2.3 Then run **\*\*locale-gen\*\*** to generate locale settings ```sh -$ sudo locale-gen + sudo locale-gen Generating locales... en_US.UTF-8... done Generation complete. @@ -117,7 +115,7 @@ sudo su - postgres ### 3.1 Check PostgreSQL status with the following command: ```sh -$ systemctl status postgresql ─╯ + systemctl status postgresql ─╯ postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; preset: disabled) Active: inactive (dead) @@ -132,13 +130,13 @@ sudo systemctl start postgresql ### 3.3 Enable the PostgreSQL service to start automatically at boot by running the following command: ```sh -$ sudo systemctl enable postgresql + sudo systemctl enable postgresql ``` ### 3.4 Verify that PostgreSQL is running by running the following command: ```sh -$ sudo systemctl status postgresql ─╯ + sudo systemctl status postgresql ─╯ ● postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled) Active: active (running) since Thu 2023-02-16 22:52:43 EAT; 20s ago @@ -155,6 +153,11 @@ $ sudo systemctl status postgresql └─26112 "postgres: logical replication launcher " ``` +# Change postgres User Password +```sh +sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$PGPASSWORD';" +``` + # Resources - [Arch Linux Wiki](https://wiki.archlinux.org/title/PostgreSQL) diff --git a/content/posts/subresource-integrity.md b/_posts/2023-04-29-subresource-integrity.md similarity index 97% rename from content/posts/subresource-integrity.md rename to _posts/2023-04-29-subresource-integrity.md index 6bb8593..8baa25c 100644 --- a/content/posts/subresource-integrity.md +++ b/_posts/2023-04-29-subresource-integrity.md @@ -1,11 +1,9 @@ -+++ -title= "Subresource Integrity" -description = "Understanding Subresource Integrity" -date= 2023-04-29 -author = "Ian Andwati" -[taxonomies] -tags= ["subresource integrity", "csp", "cors"] -+++ +--- +title: Subresource Integrity +description : Understanding Subresource Integrity +date: 2023-04-29 +tags: [subresource integrity, csp, cors] +--- Understanding Subresource Integrity diff --git a/content/posts/a-fresh-coat-of-paint.md b/_posts/2023-08-24-a-fresh-coat-of-paint.md similarity index 94% rename from content/posts/a-fresh-coat-of-paint.md rename to _posts/2023-08-24-a-fresh-coat-of-paint.md index 03069a1..622b7e9 100644 --- a/content/posts/a-fresh-coat-of-paint.md +++ b/_posts/2023-08-24-a-fresh-coat-of-paint.md @@ -1,11 +1,9 @@ -+++ -title = "A Fresh Coat Of Paint" -description = "Migrating to Zola" -author = "Ian Andwati" -date = 2023-08-24 -[taxonomies] -tags = ["zola", "blog", "tera", "rust"] -+++ +--- +title : A Fresh Coat Of Paint +description : Migrating to Zola +date : 2023-08-24 +tags : [zola, blog, tera, rust] +--- Using Zola as my preferred static site generator diff --git a/content/posts/utterances-comments.md b/_posts/2023-08-24-utterances-comments.md similarity index 93% rename from content/posts/utterances-comments.md rename to _posts/2023-08-24-utterances-comments.md index 8e16c8d..ce3e82f 100644 --- a/content/posts/utterances-comments.md +++ b/_posts/2023-08-24-utterances-comments.md @@ -1,11 +1,9 @@ -+++ -title = "What say you?" -description = "Adding a comment system by utterances" -author = "Ian Andwati" -date = 2023-08-24T15:34:14.160Z -[taxonomies] -tags = ["blog", "utterances"] -+++ +--- +title : What say you? +description : Adding a comment system by utterances +date : 2023-08-24 +tags : [blog, utterances] +--- Free speech enhanced diff --git a/content/posts/obsidian-sync.md b/_posts/2023-10-01-obsidian-sync.md similarity index 95% rename from content/posts/obsidian-sync.md rename to _posts/2023-10-01-obsidian-sync.md index 9804ade..8f67b2d 100644 --- a/content/posts/obsidian-sync.md +++ b/_posts/2023-10-01-obsidian-sync.md @@ -1,11 +1,9 @@ -+++ -title = "Setting up Obsidian sync in Windows" -description = "Syncing Obsidian in Windows with Windows Task Scheduler with git" -author = "Ian Andwati" -date = 2023-10-01 -[taxonomies] -tags = ["obsidian", "git","sync", "windows", "cron", "task scheduler", "powershell"] -+++ +--- +title : Setting up Obsidian sync in Windows +description : Syncing Obsidian in Windows with Windows Task Scheduler with git +date : 2023-10-01 +tags : [obsidian, git,sync, windows, cron, task scheduler, powershell] +--- Syncing Obsidian in Windows with Windows Task Scheduler and git diff --git a/content/posts/javascript-exporting-modules.md b/_posts/2024-01-17-javascript-exporting-modules.md similarity index 93% rename from content/posts/javascript-exporting-modules.md rename to _posts/2024-01-17-javascript-exporting-modules.md index 6edba96..80e2516 100644 --- a/content/posts/javascript-exporting-modules.md +++ b/_posts/2024-01-17-javascript-exporting-modules.md @@ -1,11 +1,8 @@ -+++ -title = "Export default and module.exports in Javascript" -description = "Modules are the building blocks of modern JavaScript applications, allowing for the encapsulation of code into reusable components. Two primary systems govern the exportation of these modules: export default in ES6 and module.exports in CommonJS. " -author = "Ian Andwati" -date = 2024-01-17 -[taxonomies] -tags = ["javascript", "node"] -+++ +--- +title : Export default and module.exports in Javascript +date : 2024-01-17 +tags : [javascript, node] +--- Javascript is a popular programming language that can run both in the browser and on the server. However, different environments may have different ways of organizing and importing Javascript modules. In this article, we will compare two common methods of exporting and importing modules: **export default** and **module.exports**. diff --git a/_tabs/about.md b/_tabs/about.md new file mode 100644 index 0000000..c97b871 --- /dev/null +++ b/_tabs/about.md @@ -0,0 +1,7 @@ +--- +# the default layout is 'page' +icon: fas fa-info-circle +order: 4 +--- + +I spend my free time working on hobby projects and sometimes I write about my experiences. In particular, I enjoy learning about programming languages,high performance computing, and how to write fast, robust, and secure code. \ No newline at end of file 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 +--- diff --git a/static/android-chrome-192x192.png b/assets/img/favicons/android-chrome-192x192.png similarity index 100% rename from static/android-chrome-192x192.png rename to assets/img/favicons/android-chrome-192x192.png diff --git a/static/android-chrome-512x512.png b/assets/img/favicons/android-chrome-512x512.png similarity index 100% rename from static/android-chrome-512x512.png rename to assets/img/favicons/android-chrome-512x512.png diff --git a/static/apple-touch-icon.png b/assets/img/favicons/apple-touch-icon.png similarity index 100% rename from static/apple-touch-icon.png rename to assets/img/favicons/apple-touch-icon.png diff --git a/static/favicon-16x16.png b/assets/img/favicons/favicon-16x16.png similarity index 100% rename from static/favicon-16x16.png rename to assets/img/favicons/favicon-16x16.png diff --git a/static/favicon-32x32.png b/assets/img/favicons/favicon-32x32.png similarity index 100% rename from static/favicon-32x32.png rename to assets/img/favicons/favicon-32x32.png diff --git a/static/favicon.ico b/assets/img/favicons/favicon.ico similarity index 100% rename from static/favicon.ico rename to assets/img/favicons/favicon.ico diff --git a/config.toml b/config.toml deleted file mode 100644 index 9df4564..0000000 --- a/config.toml +++ /dev/null @@ -1,18 +0,0 @@ -base_url = "https://andwati.github.io" -title = "Ian Andwati" -description = "Ian Andwati's personal website" - -generate_feeds = true -feed_filenames = ["rss.xml"] -minify_html = false -taxonomies = [{ name = 'tags', feed = false }] -compile_sass = true - -[markdown] -highlight_code = true -highlight_theme = "gruvbox-dark" - -[link_checker] - -[extra] -author = "Ian Andwati" diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index 00f77c0..0000000 --- a/content/_index.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -title = "Ian Andwati" -description = "Ian's Website" -+++ -I spend my free time working on [hobby projects] and sometimes I [write] about my experiences. In particular, I enjoy learning about programming languages,high performance computing, and how to write fast, robust, and secure code. - -[hobby projects]: https://github.com/andwati -[write]: /posts diff --git a/content/archive/_index.md b/content/archive/_index.md deleted file mode 100644 index 326515b..0000000 --- a/content/archive/_index.md +++ /dev/null @@ -1,4 +0,0 @@ -+++ -title = "Archive" -template = "archive.html" -+++ \ No newline at end of file diff --git a/content/contact.md b/content/contact.md deleted file mode 100644 index 3de0822..0000000 --- a/content/contact.md +++ /dev/null @@ -1,10 +0,0 @@ -+++ -title = "Contact" -description = "Let's get in touch." -+++ - -## Find me on - -- Github : [https://github.com/andwati](https://github.com/andwati) - -- Twitter : [https://twitter.com/andwati_]( https://twitter.com/andwati_) diff --git a/content/pages/_index.md b/content/pages/_index.md deleted file mode 100644 index 4df1d10..0000000 --- a/content/pages/_index.md +++ /dev/null @@ -1,7 +0,0 @@ -+++ -render = false -insert_anchor_links = "left" - -[extra] -hide_from_feed = true -+++ \ No newline at end of file diff --git a/content/posts/_index.md b/content/posts/_index.md deleted file mode 100644 index 2efa7b1..0000000 --- a/content/posts/_index.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -title = "Posts" -template = "posts.html" -page_template = "post.html" -sort_by = "date" -insert_anchor_links = "right" -paginate_by= 5 -+++ diff --git a/content/posts/file-over-app.md b/content/posts/file-over-app.md deleted file mode 100644 index 94a5e3a..0000000 --- a/content/posts/file-over-app.md +++ /dev/null @@ -1,17 +0,0 @@ -+++ -title = "File over app" -description = "Take control of your artifacts" -author = "Ian Andwati" -draft = true -date = 2024-04-22 -[taxonomies] -tags = [ "entropy", "notes"] -+++ - -Take control of your artifacts - - - -In my endless endeavors to find the perfect note taking app led me to obsidian, a note taking software that uses markdown files as the file format. All software is ephemeral in nature and your artifacts need to survive the decline of your favorite app. The files you create should be available to you and shouldn't require specialized software to access. - -Your data shouldn't be locked behind a paywall or an authentication system that is not under your control. diff --git a/index.html b/index.html new file mode 100644 index 0000000..1357b08 --- /dev/null +++ b/index.html @@ -0,0 +1,4 @@ +--- +layout: home +# Index page +--- diff --git a/sass/site.scss b/sass/site.scss deleted file mode 100644 index 522ca91..0000000 --- a/sass/site.scss +++ /dev/null @@ -1,369 +0,0 @@ -/* TODO: Future considerations. - - Reset all margin and padding for * to 0. - - Use the tag for abbreviations. - - Support footnotes or asides for notes sections. - - Support a "display title" in an [extra] section to allow for
elements - or other manual control over title display. -*/ - -@font-face { - font-family: 'Noto Serif'; - src: local('Noto Serif'), - url('fonts/NotoSerif.ttf') format("ttf"); - font-display: swap; -} - -@font-face { - font-family: 'Noto Sans'; - src: local('Noto Sans'), - url('fonts/NotoSans.ttf') format("ttf"); - font-display: swap; -} - -@font-face { - font-family: 'Noto Sans Mono'; - src: local('Noto Sans Mono'), - url('fonts/NotoSansMono.ttf') format("ttf"); - font-display: swap; -} - -:root { - /* Fonts and Text Sizes */ - --default-serif-font: "Noto Serif", serif; - --default-sans-font: "Noto Sans", sans-serif; - --default-mono-font: "Noto Sans Mono", monospace; - --default-font-size: 16px; - --header-font-size: 2em; - /* Not sure I like this as the default, but it keeps inline code blocks from - overlapping. */ - --default-line-height: 1.5; - - /* Gruvbox Dark Colors */ - --background-color: #1d2021; - --foreground-color: #ebdbb2; - --link-color: #458588; - --muted-color: #928374; - --primary-accent-color: #b16286; - --secondary-accent-color: #689d6a; - --code-background-color: #282828; - --inline-code-background-color: #3c3836; -} - -.accent { - color: var(--primary-accent-color); -} - -/* Required for sticky footer. */ -html, -body { - height: 100%; -} - -body { - display: flex; - /* Required for sticky footer. */ - flex-direction: column; - /* Required for sticky footer. */ - margin: 0; - line-height: var(--default-line-height); - font-size: var(--default-font-size); - font-family: var(--default-serif-font); - background-color: var(--background-color); - color: var(--foreground-color); - border-top: 0.5em solid var(--primary-accent-color); -} - -main { - flex: 1 0 auto; - /* Required for sticky footer. */ -} - -/* FIXME: For reasons that utterly bewilder me, an
with this id needs - to be inside a
with no id. I have a strong feeling I've done - something wrong here. */ -#content { - max-width: 48em; - margin-left: auto; - margin-right: auto; - padding-right: 1.4em; - padding-left: 1.4em; - padding-bottom: 1.4em; -} - -header { - overflow: hidden; - /* FIXME: This WILL cut off titles that are too long! */ - margin-top: 1.4em; - margin-bottom: 1.4em; - margin-left: 1em; - margin-right: 1em; -} - -header>h1 { - text-align: center; - font-size: var(--header-font-size); - font-family: var(--default-sans-font); - padding-top: 2.8rem; - margin-top: 0; - margin-bottom: 0.7rem; -} - -header .post-meta { - text-align: center; - padding-top: 0.5em; - padding-bottom: 0.9em; - margin-bottom: 0; -} - -.post-meta time { - // TODO: This color doesn't look great in with a light color scheme... - color: var(--muted-color); -} - -h2, -h3, -h4, -h5, -h6 { - padding-top: 1.2rem; - margin-bottom: 0.2rem; -} - -p { - padding-top: 0.4em; - margin-bottom: 1em; -} - -blockquote { - /* Default text uses serif, so use sans-serif to differentiate quoted text. */ - font-family: var(--default-sans-font); - font-style: italic; - /* Indent blockquotes, but align the start with where text in code begins. */ - margin: 0 1.25rem; - padding-left: 1.25rem; - padding-right: 1.25rem; - border-left: 3px solid var(--secondary-accent-color); -} - -a { - color: var(--link-color); - text-decoration: none; -} - - -/* ---- Anchor links --------------------------------------------------------*/ - -/* Add a # to the left of a subheading when it references an internal link... */ -:where(h2, h3, h4, h5, h6)>a[href^="#"]::before { - content: "#"; - display: inline-block; - width: 1.2rem; - margin-left: -1.2rem; - opacity: 0; -} - -/* ... but only display the internal anchor link when hovered over. */ -:where(h2, h3, h4, h5, h6):hover>a[href^="#"]::before { - opacity: 1; -} - -/* When internal links are linked directly, display with the accent color. */ -:where(h2, h3, h4, h5, h6):target>a[href^="#"]::before { - opacity: 1; - color: var(--primary-accent-color); -} - -/* ---- Media ---------------------------------------------------------------*/ - -img, -video { - /* Media should fill the width of its container if possible. */ - width: 100%; - height: auto; -} - -figure { - /* Don't add margins to figures. */ - margin: 0; -} - -figcaption { - /* De-emphasize figure captions. */ - font-size: 0.85rem; - color: var(--muted-color); -} - -/* ---- Tables --------------------------------------------------------------*/ - -table { - /* FIXME: Use flexbox for centering? Frankly, this is still bad on mobile. - display: flex; - justify-content: center; - */ - display: block; - overflow-x: auto; - margin-left: auto; - margin-right: auto; - text-align: left; - border-collapse: collapse; -} - -/* Headers in a row (column scoped) get a colored bottom border. */ -th[scope="col"] { - padding-top: 0.4em; - border-bottom: 3px solid var(--secondary-accent-color); -} - -/* Headers in a column (row scoped) get a colored right border. */ -th[scope="row"] { - border-right: 3px solid var(--secondary-accent-color); -} - -td { - text-align: center; - border: 1px solid var(--muted-color); -} - -th, -td { - vertical-align: bottom; - padding-left: 0.4em; - padding-right: 0.4em; - border: 1px solid var(--muted-color); -} - -/* ---- Footer, nav, and copyright ------------------------------------------*/ - -footer { - border-top: 0.5em solid var(--primary-accent-color); - text-align: center; - /* FIXME: Using the code background color could look awkward if a post ends - in a code snippet. */ - background-color: var(--code-background-color); - padding: 1.4em; - flex-shrink: 0; - /* Required for sticky footer. */ -} - -footer a { - color: var(--secondary-accent-color); -} - -/* Give footer nav links some breathing room. */ -footer>nav>a { - // margin: 0 1.4em; - margin: 0 0.4em; -} - -/* FIXME: This could probably go away with global margin/padding adjustments. */ -footer p { - padding-top: 0; -} - -footer p, -footer a { - font-family: var(--default-sans-font); - /* It doesn't seem as though Google fonts support direct usage of OpenType - features like 'c2sc' and 'smcp'. - - FIXME: It's not clear why numerals don't seem to obey this property. */ - font-variant-caps: all-small-caps; -} - -.pagination { - display: flex; - justify-content: space-between; - align-items: center; - list-style: none; - - .page-item .disabled { - opacity: 0.5; - pointer-events: none; - } - - .page-numbers { - font-size: 0.9rem; - color: var(--link-color); - } -} - -pre { - display: block; - padding: 0.25rem 1.25rem; - font-size: 85%; - border-left: 0.25rem solid var(--primary-accent-color); -} - -code { - padding: 0 0.4rem; - // background-color: #3c3836; - background-color: var(--inline-code-background-color); - /* Inline code blocks look less aggressive with a little rounding. */ - border-radius: 2px; -} - -pre, -code { - overflow: auto; - font-family: var(--default-mono-font); -} - -/* Without this the tag gains a little padding that offsets text by like - 2 pixels. Let's *not* do that. */ -pre>code { - padding: 0; - background-color: var(--code-background-color); - // Code inside a pre block doesn't need rounded borders. - border-radius: unset; -} - -/* ---- Media Queries ------------------------------------------------------ */ - -@media (min-width: 470px) { - :root { - --default-font-size: 17px; - } - - /* Above this size, increase the header margins. Smaller sizes benefit from - extra breathing room in the title. */ - header { - margin-left: 2.8em; - margin-right: 2.8em; - } -} - -@media (min-width: 625px) { - :root { - --default-font-size: 18px; - } -} - -@media (min-width: 802px) { - :root { - --default-font-size: 19px; - } -} - -@media (min-width: 1003px) { - :root { - --default-font-size: 20px; - } -} - -@media (min-width: 1225px) { - :root { - --default-font-size: 21px; - } - - /* On larger devices, give the anchor link some more space. */ - :where(h2, h3, h4, h5, h6)>a[href^="#"]::before { - width: 1.8rem; - margin-left: -1.8rem; - } -} - -@media (min-width: 1496px) { - :root { - --default-font-size: 22px; - } -} \ No newline at end of file diff --git a/screenshots/about.png b/screenshots/about.png deleted file mode 100644 index 661e16f..0000000 Binary files a/screenshots/about.png and /dev/null differ diff --git a/screenshots/archive.png b/screenshots/archive.png deleted file mode 100644 index 31352a8..0000000 Binary files a/screenshots/archive.png and /dev/null differ diff --git a/screenshots/home.png b/screenshots/home.png deleted file mode 100644 index 7050dc6..0000000 Binary files a/screenshots/home.png and /dev/null differ diff --git a/screenshots/posts.png b/screenshots/posts.png deleted file mode 100644 index 15b22a1..0000000 Binary files a/screenshots/posts.png and /dev/null differ diff --git a/scripts/update-zola b/scripts/update-zola deleted file mode 100755 index 4be3cea..0000000 --- a/scripts/update-zola +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env sh - -set -e - -: ${ZOLA_REPO='https://github.com/getzola/zola'} -: ${ZOLA_INSTALL_DIR="${HOME}/.cargo/bin"} - -# Helpers for ANSI color and logging. -name="$(basename $0)"; esc=''; reset="${esc}[0m" -red() { local string="${1}"; echo "${esc}[31m${string}${reset}"; } -yellow() { local string="${1}"; echo "${esc}[33m${string}${reset}"; } -green() { local string="${1}"; echo "${esc}[32m${string}${reset}"; } -blue() { local string="${1}"; echo "${esc}[34m${string}${reset}"; } -magenta() { local string="${1}"; echo "${esc}[35m${string}${reset}"; } -log() { local string="${1}"; echo "[$(blue $name)] ${string}"; } - -prompt_for_update() { - local current="${1}" - local latest="${2}" - - [ -n "${current}" ] \ - && installed="You're using Zola $(yellow $current)" \ - || installed="Zola is $(red 'not installed')" - - log "${installed}, but $(magenta $latest) is available." - - # Prompt for an update. Exit the entire script if declined. - read -p "$(log "Would you like to install Zola $(magenta $latest)? [y/N]: ")" answer - case $answer in - [Yy]*) log "Downloading Zola $(magenta $latest) from GitHub." ;; - [Nn]*|*) log $(red "Aborted!"); exit ;; - esac -} - -install_zola() { - local version="${1}" - local download_url="${ZOLA_REPO}/releases/download/${version}/zola-${version}-x86_64-unknown-linux-gnu.tar.gz" - - curl --progress-bar --location $download_url | tar --gunzip --extract --directory=$ZOLA_INSTALL_DIR --file - -} - -update_zola() { - # Find the current Zola version (if any). - [ -n "$(which zola 2> /dev/null)" ] && current_version=$(zola --version | awk '{print "v"$2}') - - # Find the latest available Zola version. Use --refs to avoid listing - # annotated commit objects that include the dereference syntax '^{}'. - # Find more background at https://stackoverflow.com/a/15472310. - local latest_version=$(git ls-remote --tags --refs $ZOLA_REPO | # Fetch remote tags. - sort -t '/' -k 3 -V | # Sort them by version. - tail -n 1 | # Take the latest one. - awk -F / '{print $3}') # Return only the tag. - - if [ "${current_version}" != "${latest_version}" ]; then - prompt_for_update "${current_version}" "${latest_version}" - install_zola "${latest_version}" - fi - - log "You're using Zola $(magenta $latest_version). $(green "Everything is up-to-date!")" -} - -update_zola \ No newline at end of file diff --git a/static/site.webmanifest b/static/site.webmanifest deleted file mode 100644 index 2f233ea..0000000 --- a/static/site.webmanifest +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "Ian Andwati", - "short_name": "andwati", - "icons": [ - { - "src": "/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" -} diff --git a/templates/404.html b/templates/404.html deleted file mode 100644 index ed3d876..0000000 --- a/templates/404.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends "index.html" %} -{% block title %} - 404 Not Found -{% endblock title %} -{% block meta %} - - - - - - - - - - - -{% endblock meta %} -{% block links %} -{% endblock links %} -{% block content %} -
-
- 404 Not Found -
-

Hmm...could not find that page

-
- {% include "footer.html" %} -{% endblock content %} diff --git a/templates/anchor-link.html b/templates/anchor-link.html deleted file mode 100644 index b5d7685..0000000 --- a/templates/anchor-link.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/archive.html b/templates/archive.html deleted file mode 100644 index 20ce9f3..0000000 --- a/templates/archive.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "section.html" %} -{% import "post_macros.html" as page_macros %} -{% import "paginate.html" as paginate_macro %} -{% block content %} -
-
-

Archive

-
- {% set section = get_section(path="posts/_index.md") %} - {% for year, posts in section.pages - | sort(attribute="date") - | reverse - | group_by(attribute="year") %} -
-

{{ year }}

-
    - {% for post in posts %} -
  • - - {{ post.title }} -
  • - {% endfor %} -
-
- {% endfor %} - {% if paginator %}{{ paginate_macro::paginate() }}{% endif %} -
- {% include "footer.html" %} -{% endblock content %} diff --git a/templates/comments.html b/templates/comments.html deleted file mode 100644 index 67f7334..0000000 --- a/templates/comments.html +++ /dev/null @@ -1,4 +0,0 @@ -
- -
diff --git a/templates/footer.html b/templates/footer.html deleted file mode 100644 index 9a866a7..0000000 --- a/templates/footer.html +++ /dev/null @@ -1,23 +0,0 @@ - diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 9c1d19e..0000000 --- a/templates/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - {% block title %} - {{ section.title }} - {% endblock title %} - - {% block meta %} - - - - - - - - - - - - - - {% endblock meta %} - - - - {% block links %} - - {% endblock links %} - - - {% block content %} -
-
-

{{ section.title }}

-
- {{ section.content | safe }} -
- {% include "footer.html" %} - {% endblock content %} - - diff --git a/templates/page.html b/templates/page.html deleted file mode 100644 index a179f0a..0000000 --- a/templates/page.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "index.html" %} -{% block title %} - {{ page.title }} -{% endblock title %} -{% block meta %} - - - - - - - - - - - - -{% endblock meta %} -{% block links %} - -{% endblock links %} -{% block content %} -
-
-

{{ page.title }}

-
- {{ page.content | safe }} -
- {% include "footer.html" %} -{% endblock content %} diff --git a/templates/paginate.html b/templates/paginate.html deleted file mode 100644 index 36ff663..0000000 --- a/templates/paginate.html +++ /dev/null @@ -1,27 +0,0 @@ -{% macro paginate() %} - {% if paginator %} -
-
    - {% if paginator.previous %} -
  • - ← Prev -
  • - {% else %} -
  • - ← Prev -
  • - {% endif %} -
  • {{ paginator.current_index }} of {{ paginator.number_pagers }}
  • - {% if paginator.next %} -
  • - Next → -
  • - {% else %} -
  • - Next → -
  • - {% endif %} -
-
- {% endif %} -{% endmacro paginate %} diff --git a/templates/post.html b/templates/post.html deleted file mode 100644 index 16d038a..0000000 --- a/templates/post.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "page.html" %} -{% import "post_macros.html" as page_macros %} -{% block meta %} - - - - - - - - - - - - {% for tag in page.taxonomies.tags %}{% endfor %} - - - - - -{% endblock meta %} -{% block content %} -
-
-
-

{{ page.title }}

- {{ page_macros::meta(page=page) }} -
- {{ page.content | safe }} -
-
- - {% include "comments.html" %} - {% include "footer.html" %} -{% endblock content %} diff --git a/templates/post_macros.html b/templates/post_macros.html deleted file mode 100644 index f971f8d..0000000 --- a/templates/post_macros.html +++ /dev/null @@ -1,25 +0,0 @@ -{% macro meta(page) %} - -{% endmacro meta %} -{% macro snippet(page) %} - -{% endmacro snippet %} diff --git a/templates/posts.html b/templates/posts.html deleted file mode 100644 index 6642160..0000000 --- a/templates/posts.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "section.html" %} -{% import "post_macros.html" as post_macros %} -{% import "paginate.html" as paginate_macro %} -{% block content %} -
-
-

Posts

-
- {% for page in paginator.pages %}{{ post_macros::snippet(page=page) }}{% endfor %} - {% if paginator %}{{ paginate_macro::paginate() }}{% endif %} -
- {% include "footer.html" %} -{% endblock content %} diff --git a/templates/section.html b/templates/section.html deleted file mode 100644 index 838a8cf..0000000 --- a/templates/section.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "index.html" %} -{% block title %} - {{ section.title }} -{% endblock title %} -{% block meta %} - - - - - - - - - - - - -{% endblock meta %} -{% block links %} - -{% endblock links %} -{% block content %} -
-
-

{{ section.title }}

-
- {{ section.content | safe }} -
-{% endblock content %} diff --git a/templates/tags/list.html b/templates/tags/list.html deleted file mode 100644 index f2a3c9f..0000000 --- a/templates/tags/list.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends "index.html" %} -{% block title %} - Tags -{% endblock title %} -{% block meta %} - - - - - - - - - - - - -{% endblock meta %} -{% block links %} - -{% endblock links %} -{% block content %} -
-
-

All Tags

-
- {% if terms %} -
    - {% for term in terms %} -
  • - #{{ term.name }} ({{ term.pages | length }}) -
  • - {% endfor %} -
- {% endif %} -
- {% include "footer.html" %} -{% endblock content %} diff --git a/templates/tags/single.html b/templates/tags/single.html deleted file mode 100644 index c19fb10..0000000 --- a/templates/tags/single.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "index.html" %} -{% import "post_macros.html" as post_macros %} -{% block title %} - Tag - {{ term.name }} -{% endblock title %} -{% block meta %} - - - - - - - - - - - - -{% endblock meta %} -{% block links %} - -{% endblock links %} -{% block content %} -
-
-

Posts Tagged as "{{ term.name }}"

-
- {% for page in term.pages %}{{ post_macros::snippet(page=page) }}{% endfor %} -
- {% include "footer.html" %} -{% endblock content %} diff --git a/tools/run.sh b/tools/run.sh new file mode 100755 index 0000000..0efc452 --- /dev/null +++ b/tools/run.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# +# Run jekyll serve and then launch the site + +prod=false +command="bundle exec jekyll s -l" +host="127.0.0.1" + +help() { + echo "Usage:" + echo + echo " bash /path/to/run [options]" + echo + echo "Options:" + echo " -H, --host [HOST] Host to bind to." + echo " -p, --production Run Jekyll in 'production' mode." + echo " -h, --help Print this help information." +} + +while (($#)); do + opt="$1" + case $opt in + -H | --host) + host="$2" + shift 2 + ;; + -p | --production) + prod=true + shift + ;; + -h | --help) + help + exit 0 + ;; + *) + echo -e "> Unknown option: '$opt'\n" + help + exit 1 + ;; + esac +done + +command="$command -H $host" + +if $prod; then + command="JEKYLL_ENV=production $command" +fi + +if [ -e /proc/1/cgroup ] && grep -q docker /proc/1/cgroup; then + command="$command --force_polling" +fi + +echo -e "\n> $command\n" +eval "$command" diff --git a/tools/test.sh b/tools/test.sh new file mode 100755 index 0000000..331de1c --- /dev/null +++ b/tools/test.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# +# Build and test the site content +# +# Requirement: html-proofer, jekyll +# +# Usage: See help information + +set -eu + +SITE_DIR="_site" + +_config="_config.yml" + +_baseurl="" + +help() { + echo "Build and test the site content" + echo + echo "Usage:" + echo + echo " bash $0 [options]" + echo + echo "Options:" + echo ' -c, --config "" Specify config file(s)' + echo " -h, --help Print this information." +} + +read_baseurl() { + if [[ $_config == *","* ]]; then + # multiple config + IFS="," + read -ra config_array <<<"$_config" + + # reverse loop the config files + for ((i = ${#config_array[@]} - 1; i >= 0; i--)); do + _tmp_baseurl="$(grep '^baseurl:' "${config_array[i]}" | sed "s/.*: *//;s/['\"]//g;s/#.*//")" + + if [[ -n $_tmp_baseurl ]]; then + _baseurl="$_tmp_baseurl" + break + fi + done + + else + # single config + _baseurl="$(grep '^baseurl:' "$_config" | sed "s/.*: *//;s/['\"]//g;s/#.*//")" + fi +} + +main() { + # clean up + if [[ -d $SITE_DIR ]]; then + rm -rf "$SITE_DIR" + fi + + read_baseurl + + # build + JEKYLL_ENV=production bundle exec jekyll b \ + -d "$SITE_DIR$_baseurl" -c "$_config" + + # test + bundle exec htmlproofer "$SITE_DIR" \ + --disable-external \ + --ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" +} + +while (($#)); do + opt="$1" + case $opt in + -c | --config) + _config="$2" + shift + shift + ;; + -h | --help) + help + exit 0 + ;; + *) + # unknown option + help + exit 1 + ;; + esac +done + +main