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
4 changes: 2 additions & 2 deletions .github/workflows/crowdin-download-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
description: "Branch to run this workflow on"
required: true
default: "main"
schedule:
- cron: "20 14,18,22 * * 1,2,3,4,5" # Runs at 20 minutes past beginning/middle/end of day Mon-Fri (UTC-6) (an hour after the upload action)
# schedule:
# - cron: "20 14,18,22 * * 1,2,3,4,5" # Runs at 20 minutes past beginning/middle/end of day Mon-Fri (UTC-6) (an hour after the upload action)

permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/crowdin-upload-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Crowdin Upload Action
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "20 13,17,21 * * 1,2,3,4,5" # Runs at 20 minutes past beginning/middle/end of day Mon-Fri (UTC-6)
# schedule:
# - cron: "20 13,17,21 * * 1,2,3,4,5" # Runs at 20 minutes past beginning/middle/end of day Mon-Fri (UTC-6)

jobs:
crowdin-upload:
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ RUN yarn stellar-cli:build --no-minify --cli-ref=main
RUN yarn stellar-cli:fix-links

ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN if [ "$BUILD_TRANSLATIONS" = "True" ]; then \
yarn docusaurus build --no-minify; \
else \
# In the preview build, we only want to build for English. Much quicker
yarn build --no-minify; \
fi
# RUN if [ "$BUILD_TRANSLATIONS" = "True" ]; then \
# yarn docusaurus build --no-minify; \
# else \
# # In the preview build, we only want to build for English. Much quicker
# yarn build --no-minify; \
# fi
RUN yarn build --no-minify

FROM nginx:1.29

Expand Down
3 changes: 3 additions & 0 deletions config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ export const CODE_LANGS = {
typescript: 'TypeScript',
yaml: 'YAML',
};

const GOOGLE_TRANSLATE_LANGUAGES: string = "af,sq,am,en,fa,ar,ps,ja,zh-CN,hy,az,eu,be,bn,bs,bg,ca,ceb,ny,zh-TW,co,hr,cs,da,nl,eo,et,tl,fi,fr,fy,gl,ka,de,el,gu,ht,ha,haw,iw,hi,hmn,hu,is,ig,id,ga,it,jw,kn,kk,km,ko,ku,ky,lo,la,lv,lt,lb,mk,mg,ms,ml,mt,mi,mr,mn,my,ne,no,pl,pt,pa,ro,ru,sm,gd,sr,st,sn,sd,si,sk,sl,so,es,su,sw,sv,tg,ta,te,th,tr,uk,ur,uz,vi,cy,xh,yi,yo,zu";
export const GOOGLE_TRANSLATE_ELEMENT: string = `<a href="#" class="my-google-translate-button" onclick="new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: '${GOOGLE_TRANSLATE_LANGUAGES}'}, 'google_translate_element'); return false;"></a>`;
21 changes: 20 additions & 1 deletion config/theme/navbar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { NavbarItem } from '@docusaurus/theme-common'
import type { NavbarItem } from '@docusaurus/theme-common';
import { GOOGLE_TRANSLATE_ELEMENT } from '../constants';

const build: NavbarItem = {
type: 'dropdown',
Expand Down Expand Up @@ -505,6 +506,23 @@ const validators: NavbarItem = {
]
}

const translation: NavbarItem[] = [
{
type: 'html',
position: 'right',
value: '<div id="google_translate_element"></div>',
},
{
type: 'html',
position: 'right',
value: GOOGLE_TRANSLATE_ELEMENT,
},
// {
// type: 'localeDropdown',
// position: 'right',
// },
]

export default {
build,
learn,
Expand All @@ -513,4 +531,5 @@ export default {
tools,
networks,
validators,
translation,
}
24 changes: 14 additions & 10 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
import { themes as prismThemes } from 'prism-react-renderer';

import { makeEditUrl, DEFAULT_LOCALE } from './config/constants';
// import { makeEditUrl, DEFAULT_LOCALE, GOOGLE_TRANSLATE_ELEMENT } from './config/constants';
import navbarItems from './config/theme/navbar';
import footerColumns from './config/theme/footer';
import { headTags } from './config/theme/headTags';
Expand All @@ -27,10 +27,16 @@ const config: Config = {
favicon: "img/docusaurus/favicon-96x96.png",
organizationName: "stellar",
projectName: "stellar-docs",
i18n: {
defaultLocale: DEFAULT_LOCALE,
locales: ["en", "es"],
},
// i18n: {
// defaultLocale: DEFAULT_LOCALE,
// locales: ["en", "es"],
// },
scripts: [
{
src: 'https://translate.google.com/translate_a/element.js',
async: true,
},
],
plugins: [
"docusaurus-plugin-sass",
[
Expand Down Expand Up @@ -115,7 +121,8 @@ const config: Config = {
rehypePlugins: [rehypeKatex],
sidebarPath: "config/sidebars.ts",
sidebarItemsGenerator: require("./src/sidebar-generator"),
editUrl: makeEditUrl,
// editUrl: makeEditUrl,
editUrl: "https://github.com/stellar/stellar-docs/edit/main",
exclude: ['**/component/**', '**/CONTRIBUTING.md'],
},
theme: {
Expand Down Expand Up @@ -169,10 +176,7 @@ const config: Config = {
navbarItems.tools,
navbarItems.networks,
navbarItems.validators,
{
type: 'localeDropdown',
position: 'right',
},
...navbarItems.translation,
{
href: "https://github.com/stellar/stellar-docs",
position: "right",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build --locale en",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand Down
62 changes: 34 additions & 28 deletions src/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ html[data-theme="dark"] {
--ifm-background-color: var(--ifm-color-black);
}

.markdown > h4 {
.markdown>h4 {
--ifm-h4-font-size: 1.25rem;

margin-bottom: calc(
var(--ifm-heading-vertical-rhythm-bottom) * var(--ifm-leading)
);
margin-bottom: calc(var(--ifm-heading-vertical-rhythm-bottom) * var(--ifm-leading));
margin-top: calc(var(--ifm-h4-vertical-rhythm-top) * var(--ifm-leading));
}

Expand All @@ -93,8 +91,7 @@ html[data-theme="dark"] {
svg {
height: 1.5rem;
width: 1.5rem;
transition: color var(--ifm-transition-fast)
var(--ifm-transition-timing-default);
transition: color var(--ifm-transition-fast) var(--ifm-transition-timing-default);

&:hover,
&:focus {
Expand Down Expand Up @@ -126,20 +123,14 @@ html[data-theme="dark"] {
div[class^="announcementBar_"] {
font-size: 18px;

--site-announcement-bar-stripe-color1: hsl(
var(--site-primary-hue-saturation) 85%
);
--site-announcement-bar-stripe-color2: hsl(
var(--site-primary-hue-saturation) 95%
);

background: repeating-linear-gradient(
35deg,
var(--site-announcement-bar-stripe-color1),
var(--site-announcement-bar-stripe-color1) 20px,
var(--site-announcement-bar-stripe-color2) 10px,
var(--site-announcement-bar-stripe-color2) 40px
);
--site-announcement-bar-stripe-color1: hsl(var(--site-primary-hue-saturation) 85%);
--site-announcement-bar-stripe-color2: hsl(var(--site-primary-hue-saturation) 95%);

background: repeating-linear-gradient(35deg,
var(--site-announcement-bar-stripe-color1),
var(--site-announcement-bar-stripe-color1) 20px,
var(--site-announcement-bar-stripe-color2) 10px,
var(--site-announcement-bar-stripe-color2) 40px);

height: fit-content;
}
Expand All @@ -162,7 +153,7 @@ div[class^="announcementBar_"] {
}
}

.navbar .dropdown > a.active {
.navbar .dropdown>a.active {
color: var(--ifm-color-primary);
}

Expand Down Expand Up @@ -202,22 +193,37 @@ select[data-testid="example-pairing-select"] {
var(--ifm-transition-timing-default);
}

.goog-te-gadget .goog-te-combo {
margin: 0 !important;
}

.my-google-translate-button::before {
content: '';
width: 24px;
height: 24px;
display: flex;
background-color: var(--ifm-navbar-link-color);
mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' aria-hidden='true' style='vertical-align: text-bottom' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z'%3E%3C/path%3E%3C/svg%3E");
transition: background-color var(--ifm-transition-fast)
var(--ifm-transition-timing-default);
}

/* Hubble data dictionary formatting */
.scoped-data-dictionary-table table {
display: table;
width: max-content;
max-width: 135%;

thead {
color: var(--ifm-color-primary-darker);
background-color: var(--ifm-color-gray-300);
font-size: large;
text-align: left;
text-wrap: nowrap;
color: var(--ifm-color-primary-darker);
background-color: var(--ifm-color-gray-300);
font-size: large;
text-align: left;
text-wrap: nowrap;
}

td {
font-size: small;
font-size: small;
}
}

Expand All @@ -230,7 +236,7 @@ select[data-testid="example-pairing-select"] {

.dropdown__link.has-nested-items::after {
content: '➜';
margin-left: 10px; // spacing (use margin instead of padding when using flex)
margin-left: 10px; // spacing (use margin instead of padding when using flex)
font-size: 1em;
line-height: 1;
display: inline-block;
Expand Down