feat: migrate to jekyll
All checks were successful
/ build-jeykll (push) Successful in 1m35s
/ build-docker (push) Successful in 27s
/ publish (push) Successful in 27s

This commit is contained in:
Matthew McKinnon 2024-10-13 15:13:06 +10:00
parent 08e23f8fce
commit 0485a32f04
50 changed files with 798 additions and 6019 deletions

View File

@ -1,21 +1,46 @@
on: push
jobs:
build-node:
build-jeykll:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ruby
run: |
apt-get update
apt-get -y install build-essential ruby-full zlib1g-dev
- name: Setup Ruby Path
run: |
export GEM_HOME="$HOME/gems
export PATH="$HOME/gems/bin:$PATH
- name: Setup Jekyll
run: |
gem install jekyll bundler
bundle install
- name: Build with Jekyll
run: |
bundle exec jekyll build
env:
JEKYLL_ENV: production
- uses: actions/upload-artifact@v3
with:
name: comprofix_site
path: _site
build-docker:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
needs: build-jeykll
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- name: Install Node Dependencies
run: npm ci
- name: Build 11ty Site
run: npm run build --if-present
- uses: actions/download-artifact@v3
with:
name: comprofix_site
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -26,7 +51,7 @@ jobs:
registry: git.comprofix.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
@ -34,9 +59,10 @@ jobs:
file: ./Dockerfile
push: true
tags: git.comprofix.com/mmckinnon/comprofix.com:latest
publish:
runs-on: ubuntu-latest
needs: build-docker
steps:
- name: checkout repo
uses: actions/checkout@v4
@ -51,9 +77,3 @@ jobs:
ssh administrator@comprofix.com "cd /opt/comprofix; docker compose down" || true
scp docker-compose.yml administrator@comprofix.com:/opt/comprofix
ssh administrator@comprofix.com "cd /opt/comprofix; docker compose pull; docker compose up -d"

View File

@ -1,59 +0,0 @@
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest
stages:
- eleventy
- docker_build
- docker_deploy
eleventy:
stage: eleventy
image: node:latest
cache:
paths:
- node_modules/
script:
- npm install
- npm run build
artifacts:
paths:
- _site/
only:
- master
docker_build:
stage: docker_build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $IMAGE_TAG --destination $IMAGE_TAG_LATEST
only:
- master
docker_deploy:
stage: docker_deploy
image: kroniak/ssh-client:3.6
script:
- mkdir ~/.ssh
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
# add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# log into Docker registry
- ssh administrator@docker.comprofix.xyz "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY"
# stop container, remove image.
- ssh administrator@docker.comprofix.xyz "cd /opt/comprofix; docker-compose down" || true
# start new container
- scp docker-compose.yml administrator@docker.comprofix.xyz:/opt/comprofix
- ssh administrator@docker.comprofix.xyz "cd /opt/comprofix; docker-compose pull; docker-compose up -d"
only:
- master

View File

@ -17,6 +17,6 @@ ENV LC_ALL=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
COPY _site/ /usr/local/apache2/htdocs/
COPY . /usr/local/apache2/htdocs/
WORKDIR /

14
Gemfile Normal file
View File

@ -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]

161
Gemfile.lock Normal file
View File

@ -0,0 +1,161 @@
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
afm (0.2.2)
async (2.17.0)
console (~> 1.26)
fiber-annotation
io-event (~> 1.6, >= 1.6.5)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.3.4)
console (1.27.0)
fiber-annotation
fiber-local (~> 1.1)
json
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.17.0)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-darwin)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.0)
forwardable-extended (2.6.0)
google-protobuf (4.28.2-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.28.2-x86_64-linux)
bigdecimal
rake (>= 13)
hashery (2.1.2)
html-proofer (5.0.9)
addressable (~> 2.3)
async (~> 2.1)
nokogiri (~> 1.13)
pdf-reader (~> 2.11)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
zeitwerk (~> 2.5)
http_parser.rb (0.8.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-event (1.7.1)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
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 (7.1.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)
json (2.7.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
pdf-reader (2.12.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.8)
rouge (4.4.0)
ruby-rc4 (0.1.5)
safe_yaml (1.0.5)
sass-embedded (1.79.5)
google-protobuf (~> 4.27)
rake (>= 13)
sass-embedded (1.79.5-arm64-darwin)
google-protobuf (~> 4.27)
sass-embedded (1.79.5-x86_64-darwin)
google-protobuf (~> 4.27)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (2.6.0)
webrick (1.8.2)
yell (2.2.2)
zeitwerk (2.6.18)
PLATFORMS
arm64-darwin
x86_64-darwin
x86_64-linux
DEPENDENCIES
html-proofer (~> 5.0)
jekyll-theme-chirpy (~> 7.1, >= 7.1.1)
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)
BUNDLED WITH
2.5.21

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Cotes Chung
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

43
README.md Normal file
View File

@ -0,0 +1,43 @@
# Chirpy Starter
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy)][gem]&nbsp;
[![GitHub license](https://img.shields.io/github/license/cotes2020/chirpy-starter.svg?color=blue)][mit]
When installing the [**Chirpy**][chirpy] theme through [RubyGems.org][gem], Jekyll can only read files in the folders
`_data`, `_layouts`, `_includes`, `_sass` and `assets`, as well as a small part of options of the `_config.yml` file
from the theme's gem. If you have ever installed this theme gem, you can use the command
`bundle info --path jekyll-theme-chirpy` to locate these files.
The Jekyll team claims that this is to leave the ball in the users court, but this also results in users not being
able to enjoy the out-of-the-box experience when using feature-rich themes.
To fully use all the features of **Chirpy**, you need to copy the other critical files from the theme's gem to your
Jekyll site. The following is a list of targets:
```shell
.
├── _config.yml
├── _plugins
├── _tabs
└── index.html
```
To save you time, and also in case you lose some files while copying, we extract those files/configurations of the
latest version of the **Chirpy** theme and the [CD][CD] workflow to here, so that you can start writing in minutes.
## Usage
Check out the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy/wiki).
## Contributing
This repository is automatically updated with new releases from the theme repository. If you encounter any issues or want to contribute to its improvement, please visit the [theme repository][chirpy] to provide feedback.
## License
This work is published under [MIT][mit] License.
[gem]: https://rubygems.org/gems/jekyll-theme-chirpy
[chirpy]: https://github.com/cotes2020/jekyll-theme-chirpy/
[CD]: https://en.wikipedia.org/wiki/Continuous_deployment
[mit]: https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE

225
_config.yml Normal file
View File

@ -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:
# jekyll-seo-tag settings https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
# ↓ --------------------------
title: Comprofix # the main title
tagline: Geek | Nerd | Systems Administrator | IT Specialist # it will display as the subtitle
description: >- # used by seo meta and the atom feed
My musings, thoughts and doumentation about my HomeLab and working in the IT industry.
# Fill in the protocol & hostname for your site.
# E.g. 'https://username.github.io', note that it does not end with a '/'.
url: "https://comprofix.com"
# github:
# username: comprofix # change to your GitHub username
twitter:
username: mckinnon81 # 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: Comprofix
#email: example@domain.com # change to your email address
links:
# The first element serves as the copyright owner's link
- https://twitter.com/mckinnon81 # change to your Twitter homepage
- https://git.comprofix.com/mmckinnon # change to your GitHub homepage
# Uncomment below to add more social links
# - https://www.facebook.com/username
# - https://www.linkedin.com/in/username
# Site Verification Settings
webmaster_verifications:
google: # 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: # fill in your Google Analytics ID
goatcounter:
id: # 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: # 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: /assets/img/man-logo.png
# 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: # [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: # <gh-username>/<repo>
issue_term: # < url | pathname | title | ...>
# Giscus options https://giscus.app
giscus:
repo: # <gh-username>/<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 `<SITE_URL>/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: "&#8617;&#xfe0e;"
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/

41
_data/contact.yml Normal file
View File

@ -0,0 +1,41 @@
# The contact options.
- type: gitea
icon: "fab fa-github"
url: https://git.comprofix.com/mmckinnon
- 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
#
# - 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

50
_data/share.yml Normal file
View File

@ -0,0 +1,50 @@
# 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: "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"

View File

@ -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

6
_posts/.placeholder Normal file
View File

@ -0,0 +1,6 @@
---
title:
date:
categories:
tags:
---

View File

@ -1,16 +1,11 @@
---
layout: layouts/post.njk
title: Reset and Restart
description: It's time to reset and restart the website.
date: 2024-09-15
author: Matthew McKinnon
date: 2024-09-05
categories: [homelab]
tags: [homelab]
image:
path: https://cdn.shopify.com/s/files/1/0286/7108/2570/articles/fixing-water-heater-reset-button-that-won_t-click-in-2-steps.jpg?v=1652267032
---
<!-- excerpt start -->
<center>
![](https://t4.ftcdn.net/jpg/08/45/37/17/360_F_845371701_1efvAwbZQVOM2I3YslbPrpNf8408z56C.jpg){width=800}
</center>
It's time to reset the website and start building my blog again. I have had this domain for a number of years and it has always been used for my E-Mail.
@ -18,7 +13,7 @@ But the website has been more of a play ground for experimenting and testing.
I am now hoping to get into the habit of writing more blog posts as I document my journey as I experiment with my HomeLab.
<!-- excerpt end -->

View File

@ -1,25 +1,18 @@
---
layout: layouts/post.njk
title: Continuous Integration & Continuous Deployment
description: Website Deployment using CI/CD Piplines
#description: Website Deployment using CI/CD Piplines
date: 2024-09-21
author: Matthew McKinnon
categories: [homelab,gitea]
tags: [homelab,git,docker,ci,cd,continuous integration,continuous deployment]
image:
path: https://cd.foundation/wp-content/uploads/sites/78/2020/09/devops.png
---
<!-- excerpt start -->
### {{ description }}
<center>
![](https://cd.foundation/wp-content/uploads/sites/78/2020/09/devops.png){width=800}
</center>
Since the reset of the website, I have been working on getting it to auto build and deploy using [Gitea Actions](https://docs.gitea.com/usage/actions/overview). Which is similar and compatible to [GitHub Actions](https://github.com/features/actions)
Before implementing the action it was a manual process which required using docker commands to login, build and push the image to the container registry.
<!-- excerpt end -->
### Why use CI/CD?
@ -120,5 +113,5 @@ jobs:
Once the new code was commited to the repo the Action was able to complete successfully.
![alt text](/assets/img/gitea-action-successful.png){width=1200}
![](/assets/img/gitea-action-successful.png)

8
_tabs/about.md Normal file
View File

@ -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
_tabs/archives.md Normal file
View File

@ -0,0 +1,5 @@
---
layout: archives
icon: fas fa-archive
order: 3
---

5
_tabs/categories.md Normal file
View File

@ -0,0 +1,5 @@
---
layout: categories
icon: fas fa-stream
order: 1
---

5
_tabs/tags.md Normal file
View File

@ -0,0 +1,5 @@
---
layout: tags
icon: fas fa-tags
order: 2
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/img/man-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

4
index.html Normal file
View File

@ -0,0 +1,4 @@
---
layout: home
# Index page
---

5163
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,264 +0,0 @@
{
"name": "comprofix-website",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "npx @11ty/eleventy",
"watch": "npx eleventy --watch",
"serve": "npx eleventy --serve",
"start": "npx eleventy --serve",
"debug": "DEBUG=* npx @11ty/eleventy"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@11ty/eleventy": "^1.0.1",
"@11ty/eleventy-fetch": "^3.0.0",
"common-tags": "^1.8.2",
"dotenv": "^16.0.1",
"eleventy-plugin-blog-tools": "^0.3.1",
"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.4",
"tailwindcss": "^3.4.11"
},
"repository": {
"type": "git",
"url": "https://gitlab.comprofix.com/comprofix/website.git"
},
"dependencies": {
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"a-sync-waterfall": "^1.0.1",
"acorn": "^7.4.1",
"ansi-regex": "^6.1.0",
"ansi-styles": "^4.3.0",
"any-promise": "^0.1.0",
"anymatch": "^3.1.3",
"arg": "^5.0.2",
"argparse": "^1.0.10",
"array-differ": "^3.0.0",
"array-union": "^2.1.0",
"array-uniq": "^1.0.3",
"arrify": "^2.0.1",
"asap": "^2.0.6",
"assert-never": "^1.3.0",
"async": "^3.2.6",
"babel-walk": "^3.0.0-canary-5",
"balanced-match": "^1.0.2",
"bcp-47": "^1.0.8",
"bcp-47-match": "^1.0.3",
"bcp-47-normalize": "^1.1.1",
"binary-extensions": "^2.3.0",
"brace-expansion": "^1.1.11",
"braces": "^3.0.3",
"call-bind": "^1.0.7",
"camelcase-css": "^2.0.1",
"chalk": "^4.1.2",
"character-parser": "^2.2.0",
"chokidar": "^3.6.0",
"color-convert": "^2.0.1",
"color-name": "^1.1.4",
"commander": "^10.0.1",
"concat-map": "^0.0.1",
"constantinople": "^4.0.1",
"cross-spawn": "^7.0.3",
"cssesc": "^3.0.0",
"debug": "^4.3.7",
"define-data-property": "^1.1.4",
"dependency-graph": "^0.11.0",
"dev-ip": "^1.0.1",
"didyoumean": "^1.2.2",
"dlv": "^1.1.3",
"doctypes": "^1.1.0",
"dom-serializer": "^1.4.1",
"domelementtype": "^2.3.0",
"domhandler": "^4.3.1",
"domutils": "^2.8.0",
"eastasianwidth": "^0.2.0",
"ee-first": "^1.1.1",
"ejs": "^3.1.10",
"emoji-regex": "^9.2.2",
"encodeurl": "^2.0.0",
"entities": "^3.0.1",
"errno": "^0.1.8",
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
"escape-html": "^1.0.3",
"escape-string-regexp": "^4.0.0",
"esprima": "^4.0.1",
"extend-shallow": "^2.0.1",
"fast-glob": "^3.3.2",
"fastq": "^1.17.1",
"filelist": "^1.0.4",
"fill-range": "^7.1.1",
"finalhandler": "^1.3.1",
"foreground-child": "^3.3.0",
"fs.realpath": "^1.0.0",
"function-bind": "^1.1.2",
"get-intrinsic": "^1.2.4",
"glob": "^7.2.3",
"glob-parent": "^5.1.2",
"gopd": "^1.0.1",
"graceful-fs": "^4.2.11",
"gray-matter": "^4.0.3",
"hamljs": "^0.6.2",
"handlebars": "^4.7.8",
"has-flag": "^4.0.0",
"has-property-descriptors": "^1.0.2",
"has-proto": "^1.0.3",
"has-symbols": "^1.0.3",
"has-tostringtag": "^1.0.2",
"hasown": "^2.0.2",
"htmlparser2": "^7.2.0",
"http-equiv-refresh": "^1.0.0",
"inflight": "^1.0.6",
"inherits": "^2.0.4",
"is-alphabetical": "^1.0.4",
"is-alphanumerical": "^1.0.4",
"is-binary-path": "^2.1.0",
"is-core-module": "^2.15.1",
"is-decimal": "^1.0.4",
"is-expression": "^4.0.0",
"is-extendable": "^0.1.1",
"is-extglob": "^2.1.1",
"is-fullwidth-code-point": "^3.0.0",
"is-glob": "^4.0.3",
"is-json": "^2.0.1",
"is-number": "^7.0.0",
"is-promise": "^2.2.2",
"is-regex": "^1.1.4",
"isexe": "^2.0.0",
"iso-639-1": "^2.1.15",
"jackspeak": "^3.4.3",
"jake": "^10.9.2",
"jiti": "^1.21.6",
"js-stringify": "^1.0.2",
"js-yaml": "^3.14.1",
"jstransformer": "^1.0.0",
"junk": "^1.0.3",
"kind-of": "^6.0.3",
"kleur": "^4.1.5",
"lilconfig": "^2.1.0",
"lines-and-columns": "^1.2.4",
"linkify-it": "^4.0.1",
"liquidjs": "^10.16.7",
"list-to-array": "^1.1.0",
"lodash.deburr": "^4.1.0",
"lru-cache": "^10.4.3",
"luxon": "^3.5.0",
"markdown-it-anchor": "^9.2.0",
"maximatch": "^0.1.0",
"mdurl": "^1.0.1",
"merge2": "^1.4.1",
"micromatch": "^4.0.8",
"mime": "^3.0.0",
"minimatch": "^3.1.2",
"minimist": "^1.2.8",
"minipass": "^3.3.6",
"mkdirp": "^0.5.6",
"moo": "^0.5.2",
"morphdom": "^2.7.4",
"ms": "^2.1.3",
"multimatch": "^5.0.0",
"mustache": "^4.2.0",
"mz": "^2.7.0",
"nanoid": "^3.3.7",
"neo-async": "^2.6.2",
"normalize-path": "^3.0.0",
"nunjucks": "^3.2.4",
"object-assign": "^4.1.1",
"object-hash": "^3.0.0",
"on-finished": "^2.4.1",
"once": "^1.4.0",
"package-json-from-dist": "^1.0.0",
"parse-srcset": "^1.0.2",
"parseurl": "^1.3.3",
"path-is-absolute": "^1.0.1",
"path-key": "^3.1.1",
"path-parse": "^1.0.7",
"path-scurry": "^1.11.1",
"path-to-regexp": "^6.3.0",
"picocolors": "^1.1.0",
"picomatch": "^2.3.1",
"pify": "^2.3.0",
"pirates": "^4.0.6",
"please-upgrade-node": "^3.2.0",
"postcss": "^8.4.45",
"postcss-import": "^15.1.0",
"postcss-js": "^4.0.1",
"postcss-load-config": "^4.0.2",
"postcss-nested": "^6.2.0",
"postcss-selector-parser": "^6.1.2",
"postcss-value-parser": "^4.2.0",
"posthtml": "^0.16.6",
"posthtml-parser": "^0.11.0",
"posthtml-render": "^3.0.0",
"posthtml-urls": "^1.0.0",
"promise": "^7.3.1",
"promise-each": "^2.2.0",
"prr": "^1.0.1",
"pug": "^3.0.3",
"pug-attrs": "^3.0.0",
"pug-code-gen": "^3.0.3",
"pug-error": "^2.1.0",
"pug-filters": "^4.0.0",
"pug-lexer": "^5.0.1",
"pug-linker": "^4.0.0",
"pug-load": "^3.0.0",
"pug-parser": "^6.0.0",
"pug-runtime": "^3.0.1",
"pug-strip-comments": "^2.0.0",
"pug-walk": "^2.0.0",
"queue-microtask": "^1.2.3",
"read-cache": "^1.0.0",
"readdirp": "^3.6.0",
"recursive-copy": "^2.0.14",
"resolve": "^1.22.8",
"reusify": "^1.0.4",
"rimraf": "^2.7.1",
"run-parallel": "^1.2.0",
"section-matter": "^1.0.0",
"semver": "^7.6.3",
"semver-compare": "^1.0.0",
"set-function-length": "^1.2.2",
"shebang-command": "^2.0.0",
"shebang-regex": "^3.0.0",
"signal-exit": "^4.1.0",
"slash": "^1.0.0",
"slugify": "^1.6.6",
"source-map": "^0.6.1",
"source-map-js": "^1.2.1",
"sprintf-js": "^1.0.3",
"ssri": "^8.0.1",
"statuses": "^2.0.1",
"string-width": "^5.1.2",
"string-width-cjs": "^4.2.3",
"strip-ansi": "^7.1.0",
"strip-ansi-cjs": "^6.0.1",
"strip-bom-string": "^1.0.0",
"sucrase": "^3.35.0",
"supports-color": "^7.2.0",
"supports-preserve-symlinks-flag": "^1.0.0",
"thenify": "^3.3.1",
"thenify-all": "^1.6.0",
"to-fast-properties": "^2.0.0",
"to-regex-range": "^5.0.1",
"token-stream": "^1.0.0",
"ts-interface-checker": "^0.1.13",
"uc.micro": "^1.0.6",
"uglify-js": "^3.19.3",
"unpipe": "^1.0.0",
"util-deprecate": "^1.0.2",
"void-elements": "^3.1.0",
"which": "^2.0.2",
"with": "^7.0.2",
"wordwrap": "^1.0.0",
"wrap-ansi": "^8.1.0",
"wrap-ansi-cjs": "^7.0.0",
"wrappy": "^1.0.2",
"ws": "^8.18.0",
"yallist": "^4.0.0",
"yaml": "^2.5.1"
},
"description": ""
}

View File

@ -1,10 +0,0 @@
{% include "layouts/header.njk" %}
<body>
<div id="blog" class="post">
{% block content %}
{{ content | safe }}
{% endblock %}
</div>
</body>
{% include "layouts/footer.njk" %}

View File

@ -1,4 +0,0 @@
{% extends "layouts/base.njk" %}
{% block head %}
{% endblock %}

View File

@ -1,13 +0,0 @@
<div class="container-footer">
<div class="footer">
<span class="footer-text">
Built with <a href="https://www.11ty.dev/" target="_blank">Eleventy</a><br>
Running on <a href="https://www.docker.com/" target="_blank">Docker</a>
<br>
Copyright <i class="fas fa-copyright"></i> - Comprofix
</span>
</div>
</div>
</html>

View File

@ -1,36 +0,0 @@
<html>
<meta charset="UTF-8">
<head>
<title>{{ title }}</title>
<link rel="stylesheet" href="/css/global.css" />
<script src="https://kit.fontawesome.com/83f4233a72.js" crossorigin="anonymous"></script>
<script src="/js/darkmode.js"></script>
<link href="https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css" rel="stylesheet" />
<div class="menu">
<ul class="menu>">
<li class="menu"><a href="/">Home</a></li>
<li class="menu"><a href="/disclaimer">Disclaimer</a></li>
<li class="menu"><a href="/blog">Blog</a></li>
<li class="menu">
<button id="modeSwitcher" class="container">
<div class="sun visible"></div>
<div class="moon">
<div class="star"></div>
<div class="star small"></div>
</div>
</button>
</li>
<!-- <li class="menu" float=right><a href="#About">Remote Support</a></li> !-->
</ul>
</div>
<div class="hero-image">
<div class="hero-text">
<h1 style="font-size:100px">Comprofix</h1>
</div>
</div>
{% block head %}
{% endblock %}
</head>

View File

@ -1,9 +0,0 @@
{% include "layouts/header.njk" %}
<body>
{% block content %}
{{ content | safe }}
{% endblock %}
</body>
{% include "layouts/footer.njk" %}

View File

@ -1,19 +0,0 @@
{% extends "layouts/blog.njk" %}
{% block head %}
{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
<p><time>{{ page.date | postDate }} </time></p>
<ul>
{% for tag in tags %}
<li>
<a href="/blog/tag/{{ tag | slugify }}">{{ tag }}</a>
</li>
{% endfor %}
</ul>
{{ content | safe }}
{% endblock %}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

View File

@ -1,29 +0,0 @@
---
layout: layouts/blog.njk
title: Blog
eleventyExcludeFromCollections: true
---
<h1>{{ title }}</h1>
{% for post in collections.posts %}
{{ post.date | postDate }}
<ul>
{# {% for post in collections.posts %} #}
<li>
<a href={{ post.url }}>{{ post.data.title }}</a>
</li>
{# {% endfor %} #}
</ul>
{% endfor %}

View File

@ -1,7 +0,0 @@
---
layout: layouts/base.njk
title: Computer Problems Fixed
eleventyExcludeFromCollections: true
---
# Coming soon!

View File

@ -1,273 +0,0 @@
.anchor-link {
margin-left: 0.5em;
font-size: 0.8em; /* Adjust size as needed */
text-decoration: none;
}
/* styles.css */
:root {
--bg-color: lightgrey;
--post-bg-color: white;
--text-color: #000000;
--button-bg-color: #000000;
--button-text-color: #ffffff;
}
/* body {
background-color: var(--bg-color);
color: var(--text-color);
font-family: Arial, sans-serif;
transition: background-color 0.3s ease, color 0.3s ease;
} */
.container {
width: 46px;
height: 46px;
box-sizing: border-box;
padding: 12px;
background: none;
border: none;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.sun {
width: 50%;
height: 50%;
position: absolute;
pointer-events: none;
opacity: 0;
transform: scale(0.6) rotate(0deg);
transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
/* white transparent for Safari */
background: radial-gradient(
circle,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0) 50%,
#f0f0f0 50%
);
}
.sun:before {
content: "";
position: absolute;
display: block;
width: 100%;
height: 100%;
background: radial-gradient(
circle,
#f0f0f0 30%,
rgba(0, 0, 0, 0) 31%,
rgba(0, 0, 0, 0) 50%,
#f0f0f0 50%
);
transform: rotate(45deg);
}
.sun.visible {
pointer-events: auto;
opacity: 1;
transform: scale(1) rotate(180deg);
transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}
.moon {
width: 50%;
height: 50%;
pointer-events: none;
position: absolute;
left: 12.5%;
top: 18.75%;
background-color: rgba(0, 0, 0, 0);
border-radius: 50%;
box-shadow: 9px 3px 0px 0px #f0f0f0;
opacity: 0;
transform: scale(0.3) rotate(65deg);
transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}
.moon.visible {
pointer-events: auto;
opacity: 1;
transform: scale(1) rotate(0deg);
transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}
.star {
position: absolute;
top: 25%;
left: 5%;
display: block;
width: 0px;
height: 0px;
border-right: 7px solid rgba(0, 0, 0, 0);
border-bottom: 5px solid #f0f0f0;
border-left: 7px solid rgba(0, 0, 0, 0);
transform: scale(0.55) rotate(35deg);
opacity: 0;
transition: all 0.2s ease-in 0.4s;
}
.star:before {
border-bottom: 5px solid #f0f0f0;
border-left: 3px solid rgba(0, 0, 0, 0);
border-right: 3px solid rgba(0, 0, 0, 0);
position: absolute;
height: 0;
width: 0;
top: -3px;
left: -5px;
display: block;
content: "";
transform: rotate(-35deg);
}
.star:after {
position: absolute;
display: block;
color: red;
top: 0px;
left: -7px;
width: 0px;
height: 0px;
border-right: 7px solid rgba(0, 0, 0, 0);
border-bottom: 5px solid #f0f0f0;
border-left: 7px solid rgba(0, 0, 0, 0);
transform: rotate(-70deg);
content: "";
}
.moon.visible .star {
opacity: 0.8;
}
.star.small {
transform: scale(0.35) rotate(35deg);
position: relative;
top: 50%;
left: 37.5%;
opacity: 0;
transition: all 0.2s ease-in 0.45s;
}
.moon.visible .star.small {
opacity: 0.7;
transform: scale(0.45) rotate(35deg);
}
button {
background-color: yellow;
display: block;
padding: 14px 16px;
text-decoration: none;
}
button:hover {
background-color: #808080;
}
body.dark-mode {
--bg-color: black;
--post-bg-color: #222222;
--text-color: #dddddd;
--button-bg-color: #ffffff;
--button-text-color: #000000;
}
body, html {
background-color: var(--bg-color);
color: var(--text-color);
/* transition: background-color 0.3s ease, color 0.3s ease; */
margin: 0;
font-family: Verdana, Menlo, Consolas, DejaVu Sans Mono, monospace;
font-size: 20px;
background-color:
}
h1 {
font-size: 32px;
}
.hero-image {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/assets/img/header.png");
height: 40%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
.hero-text {
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: -webkit-sticky; /* Safari */
position: sticky;
top: 0;
}
/*
.menu li:last-child {
float: right;
}
*/
.menu li {
float: left;
}
.menu li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
a {
color: #0f85af;
}
.menu li a:hover {
background-color: #808080;
}
.container-footer {
width: 100%;
height: 10%
}
.footer {
background: #333;
width: 100%;
height: 100%;
}
.footer-text {
text-align: left;
display: block;
color: white;
padding: 14px 16px;
}
.post {
max-width: 1200px;
margin: 20 auto;
background-color: var(--post-bg-color);
display: block;
padding: 14px 16px
}

View File

@ -1,13 +0,0 @@
---
layout: layouts/base.njk
title: Computer Problems Fixed
eleventyExcludeFromCollections: true
---
# Disclaimer:
You are 100% responsible for your own IT Infrastructure, applications, services and documentation. Comprofix.com owners, authors and contributors assume no liability or responsibility for your work. Please independently confirm anything you read on this blog before executing any changes or implementing new products or services in your own environment.
Furthermore, authors and contributors are free to express their opinions, positive or negativethey are, like all opinions, not reflective of any larger group, and do not represent the opinions of anyone else.
The opinions expressed on this site are not necessarily reflective of the opinions of any companies or employers featured or not featured on this website.

View File

@ -1,25 +0,0 @@
---
layout: layouts/homepage.njk
title: Comprofix
eleventyExcludeFromCollections: true
---
{% block content %}
{% for post in collections.posts | reverse %}
<div id="blog" class="post">
<h1>{{ post.data.title }}</h1>
{{ post.data.date | postDate }}
<P>
{% excerpt post %}
<p><a href="{{post.url}}">Read More</a></p>
</div>
{% endfor %}
{% endblock %}

View File

@ -1,26 +0,0 @@
// script.js
document.addEventListener('DOMContentLoaded', () => {
const switcher = document.getElementById('modeSwitcher');
const currentMode = localStorage.getItem('theme') || 'dark';
if (currentMode === 'dark') {
document.body.classList.add('dark-mode');
// switcher.textContent = 'Switch to Light Mode';
}
switcher.addEventListener('click', () => {
document.body.classList.toggle('dark-mode');
const mode = document.body.classList.contains('dark-mode') ? 'dark' : 'light';
// switcher.textContent = mode === 'dark' ? 'Switch to Light Mode' : 'Switch to Dark Mode';
localStorage.setItem('theme', mode);
});
const sun = document.querySelector(".sun");
const moon = document.querySelector(".moon");
const button = document.querySelector(".container");
button.addEventListener("click", () => {
sun.classList.toggle("visible");
moon.classList.toggle("visible");
})
});

View File

@ -1,24 +0,0 @@
---
pagination:
data: collections
size: 1
alias: tag
addAllPagesToCollections: true
layout: layouts/base.njk
permalink: /blog/tag/{{ tag | slugify}}/index.html
eleventyComputed:
title: Posts Tagged with {{ tag }}
eleventyExcludeFromCollections: true
---
<h1>Posts Tagged with {{ tag }}</h1>
{% for post in collections[tag] %}
<li>
<a href="{{ post.url }}">{{ post.data.title }}</a>
</li>
{% endfor %}

54
tools/run.sh Executable file
View File

@ -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"

89
tools/test.sh Executable file
View File

@ -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 "<config_a[,config_b[...]]>" 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