Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/documentation" # Location of package manifests
schedule:
interval: "weekly"
77 changes: 77 additions & 0 deletions bin/create-blog-post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env bash

# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0

#
# Helper script to create new blog posts
#
# What does this script for you?
# 1. It creates the proper filename (eg. blog/2020-10-01-this-is-a-title.md).
# - current date
# - lower case
# - spaces replaced by dashes
# 2. Adds basic frontmatter into it.
#
# You may place a file .author_meta into the root of the repo to define some variables
# for the frontmatter. The script will tell you if no meta file was found.
#

set -ue

# @see: http://wiki.bash-hackers.org/syntax/shellvars
[ -z "${SCRIPT_DIRECTORY:-}" ] \
&& SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" \
&& export SCRIPT_DIRECTORY

BASE_DIR=$(dirname "${SCRIPT_DIRECTORY}")/documentation
BLOG_DIR="${BASE_DIR}/blog"
USAGE="Usage: $(basename "$0") 'The title of Your Post'"

if (( $# != 1 )); then
echo "Error: The title is missing!"
echo "${USAGE}"
exit 1
fi

if [ '-h' = "${1}" ]; then
echo "${USAGE}"
exit 0
fi

AUTHOR_META_FILE="${BASE_DIR}/.author_meta"
if [ -f "${AUTHOR_META_FILE}" ]; then
echo "Using author meta file ${AUTHOR_META_FILE}."
# shellcheck disable=SC1090
source "${AUTHOR_META_FILE}"
else
echo "No author meta file found at ${AUTHOR_META_FILE}!"
echo
echo "You could use one to predefine some variables. Just put this:"
echo
echo "AUTHOR='Gordon Shumway'"
echo "AUTHOR_TITLE='Core Developer'"
echo "AUTHOR_URL='https://...'"
echo "AUTHOR_IMAGE_URL='https://...'"
echo
echo "Into the file ${AUTHOR_META_FILE}."
fi

TITLE="${1}"
TITLE_CLEANSED=$(echo "${TITLE}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
DATE=$(date +'%Y-%m-%d')
BLOG_POST_FILE="${BLOG_DIR}/${DATE}-${TITLE_CLEANSED}.md"
cat << EOF > "${BLOG_POST_FILE}"
---
title: ${TITLE}
author: ${AUTHOR:-}
author_title: ${AUTHOR_TITLE:-}
author_url: ${AUTHOR_URL:-}
author_image_url: ${AUTHOR_IMAGE_URL:-}
tags:
description:
image:
draft: true
---
EOF
32 changes: 32 additions & 0 deletions documentation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0

DOCUMENTATION_DIR = $(shell pwd)
DIAGRAMS := $(shell find $(DOCUMENTATION_DIR) -type f -name '*.puml')
IMAGES := $(addsuffix .png, $(basename $(DIAGRAMS)))

all: help

.PHONY: puml
puml: $(IMAGES) ## Generate PlantUML images

.PHONY: clean
clean: ## Wipe node_modules
rm -rf $(DOCUMENTATION_DIR)/node_modules

.PHONY: install
install: ## Install Docusaurus stuff. (Needed once before you invoke start target).
npm install

.PHONY: start
start: ## Start local Docusaurus. (Visit http://localhost:3000)
npm start

%.png: %.puml
plantuml -tpng $^

.PHONY: help
help: ## Display this help screen.
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Loading