Skip to content

Commit 81c51b3

Browse files
authored
Merge pull request #530 from SpineEventEngine/site-commons-setup
Use the `site-commons` theme
2 parents e3d8263 + 9ad976a commit 81c51b3

102 files changed

Lines changed: 597 additions & 1085 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
env:
1010
HUGO_VERSION: 0.150.0
11-
GH_USER: site-commons-machine-user
1211

1312
jobs:
1413
deploy:
@@ -49,9 +48,6 @@ jobs:
4948
restore-keys: |
5049
${{ runner.os }}-hugomod-
5150
52-
- name: Prepare Environment
53-
run: git config --global url."https://${{ env.GH_USER }}:${{ secrets.GH_SITE_COMMONS_PAT }}@github.com".insteadOf "https://github.com"
54-
5551
- name: Install Dependencies
5652
working-directory: site
5753
run: npm ci

.github/workflows/proof-links.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on: [pull_request, workflow_dispatch]
33

44
env:
55
HUGO_VERSION: 0.147.8
6-
GH_USER: site-commons-machine-user
76
LYCHEE_RELEASE: "lychee-v0.15.1-x86_64-unknown-linux-gnu.tar.gz"
87
LYCHEE_VERSION_TAG: "v0.15.1"
98

@@ -43,9 +42,6 @@ jobs:
4342
restore-keys: |
4443
${{ runner.os }}-hugomod-
4544
46-
- name: Prepare environment
47-
run: git config --global url."https://${{ env.GH_USER }}:${{ secrets.GH_SITE_COMMONS_PAT }}@github.com".insteadOf "https://github.com"
48-
4945
- name: Install Dependencies
5046
working-directory: site
5147
run: npm ci

AUTHORING.md

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This document is a guide for adding content to the [spine.io](https://spine.io)
77
* [URLs in markdown](#urls-in-markdown)
88
* [Rule 1](#rule-1----all-internal-links-must-not-start-with-a-slash)
99
* [Rule 2](#rule-2----each-link-should-end-with-a-slash-to-prevent-unnecessary-redirects)
10+
* [Variables](#variables)
1011
* [Images](#images)
1112
* [URLs in HTML](#urls-in-html)
1213
* [Navigation](#navigation)
@@ -44,6 +45,30 @@ There are two rules to follow:
4445
|--------------------------------------|-------------------------------------|
4546
| `[Introduction](docs/introduction/)` | `[Introduction](/docs/introduction)`|
4647

48+
#### Variables
49+
50+
This example shows how to use data variables and a version variable in a URL:
51+
52+
```markdown
53+
[Hello World]({{% get-site-data "repositories.examples" %}}/hello/)
54+
55+
[Introduction](docs/{{% version %}}/)
56+
```
57+
58+
Will be rendered as:
59+
60+
```html
61+
<a href="https://github.com/spine-examples/hello/" target="_blank">Hello World</a>
62+
63+
<a href="/docs/1.9.0/">Introduction</a>
64+
```
65+
66+
Where:
67+
68+
* {{% get-site-data "repositories.core_jvm_repo" %}} will apply the `core_jvm_repo`
69+
from the `site-commons` -> `data/repositories.yml` file.
70+
* {{% version %}} adds the version label of the current page -> `1.9.0`.
71+
4772
### Images
4873

4974
To render an image in markdown use:
@@ -70,22 +95,57 @@ When working with layout partials, URLs should be specified using the following
7095
<img class="logo" src="{{ `img/spine-logo.svg` | relURL }}" alt="Spine logo">
7196
```
7297

98+
# Markdown pages
99+
100+
It is nice to have the following parameters on every markdown page, especially in documentation:
101+
102+
```markdown
103+
---
104+
title: Getting Started in Java
105+
description: This guide shows how to start working with Spine in Java.
106+
headline: Documentation
107+
---
108+
```
109+
110+
Where:
111+
* `title` page title.
112+
* `description` a short summary of what this page is about. Used for SEO.
113+
* `headline` shown under the main navigation. If omitted, it is not rendered.
114+
115+
Optional parameters:
116+
117+
```markdown
118+
---
119+
header_type: fixed-header
120+
body_class: privacy
121+
customjs: js/pages/privacy.js
122+
---
123+
```
124+
125+
Where:
126+
* `header_type` controls how the page header behaves (for example, stays fixed while scrolling).
127+
* `body_class` adds a CSS class to style a specific page. By default, the body class is based on the page type.
128+
* `customjs` loads page-specific JavaScript.
129+
73130
# Navigation
74131

75132
### Main navigation
76133

77134
To edit navigation items, modify `site/data/navbar.yml`.
78-
The navigation template is located at `site/layouts/_partials/components/navbar/navigation.html`.
135+
The navigation layout template is located at `site/layouts/_partials/components/navbar/navigation.html`.
79136

80137
### Documentation side navigation
81138

82-
The documentation side navigation can be edited in the [SpineEventEngine/documentation](https://github.com/SpineEventEngine/documentation)
83-
repository in the `docs/data/docs/<version>/sidenav.yml` file.
139+
The documentation side navigation can be edited in the [SpineEventEngine/documentation][documentation-repo]
140+
repository in the `docs/data/docs/<version_id>/sidenav.yml` file.
141+
142+
If it is part of a specific documentation module, it can be found in the corresponding repository
143+
at `docs/data/docs/<module>/<version_id>/sidenav.yml`.
84144

85145
### Documentation “Next/Prev” buttons
86146

87-
The “Prev”/“Next” buttons are generated automatically for all document pages.
88-
The implementation is inside the [SpineEventEngine/documentation](https://github.com/SpineEventEngine/documentation).
147+
The “Prev”/“Next” buttons are generated automatically for all document pages based on the `sidenav.yml`.
148+
The implementation is inside the [SpineEventEngine/site-commons][site-commons].
89149

90150
# Adding code samples to the site
91151

@@ -120,18 +180,18 @@ file for details.
120180
# Cloak email
121181

122182
The `cloakemail` shortcode is used to cloak emails or phone numbers from
123-
spamming bots. We store all email variables in the `site/data/spine.yml` file.
183+
spamming bots. We store all email variables in the `site/data/emails.yml` file in the `site-commons`.
124184

125185
In markdown files, use the shortcode with a provided variable from a data file, for example:
126186

127187
```markdown
128-
{{< cloakemail address_variable="spine.sales_email" >}}
188+
{{< cloakemail address_variable="emails.sales_email" >}}
129189
```
130190

131191
or with the display text:
132192

133193
```markdown
134-
{{< cloakemail address_variable="spine.sales_email" display="Contact us" >}}
194+
{{< cloakemail address_variable="emails.sales_email" display="Contact us" >}}
135195
```
136196

137197
# Note blocks
@@ -216,3 +276,5 @@ the entire line with background.
216276

217277
[code-fences-doc]: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences
218278
[syntax-highlighting-languages]: https://gohugo.io/content-management/syntax-highlighting/#languages
279+
[documentation-repo]: https://github.com/SpineEventEngine/documentation
280+
[site-commons]: https://github.com/SpineEventEngine/site-commons

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ into the pages, please see the [`_code/EMBEDDING.md`](_code/EMBEDDING.md) file.
2121
2. [Go][go] `1.12` or newer.
2222
3. [Node.js][nodejs] `18+`.
2323
4. [Hugo Extended][hugo-quick-start] in version `v0.150.0` or higher.
24-
5. Access to the [`site-commons`][site-commons] repository — to download the theme.
2524

2625
## Configuration
2726

28-
1. Make sure [SSH][site-commons-ssh] configured correctly and the passphrase is stored in the keychain.
29-
2. Install project dependencies from the `site` directory by running `npm install`.
27+
1. Install project dependencies from the `site` directory by running `npm install`.
3028

3129
## Running the site locally
3230

@@ -49,9 +47,7 @@ Another way to run the site locally is to follow these steps:
4947
hugo server
5048
```
5149

52-
If you receive a `permission denied` message, but you are sure that you have
53-
all the rights to the [required repositories](#prerequisites), try clearing
54-
the cache:
50+
If you receive an error, try clearing the cache:
5551

5652
```shell
5753
hugo mod clean --all
@@ -64,7 +60,8 @@ Then run the `hugo serve` again.
6460
The documentation is located in a [separate repository][documentation-repo].
6561
It is added to this site as a Hugo Module.
6662

67-
Any changes to the documentation must be made in its own [repository][documentation-repo].
63+
Any changes to the documentation must be made in its own [repository][documentation-repo]
64+
or documentation modules.
6865

6966
The `documentation` repository is made to be self-sustainable in terms of editing. A fully-fledged
7067
Hugo site has been set up for it. All the contents and links in it are working as intended.
@@ -76,21 +73,27 @@ are used to embed the content.
7673
### Steps to get documentation updates
7774

7875
1. Navigate to the `site` directory.
79-
2. Clean the module cache:
76+
2. Get the documentation Hugo Module:
8077

8178
```shell
82-
hugo mod clean
79+
hugo mod get -u github.com/SpineEventEngine/documentation/docs
8380
```
8481

85-
3. Get the documentation Hugo Module:
82+
or update all the modules recursively (including the site-commons):
8683

8784
```shell
88-
hugo mod get -u github.com/SpineEventEngine/documentation/docs
85+
hugo mod get -u ./...
8986
```
9087

91-
4. Commit and push changes from `go.mod` and `go.sum` files.
88+
3. Commit and push changes from `go.mod` and `go.sum` files.
9289
In the `go.sum` file, keep only the two required entries for each theme to avoid file clutter.
9390

91+
If there is an error while getting new updates, clear the cache and repeat step 2:
92+
93+
```shell
94+
hugo mod clean
95+
```
96+
9497
## Common theme
9598

9699
This project uses the [`site-commons`][site-commons] Hugo theme for general components such
@@ -100,7 +103,7 @@ as anchor icons, snackbars, etc.
100103
2. To get theme updates, run:
101104

102105
```shell
103-
hugo mod get -u github.com/TeamDev-Ltd/site-commons
106+
hugo mod get -u github.com/SpineEventEngine/site-commons
104107
```
105108

106109
3. Commit and push changes from `go.mod` and `go.sum` files.
@@ -114,8 +117,7 @@ the [`AUTHORING.md`](AUTHORING.md) file.
114117
[go]: https://go.dev/doc/install
115118
[nodejs]: https://nodejs.org/en/download/current
116119
[hugo-quick-start]: https://gohugo.io/getting-started/quick-start/#step-1-install-hugo
117-
[site-commons]: https://github.com/TeamDev-Ltd/site-commons
118-
[site-commons-ssh]: https://github.com/TeamDev-Ltd/site-commons/tree/master?tab=readme-ov-file#configure-go-to-use-ssh-for-github
120+
[site-commons]: https://github.com/SpineEventEngine/site-commons
119121
[hugo-modules]: https://gohugo.io/hugo-modules/introduction
120122
[embed-code]: https://github.com/SpineEventEngine/embed-code/tree/embed-code-go
121123
[documentation-repo]: https://github.com/SpineEventEngine/documentation.git

site/.browserslistrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

site/assets/js/bootstrap.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

site/assets/js/pages/faq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
'use strict';
2828

29-
import {copyToClipboard} from "js/components/copy-to-clipboard";
29+
import {copyToClipboard} from "js/theme/copy-to-clipboard";
3030

3131
/**
3232
* Opens the collapsed FAQ item on hash change and handles the anchor icon click.

site/assets/scss/base/_colors.scss

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright 2025, TeamDev. All rights reserved.
2+
* Copyright 2026, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,45 +24,14 @@
2424
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
*/
2626

27-
// Brand Colors
28-
$main-brand-color: #1a96de;
29-
$second-brand-color: #116db4;
30-
$inverse-brand-color: #ffffff;
31-
$body-light-gray-color: #f6f8fA;
32-
$warning-color: #deba32;
33-
$nav-blue-gradient: linear-gradient(152deg, #1378DA 0%, #0B64CC 100%);
34-
$light-blue-bg-color: #edf8ff;
35-
$note-bg-color: #e0f2ff;
27+
/* Extends colors from `site-commons`. */
3628

37-
// Dividers
38-
$divider-color: rgba(0, 0, 0, .08);
29+
$nav-blue-gradient: linear-gradient(152deg, #1378da 0%, #0b64cc 100%);
30+
$light-blue-bg-color: #edf8ff;
3931
$divider: 1px solid $divider-color;
40-
$article-border-color: #e6ecf1;
41-
42-
// General Colors
43-
$black: #2e2e2e;
44-
$white: #ffffff;
4532
$light-gray-blue: #eef1f3;
46-
$text-color: #3a3a3a;
47-
$error-color: #c40003;
4833

49-
// Links
50-
$link-color: $main-brand-color;
51-
$link-hover-color: darken($link-color, 10%);
52-
$link-blue-color: #5dc4ff;
53-
54-
// Footer
5534
$footer-color: #232526;
56-
$footer-text: #eaeaea;
57-
58-
// Grays
59-
$gray-100: rgba(black, .12);
60-
$gray-200: rgba(black, .26);
61-
$gray-300: rgba(black, .38);
62-
$gray-500: rgba(black, .54);
63-
$gray-600: rgba(black, .6);
64-
$gray-700: rgba(black, .7);
35+
$footer-text-color: #eaeaea;
6536

66-
// Shadows
67-
$feature-card-shadow: 0 1px 3px 0 rgba($footer-color, .08);
6837
$navbar-shadow: 0 3px 4px 0 rgba(0, 0, 0, .25);

site/assets/scss/base/_common.scss

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright 2025, TeamDev. All rights reserved.
2+
* Copyright 2026, TeamDev. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,10 +49,6 @@
4949
transition: all .3s ease-in-out;
5050
}
5151

52-
.nobr {
53-
white-space: nowrap;
54-
}
55-
5652
.section {
5753
padding: 50px 0;
5854
position: relative;
@@ -72,17 +68,6 @@
7268
}
7369
}
7470

75-
table,
76-
th,
77-
td {
78-
border: 1px solid lighten($text-color, 20%);
79-
padding: 6px
80-
}
81-
82-
table {
83-
border-collapse: collapse;
84-
}
85-
8671
// Expandable title with caret icon before.
8772
%expandable-title {
8873
font-size: $font-size--primary;
@@ -95,8 +80,8 @@ table {
9580
content: '';
9681
position: absolute;
9782
background: url('img/icons/icon-caret-right.svg') no-repeat center/cover;
98-
width: $icon-size--s;
99-
height: $icon-size--s;
83+
width: $icon-size-s;
84+
height: $icon-size-s;
10085
margin-left: -40px;
10186
margin-top: -2px;
10287
opacity: .54;

0 commit comments

Comments
 (0)