Skip to content

Commit

Permalink
Merge branch 'docs-v2' of github.com:ThreeDotsLabs/watermill into doc…
Browse files Browse the repository at this point in the history
…s-v2
  • Loading branch information
m110 committed Oct 9, 2024
2 parents b0d255f + f3f9472 commit 64fad15
Show file tree
Hide file tree
Showing 20 changed files with 261 additions and 151 deletions.
35 changes: 35 additions & 0 deletions docs/assets/js/custom.js
Original file line number Diff line number Diff line change
@@ -1 +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()
27 changes: 5 additions & 22 deletions docs/assets/scss/common/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
// Put your custom SCSS code here

/* quicksand-regular - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Quicksand';
font-style: normal;
font-weight: 400;
src: url('/fonts/quicksand/quicksand-v31-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* quicksand-500 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Quicksand';
font-style: normal;
font-weight: 500;
src: url('/fonts/quicksand/quicksand-v31-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
* {
-webkit-font-smoothing: antialiased;
}
/* quicksand-700 - latin */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Quicksand';
font-style: normal;

h1, h2, h3, h4, h5, .navbar-brand {
font-family: Quicksand, sans-serif;
font-weight: 700;
src: url('/fonts/quicksand/quicksand-v31-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
6 changes: 5 additions & 1 deletion docs/assets/scss/common/_variables-custom.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Put your custom SCSS variables here
$font-family-sans-serif:
"Quicksand",
"Heebo",
"sans-serif",
system-ui,
-apple-system,
"Segoe UI",
Expand All @@ -22,3 +23,6 @@ $container-max-widths: (
xl: 1240px,
xxl: 1820px
);


$primary: #4f46e5;
5 changes: 3 additions & 2 deletions docs/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ mainSections = ["docs"]

# Doks (@thulite/doks-core)
[doks]
# Color mode
colorMode = "dark" # auto (default), light or dark
# Color mode - it should stay auto to render toggle button,
# in practice we are using dark by default (see docs/assets/js/custom.js)
colorMode = "auto" # auto (default), light or dark
colorModeToggler = true # true (default) or false (this setting is only relevant when colorMode = auto)

# Navbar
Expand Down
2 changes: 1 addition & 1 deletion docs/content/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Join us on the `#watermill` channel on the [Three Dots Labs discord](https://dis

For enterprise support, please contact us by e-mail: [email protected]

You can also use the [contact form on our website](https://threedots.tech).
You can also use the [contact form on our website](https://threedots.tech/contact/?utm_source=watermill-docs).
8 changes: 7 additions & 1 deletion docs/hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@
"anchor",
"bi",
"bi-airplane-engines-fill",
"bi-emoji-smile-fill",
"bi-airplane-fill",
"bi-globe-americas",
"bi-puzzle-fill",
"bi-rocket",
"bi-shield-fill-check",
"btn",
"btn-close",
Expand Down Expand Up @@ -147,7 +148,9 @@
"icon-tabler-dots-vertical",
"icon-tabler-external-link",
"icon-tabler-menu",
"icon-tabler-moon",
"icon-tabler-search",
"icon-tabler-sun",
"icon-tabler-x",
"is-terminal",
"justify-content-between",
Expand All @@ -168,6 +171,7 @@
"mb-5",
"me-2",
"me-auto",
"me-lg-1",
"me-lg-3",
"message",
"modal",
Expand All @@ -183,6 +187,7 @@
"ms-2",
"ms-3",
"ms-auto",
"ms-lg-2",
"mt-3",
"mt-5",
"mt-n3",
Expand Down Expand Up @@ -272,6 +277,7 @@
"building-a-read-model-with-the-event-handler",
"building-blocks",
"built-in-implementations",
"buttonColorMode",
"characteristics",
"circuit-breaker",
"close",
Expand Down
10 changes: 6 additions & 4 deletions docs/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ <h1>{{ .Title }}</h1>
<div class="container">
<div class="row justify-content-center text-center">
<div class="col-lg-5 mb-5">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="currentColor" class="bi bi-emoji-smile-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16M7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5M4.285 9.567a.5.5 0 0 1 .683.183A3.5 3.5 0 0 0 8 11.5a3.5 3.5 0 0 0 3.032-1.75.5.5 0 1 1 .866.5A4.5 4.5 0 0 1 8 12.5a4.5 4.5 0 0 1-3.898-2.25.5.5 0 0 1 .183-.683M10 8c-.552 0-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5S10.552 8 10 8"/>
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="currentColor" class="bi bi-rocket" viewBox="0 0 16 16">
<path d="M8 8c.828 0 1.5-.895 1.5-2S8.828 4 8 4s-1.5.895-1.5 2S7.172 8 8 8"/>
<path d="M11.953 8.81c-.195-3.388-.968-5.507-1.777-6.819C9.707 1.233 9.23.751 8.857.454a3.5 3.5 0 0 0-.463-.315A2 2 0 0 0 8.25.064.55.55 0 0 0 8 0a.55.55 0 0 0-.266.073 2 2 0 0 0-.142.08 4 4 0 0 0-.459.33c-.37.308-.844.803-1.31 1.57-.805 1.322-1.577 3.433-1.774 6.756l-1.497 1.826-.004.005A2.5 2.5 0 0 0 2 12.202V15.5a.5.5 0 0 0 .9.3l1.125-1.5c.166-.222.42-.4.752-.57.214-.108.414-.192.625-.281l.198-.084c.7.428 1.55.635 2.4.635s1.7-.207 2.4-.635q.1.044.196.083c.213.09.413.174.627.282.332.17.586.348.752.57l1.125 1.5a.5.5 0 0 0 .9-.3v-3.298a2.5 2.5 0 0 0-.548-1.562zM12 10.445v.055c0 .866-.284 1.585-.75 2.14.146.064.292.13.425.199.39.197.8.46 1.1.86L13 14v-1.798a1.5 1.5 0 0 0-.327-.935zM4.75 12.64C4.284 12.085 4 11.366 4 10.5v-.054l-.673.82a1.5 1.5 0 0 0-.327.936V14l.225-.3c.3-.4.71-.664 1.1-.861.133-.068.279-.135.425-.199M8.009 1.073q.096.06.226.163c.284.226.683.621 1.09 1.28C10.137 3.836 11 6.237 11 10.5c0 .858-.374 1.48-.943 1.893C9.517 12.786 8.781 13 8 13s-1.517-.214-2.057-.607C5.373 11.979 5 11.358 5 10.5c0-4.182.86-6.586 1.677-7.928.409-.67.81-1.082 1.096-1.32q.136-.113.236-.18Z"/>
<path d="M9.479 14.361c-.48.093-.98.139-1.479.139s-.999-.046-1.479-.139L7.6 15.8a.5.5 0 0 0 .8 0z"/>
</svg>
<h2 class="h4 mt-3">Easy to Use</h2>
<p>
Expand All @@ -50,8 +52,8 @@ <h2 class="h4 mt-3">Universal</h2>
</p>
</div>
<div class="col-lg-5 mb-5">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="currentColor" class="bi bi-airplane-engines-fill" viewBox="0 0 16 16">
<path d="M8 0c-.787 0-1.292.592-1.572 1.151A4.35 4.35 0 0 0 6 3v3.691l-2 1V7.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.191l-1.17.585A1.5 1.5 0 0 0 0 10.618V12a.5.5 0 0 0 .582.493l1.631-.272.313.937a.5.5 0 0 0 .948 0l.405-1.214 2.21-.369.375 2.253-1.318 1.318A.5.5 0 0 0 5.5 16h5a.5.5 0 0 0 .354-.854l-1.318-1.318.375-2.253 2.21.369.405 1.214a.5.5 0 0 0 .948 0l.313-.937 1.63.272A.5.5 0 0 0 16 12v-1.382a1.5 1.5 0 0 0-.83-1.342L14 8.691V7.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v.191l-2-1V3c0-.568-.14-1.271-.428-1.849C9.292.591 8.787 0 8 0"/>
<svg xmlns="http://www.w3.org/2000/svg" width="65" height="64" fill="currentColor" class="bi bi-airplane-fill" viewBox="0 0 16 16">
<path d="M6.428 1.151C6.708.591 7.213 0 8 0s1.292.592 1.572 1.151C9.861 1.73 10 2.431 10 3v3.691l5.17 2.585a1.5 1.5 0 0 1 .83 1.342V12a.5.5 0 0 1-.582.493l-5.507-.918-.375 2.253 1.318 1.318A.5.5 0 0 1 10.5 16h-5a.5.5 0 0 1-.354-.854l1.319-1.318-.376-2.253-5.507.918A.5.5 0 0 1 0 12v-1.382a1.5 1.5 0 0 1 .83-1.342L6 6.691V3c0-.568.14-1.271.428-1.849"/>
</svg>
<h2 class="h4 mt-3">Fast</h2>
<p>
Expand Down
15 changes: 15 additions & 0 deletions docs/layouts/partials/head/custom-head.html
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
<!-- Custom head -->

<!-- google fonts -->
{{ $pf:= "Heebo:wght@400;600" }}
{{ $sf:= "Quicksand:wght@700" }}
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<script>
(function () {
const googleFont = document.createElement("link");
googleFont.href = "https://fonts.googleapis.com/css2?family={{$pf | safeURL}}{{with $sf}}&family={{. | safeURL}}{{end}}&display=swap";
googleFont.type = "text/css";
googleFont.rel = "stylesheet";
document.head.appendChild(googleFont);
})();
</script>
50 changes: 50 additions & 0 deletions docs/layouts/partials/seo/opengraph.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{{/* Based on: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html */}}
<meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">

{{ $imagePermalink := (printf "https://academy-api.threedots.tech/ssr/image.png?%s" (collections.Querify "url" .Page.Permalink) ) }}
<meta property="og:image" content="{{ $imagePermalink }}">

{{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
<meta property="article:section" content="{{ .Section }}">
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>{{ end }}
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>{{ end }}
{{- end -}}

{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}">{{ end }}
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}">{{ end }}
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}">{{ end }}
{{- with .Params.videos }}{{- range . }}
<meta property="og:video" content="{{ . | absURL }}">
{{ end }}{{ end }}

{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}
{{- if $siteSeries }}
{{ with .Params.series }}{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}">{{ end }}
{{- end }}
{{ end }}{{ end }}
{{- end }}

{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
{{- $facebookAdmin := "" }}
{{- with site.Params.social }}
{{- if reflect.IsMap . }}
{{- $facebookAdmin = .facebook_admin }}
{{- end }}
{{- else }}
{{- with site.Social.facebook_admin }}
{{- $facebookAdmin = . }}
{{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
{{- end }}
{{- end }}

{{- /* Facebook Page Admin ID for Domain Insights */}}
{{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}">{{ end }}
30 changes: 30 additions & 0 deletions docs/layouts/partials/seo/twitter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{/* Based on: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html */}}

{{ $imagePermalink := (printf "https://academy-api.threedots.tech/ssr/image.png?%s" (collections.Querify "url" .Page.Permalink) ) }}
<meta name="twitter:image" content="{{ $imagePermalink }}">
<meta name="twitter:card" content="summary_large_image">


<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">

{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
{{- $twitterSite := "" }}
{{- with site.Params.social }}
{{- if reflect.IsMap . }}
{{- $twitterSite = .twitter }}
{{- end }}
{{- else }}
{{- with site.Social.twitter }}
{{- $twitterSite = . }}
{{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
{{- end }}
{{- end }}

{{- with $twitterSite }}
{{- $content := . }}
{{- if not (strings.HasPrefix . "@") }}
{{- $content = printf "@%v" $twitterSite }}
{{- end }}
<meta name="twitter:site" content="{{ $content }}">
{{- end }}
6 changes: 6 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"preview": "vite preview --outDir public"
},
"dependencies": {
"@tabler/icons": "^3.12.0",
"@thulite/doks-core": "^1.7.0",
"@thulite/images": "^3.3.0",
"@thulite/inline-svg": "^1.1.0",
"@thulite/seo": "^2.4.0",
"@tabler/icons": "^3.12.0",
"github-buttons": "^2.29.1",
"thulite": "^2.5.0"
},
"devDependencies": {
Expand All @@ -26,4 +27,4 @@
"engines": {
"node": ">=20.11.0"
}
}
}
Loading

0 comments on commit 64fad15

Please sign in to comment.