Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs v2 #498

Merged
merged 34 commits into from
Oct 10, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.idea
vendor
docs/themes/
docs/node_modules/
docs/public/
docs/content/src-link
docs/content/middleware
*.out
*.log
.mod-cache
Empty file added docs/.hugo_build.lock
Empty file.
6 changes: 6 additions & 0 deletions docs/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
.netlify
.hugo_build.lock
node_modules
public
resources
4 changes: 4 additions & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enable-pre-post-scripts=true
auto-install-peers=true
node-linker=hoisted
prefer-symlinked-executables=false
12 changes: 12 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.html
*.ico
*.png
*.jp*g
*.toml
*.*ignore
*.svg
*.xml
LICENSE
.npmrc
.gitkeep
*.woff*
19 changes: 19 additions & 0 deletions docs/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Default config
tabWidth: 4
endOfLine: crlf
singleQuote: true
printWidth: 100000
trailingComma: none
bracketSameLine: true
quoteProps: consistent
experimentalTernaries: true

# Overrided config
overrides:
- files: ["*.md", "*.json", "*.yaml"]
options:
tabWidth: 2
singleQuote: false
- files: ["*.scss"]
options:
singleQuote: false
10 changes: 0 additions & 10 deletions docs/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/archetypes/default.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/archetypes/docs.md

This file was deleted.

File renamed without changes.
Binary file added docs/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added docs/assets/images/.gitkeep
Empty file.
36 changes: 36 additions & 0 deletions docs/assets/js/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Put your custom JS code here

// a bit hacky way to force dark mode by default
// it sets local storage item used by docs/node_modules/@thulite/doks-core/assets/js/color-mode.js
if (!localStorage.getItem('theme')) {
localStorage.setItem('theme', 'dark');
}

import { render } from 'github-buttons';

let renderGitHubButton= () => {
let oldButton = document.getElementById("github-button");
if (oldButton) {
oldButton.remove();
}

let options = {
"href": "https://github.com/ThreeDotsLabs/watermill",
"data-show-count": true,
"data-size": "large",
"data-color-scheme": localStorage.getItem('theme'),
}

render(options, function (el) {
let menu = document.getElementById("offcanvasNavMain").querySelector(".offcanvas-body");
let searchToggle = document.getElementById("searchToggleDesktop");

el.setAttribute("id", "github-button");
el.classList.add("nav-link", "px-2", "mx-auto");
el.setAttribute("style", "margin-top: 12px;");


menu.insertBefore(el, searchToggle);
})
}
renderGitHubButton()
8 changes: 8 additions & 0 deletions docs/assets/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": ["*", "..\\node_modules\\@thulite\\doks-core\\assets\\*"]
}
}
}
1 change: 1 addition & 0 deletions docs/assets/mask-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/assets/scss/common/_custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Put your custom SCSS code here
* {
-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .navbar-brand {
font-family: Quicksand, sans-serif;
font-weight: 700;
}

[data-bs-theme="dark"] .only-light {
display: none;
}

[data-bs-theme="light"] .only-dark {
display: none;
}
28 changes: 28 additions & 0 deletions docs/assets/scss/common/_variables-custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Put your custom SCSS variables here
$font-family-sans-serif:
"Heebo",
"sans-serif",
system-ui,
-apple-system,
"Segoe UI",
Roboto,
"Helvetica Neue",
"Noto Sans",
"Liberation Sans",
Arial,
sans-serif,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
"Noto Color Emoji";

$container-max-widths: (
sm: 540px,
md: 720px,
lg: 960px,
xl: 1240px,
xxl: 1820px
);


$primary: #4f46e5;
Empty file added docs/assets/svgs/.gitkeep
Empty file.
22 changes: 8 additions & 14 deletions docs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ set -e -x

cd "$(dirname "$0")"

if [[ ! -d themes/kube ]]; then
mkdir -p themes/kube && pushd themes/kube
git init
git remote add origin https://github.com/jeblister/kube
git fetch --depth 1 origin 1507abea527aecd896fdc306dfd28ee3e34f01ec
git checkout FETCH_HEAD
popd
fi

function cloneOrPull() {
if [[ -d "$2" ]]
then
Expand All @@ -24,12 +15,12 @@ function cloneOrPull() {
}

if [[ "$1" == "--copy" ]]; then
rm content/src-link -r || true
rm -rf content/src-link || true
mkdir content/src-link/
cp ../message/ content/src-link/ -r
cp ../pubsub/ content/src-link/ -r
cp ../_examples/ content/src-link/ -r
cp ../components/ content/src-link/ -r
cp -r ../message content/src-link/
cp -r ../pubsub content/src-link/
cp -r ../_examples content/src-link/
cp -r ../components content/src-link/
else
declare -a files_to_link=(
"_examples"
Expand All @@ -40,6 +31,7 @@ else
"message/router.go"
"message/router_context.go"
"pubsub/gochannel/pubsub.go"
"pubsub/gochannel/fanout.go"

"components/cqrs/command_bus.go"
"components/cqrs/command_processor.go"
Expand Down Expand Up @@ -83,6 +75,8 @@ cloneOrPull "https://github.com/ThreeDotsLabs/watermill-firestore.git" content/s
cloneOrPull "https://github.com/ThreeDotsLabs/watermill-bolt.git" content/src-link/watermill-bolt
cloneOrPull "https://github.com/ThreeDotsLabs/watermill-redisstream.git" content/src-link/watermill-redisstream

find content/src-link -name '*.md' -delete
find content/src-link -name '*.html' -delete

python3 ./extract_middleware_godocs.py > content/src-link/middleware-defs.md

Expand Down
50 changes: 0 additions & 50 deletions docs/config.toml

This file was deleted.

81 changes: 81 additions & 0 deletions docs/config/_default/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
title = "Watermill"
baseurl = "http://localhost/"
canonifyURLs = false
disableAliases = true
disableHugoGeneratorInject = true
# disableKinds = ["taxonomy", "term"]
enableEmoji = true
enableGitInfo = false
enableRobotsTXT = true
languageCode = "en-US"
paginate = 10
rssLimit = 10
summarylength = 20 # 70 (default)

# Multilingual
defaultContentLanguage = "en"
disableLanguages = []
defaultContentLanguageInSubdir = false

copyRight = "Three Dots Labs"

[build.buildStats]
enable = true

[outputs]
home = ["HTML", "RSS", "searchIndex"]
section = ["HTML", "RSS", "SITEMAP"]

[outputFormats.searchIndex]
mediaType = "application/json"
baseName = "search-index"
isPlainText = true
notAlternative = true

# Add output format for section sitemap.xml
[outputFormats.SITEMAP]
mediaType = "application/xml"
baseName = "sitemap"
isHTML = false
isPlainText = true
noUgly = true
rel = "sitemap"

[sitemap]
changefreq = "monthly"
filename = "sitemap.xml"
priority = 0.5

[caches]
[caches.getjson]
dir = ":cacheDir/:project"
maxAge = -1 # "30m"

[taxonomies]
contributor = "contributors"
category = "categories"
tag = "tags"

[minify.tdewolff.html]
keepWhitespace = false

[related]
threshold = 80
includeNewer = true
toLower = false
[[related.indices]]
name = "categories"
weight = 100
[[related.indices]]
name = "tags"
weight = 80
[[related.indices]]
name = "date"
weight = 10

[imaging]
anchor = "Center"
bgColor = "#ffffff"
hint = "photo"
quality = 85
resampleFilter = "Lanczos"
9 changes: 9 additions & 0 deletions docs/config/_default/languages.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[en]
languageName = "English"
contentDir = "content/en"
weight = 10
[en.params]
languageISO = "EN"
languageTag = "en-US"
footer = ''
alertText = ''
Loading
Loading