Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
05ca2fc
Start with a linting workflow
dannystaple Apr 19, 2025
84bd7ab
Merge branch 'master' into workflow-infra-fixes
dannystaple Apr 19, 2025
1255971
We want output in the PR.
dannystaple Apr 19, 2025
ff05a0e
Improve this dockerfile
dannystaple Apr 19, 2025
a808ba3
Fix odd utf-8 issue.
dannystaple Apr 19, 2025
a7ae9e6
Ignore some linters.
dannystaple Apr 19, 2025
3c0bcd3
Pin some github action version hashes
dannystaple Apr 19, 2025
82edd67
Merge branch 'workflow-infra-fixes' of https://github.com/orionrobots…
dannystaple Apr 19, 2025
161b67b
Yes that is a little better
dannystaple Apr 19, 2025
9d98939
Sort out shellcheck
dannystaple Apr 19, 2025
93570f9
Add an editorconfig - no tabs please.
dannystaple Apr 19, 2025
e3c3abc
Disable a bunch of linters for now. We can attack more later.
dannystaple Apr 19, 2025
340bcce
Move megalinter config to yaml file
dannystaple Apr 19, 2025
1119747
Doh
dannystaple Apr 19, 2025
385cf4a
Style fixes
dannystaple Apr 19, 2025
607b589
Ignore the whole drafts folder
dannystaple Apr 19, 2025
3affc8f
Disable grype until it's fixed
dannystaple Apr 19, 2025
b58b2fe
Format
dannystaple Apr 19, 2025
7613ff8
Line endings
dannystaple Apr 19, 2025
7780320
We don't have those files. Why is that here?
dannystaple Apr 19, 2025
7b33f14
Stupid little thing
dannystaple Apr 19, 2025
9a9f6f1
Formatting
dannystaple Apr 19, 2025
7153bcd
Disable a few more
dannystaple Apr 19, 2025
8cfd6fc
Try ignore drafts this way (no leading slash)
dannystaple Apr 19, 2025
b55e4cd
Allow continue on error for now - we can then whittle those down with…
dannystaple Apr 19, 2025
7d8bfbb
Come on
dannystaple Apr 19, 2025
d9f8bb3
Too many extra lines
dannystaple Apr 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
tab_width = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*{sh,py}]
indent_size = 4
96 changes: 48 additions & 48 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const {

const media_filetypes = "jpg,jpeg,JPG,png,gif,svg,avif";

module.exports = function(eleventyConfig) {
module.exports = function (eleventyConfig) {
// Configure markdown parser
const markdownLib = markdownIt({html: true, typographer: true});
const markdownLib = markdownIt({ html: true, typographer: true });
markdownLib.use(markdownItAnchor);
markdownLib.use(markdownItAttrs);

eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.addPlugin(fortawesomeBrandsPlugin);
eleventyConfig.addPlugin(syntaxHighlight);
Expand All @@ -38,8 +38,8 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("favicon.png");
eleventyConfig.addPassthroughCopy("galleries/**/*." + media_filetypes);
eleventyConfig.addPassthroughCopy("google5458abc1104b04dd.html");
eleventyConfig.addPassthroughCopy({"htaccess": ".htaccess"});
eleventyConfig.addPassthroughCopy({"content": "."}, {
eleventyConfig.addPassthroughCopy({ "htaccess": ".htaccess" });
eleventyConfig.addPassthroughCopy({ "content": "." }, {
filter: ["**/*." + + media_filetypes],
rename: function (path) {
return path.replace("content/", "");
Expand All @@ -49,7 +49,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addWatchTarget("src/**/*");
let $collectionApi = null;

eleventyConfig.addCollection("posts", function(collectionApi) {
eleventyConfig.addCollection("posts", function (collectionApi) {
$collectionApi = collectionApi;
return collectionApi.getFilteredByGlob("_posts/*.md");
});
Expand All @@ -58,55 +58,55 @@ module.exports = function(eleventyConfig) {
dynamicPartials: false,
});

eleventyConfig.addFilter("cssmin", function(code) {
eleventyConfig.addFilter("cssmin", function (code) {
return new CleanCSS({}).minify(code).styles;
});

eleventyConfig.addShortcode("image", async function(src, alt, sizes) {
eleventyConfig.addShortcode("image", async function (src, alt, sizes) {
let metadata = await fetch_image(src);

let imageAttributes = {
alt,
sizes,
loading: "lazy",
decoding: "async",
};
let imageAttributes = {
alt,
sizes,
loading: "lazy",
decoding: "async",
};

// You bet we throw an error on a missing alt (alt="" works okay)
return Image.generateHTML(metadata, imageAttributes);
});
// You bet we throw an error on a missing alt (alt="" works okay)
return Image.generateHTML(metadata, imageAttributes);
});

eleventyConfig.addShortcode("img_responsive", async function(src, alt, sizes="100vw, 720, 820, 940, 1140, 1280") {
eleventyConfig.addShortcode("img_responsive", async function (src, alt, sizes = "100vw, 720, 820, 940, 1140, 1280") {
let metadata = await fetch_image(src);
let imageAttributes = {
alt,
sizes,
let imageAttributes = {
alt,
sizes,
class: "img-responsive",
loading: "lazy",
decoding: "async",
};
loading: "lazy",
decoding: "async",
};

return Image.generateHTML(metadata, imageAttributes);
return Image.generateHTML(metadata, imageAttributes);
});

eleventyConfig.addShortcode("image_with_class", async function(src, alt, sizes, class_names) {
eleventyConfig.addShortcode("image_with_class", async function (src, alt, sizes, class_names) {
let metadata = await fetch_image(src);

if (sizes==undefined || sizes=="_") {
sizes="720, 940, 1140, 1280, 2048";
if (sizes == undefined || sizes == "_") {
sizes = "720, 940, 1140, 1280, 2048";
}

let imageAttributes = {
alt,
sizes,
let imageAttributes = {
alt,
sizes,
class: class_names,
loading: "lazy",
decoding: "async",
};
loading: "lazy",
decoding: "async",
};

// You bet we throw an error on a missing alt (alt="" works okay)
return Image.generateHTML(metadata, imageAttributes);
});
// You bet we throw an error on a missing alt (alt="" works okay)
return Image.generateHTML(metadata, imageAttributes);
});

// Thumbnails
eleventyConfig.addShortcode("thumbnail_for_post", thumbnails.thumbnail_for_post);
Expand All @@ -124,15 +124,15 @@ module.exports = function(eleventyConfig) {
});

// Liquid filter to convert a date to a string
eleventyConfig.addLiquidFilter("to_utc_string", date => date.toUTCString() );
eleventyConfig.addLiquidFilter("to_utc_string", date => date.toUTCString());

// Liquid filter for long date string
eleventyConfig.addLiquidFilter("date_to_long_string", function(date) {
eleventyConfig.addLiquidFilter("date_to_long_string", function (date) {
return date.toLocaleDateString("en-GB", { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
});

// Universal filter for jsonify
eleventyConfig.addFilter("jsonify", JSON.stringify );
eleventyConfig.addFilter("jsonify", JSON.stringify);

eleventyConfig.addFilter("with_explicit_date", items => items.filter(item => "date" in item.data));

Expand All @@ -142,14 +142,14 @@ module.exports = function(eleventyConfig) {

// Read the menu data from _config.yml and add it to the global data
eleventyConfig.addGlobalData("menu", () => getDataFromConfigYaml("menu"));
eleventyConfig.addGlobalData("site_title", () => getDataFromConfigYaml("title"));
eleventyConfig.addGlobalData("site_tagline", () => getDataFromConfigYaml("tagline"));
eleventyConfig.addGlobalData("production_url", () => getDataFromConfigYaml("production_url"));
eleventyConfig.addGlobalData("JB", () => getDataFromConfigYaml("JB"));
eleventyConfig.addGlobalData("author", () => getDataFromConfigYaml("author"));
eleventyConfig.addGlobalData("now" , () => new Date());

eleventyConfig.addNunjucksFilter("date", function(date, format) {
eleventyConfig.addGlobalData("site_title", () => getDataFromConfigYaml("title"));
eleventyConfig.addGlobalData("site_tagline", () => getDataFromConfigYaml("tagline"));
eleventyConfig.addGlobalData("production_url", () => getDataFromConfigYaml("production_url"));
eleventyConfig.addGlobalData("JB", () => getDataFromConfigYaml("JB"));
eleventyConfig.addGlobalData("author", () => getDataFromConfigYaml("author"));
eleventyConfig.addGlobalData("now", () => new Date());

eleventyConfig.addNunjucksFilter("date", function (date, format) {
return moment(date).format(format);
});

Expand Down
36 changes: 14 additions & 22 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# Auto detect text files and perform LF normalization
* text=lf

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
# Auto detect text files and perform LF normalization
* text=lf

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ updates:
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

- package-ecosystem: "npm"
directory: "/"
versioning-strategy: auto
Expand All @@ -18,3 +19,4 @@ updates:
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

14 changes: 7 additions & 7 deletions .github/scripts/new_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ function create_post {
local file_path="$1"
echo "Creating post at $file_path"
touch "$file_path"
echo "---" >> "$file_path"
echo "title: $POST_TITLE" >> "$file_path"
echo "date: $POST_DATE" >> "$file_path"
echo "draft: true" >> "$file_path"
echo "---" >> "$file_path"
(
echo "---"
echo "title: $POST_TITLE"
echo "date: $POST_DATE"
echo "draft: true"
echo "---"
) >"$file_path"
}

function main {
Expand All @@ -47,5 +49,3 @@ function main {
}

main


4 changes: 2 additions & 2 deletions .github/workflows/on_call_build_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
tar -czf _site.tar.gz _site

- name: upload site artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: _site
path: _site.tar.gz
if-no-files-found: error

- name: upload httpd.conf artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: httpd.conf
path: _drafts/staging/httpd.conf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_call_staging_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Fetch site artifact
uses: actions/download-artifact@v4.1.8
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
name: _site
- name: extract site artifact
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/on_pr_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: "On PR Lint"
on:
pull_request:
branches:
- master

jobs:
check_dependabot:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Check Changes
id: changed-env
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
with:
files: |
.github/dependabot.yml

- if: |
steps.changed-env.outputs.any_modified == 'true'
run: |
npx -y @bugron/validate-dependabot-yaml@latest

lint_cupcake:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Lint Code Base
continue-on-error: true
uses: oxsecurity/megalinter/flavors/cupcake@v8.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/on_pr_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ jobs:
staging_test:
uses: ./.github/workflows/on_call_staging_test.yaml
needs: build_site

Loading