Skip to content

Commit

Permalink
sync: Updates from docusaurus-template
Browse files Browse the repository at this point in the history
  • Loading branch information
writedocs-integration committed Jan 6, 2025
1 parent 745564e commit e90e7ed
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 19 deletions.
27 changes: 18 additions & 9 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function getFirstPageFromJson(sectionName) {
}

function createOpenApiConfig() {
if (!configurations.apiFiles || configurations.apiFiles.length === 0) {
return null;
}
const fileNames = configurations.apiFiles;
const directoryPath = 'openAPI';
const proxyUrl = 'https://proxy.writechoice.io/';
Expand Down Expand Up @@ -136,11 +139,20 @@ function createOpenApiConfig() {
return acc;
}, {});

return {
id: 'openapi',
docsPluginId: 'classic',
config,
};
// return {
// id: 'openapi',
// docsPluginId: 'classic',
// config,
// };

return [
"docusaurus-plugin-openapi-docs",
{
id: 'openapi',
docsPluginId: 'classic',
config,
}
]
}

function createNavigationArray() {
Expand Down Expand Up @@ -368,10 +380,7 @@ const config = {
maxHits: '7',
highlightResult: 'true'
}],
[
"docusaurus-plugin-openapi-docs",
createOpenApiConfig()
],
createOpenApiConfig(),
[
'@docusaurus/plugin-content-blog',
{
Expand Down
10 changes: 9 additions & 1 deletion src/components/writedocsComponentsFolder/Callouts/callouts.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
font-style: normal;
font-weight: var(--font-weight-heavy);
margin-bottom: 0 !important;
text-transform: none !important;
text-transform: capitalize !important;
font-family: var(--font-main);
}

Expand Down Expand Up @@ -55,8 +55,16 @@

.no-title-admonition {
flex-direction: row;
justify-content: start;
align-items: center;
padding: 14px 12px 12px 18px;
}

.no-title-admonition .admonitionContent_UjKb {
margin: 0;
margin-bottom: 2px;
}

.no-title-admonition .admonitionIcon_kpSf {
margin-right: 0;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* WARNING */
.alert--transpara {
--ifm-alert-background-color: rgba(166, 189, 175, 0.212);
--ifm-alert-background-color: #66990029;
--ifm-link-color: #690;
--ifm-alert-border-color: #690;
border-color: #690;
--ifm-code-background: #4ffd7d3d;
--ifm-code-background: #66991c26;
}

.alert--transpara .callout_img {
Expand Down
14 changes: 10 additions & 4 deletions src/components/writedocsComponentsFolder/Media/Video.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ const YouTubeIframe = ({ src, width, title }) => {
return <div style={{ color: "red" }}>Error: Video source is required</div>;
}

const iframeWidth = width || "100%";
const iframeHeight = `calc(${iframeWidth} * 9 / 16)`; // Maintain 16:9 aspect ratio
const iframeWidth = width || "800px";
const iframeHeight = `calc(${iframeWidth} * 9 / 16)`;

return (
<div
style={{
display: "flex",
justifyContent: "center", // Horizontally center
justifyContent: "center",
width: "100%",
marginBottom: "20px",
}}
Expand All @@ -73,6 +73,7 @@ const YouTubeIframe = ({ src, width, title }) => {
height: iframeHeight,
position: "relative",
}}
className="youTube_iframe"
>
<iframe
src={src}
Expand Down Expand Up @@ -103,7 +104,12 @@ const Video = ({ src, autoPlay, width, title }) => {

return (
<div className="video_container">
<video style={srcVideoStyles} controls autoPlay={autoPlay}>
<video
style={srcVideoStyles}
className="video"
controls
autoPlay={autoPlay}
>
<source src={useBaseUrl(src)} type="video/mp4" />
{title ? title : "Your browser does not support the video tag."}
</video>
Expand Down
51 changes: 51 additions & 0 deletions src/components/writedocsComponentsFolder/Media/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,54 @@
width: 100%;
margin-bottom: 20px;
}

/* Container styles for consistency */
.video-container {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
margin-bottom: 20px;
}

.youTube_iframe {
position: relative;
}

.youTube_iframe iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 6px;
border: 0;
}

/* Styles for video responsiveness */
.video_container .video {
display: block;
max-width: 100%;
height: auto;
border-radius: 6px;
}

/* Media query for responsiveness */
@media (max-width: 768px) {
.video_container .video {
width: 100%;
}

.youTube_iframe {
width: 100% !important;
padding-top: 56.25% !important;
height: calc(100% * 9 / 16) !important;
}
}

/* @media (min-width: 769px) {
.youTube_iframe,
.video_container .video {
width: var(--video-width, 800px);
}
} */
2 changes: 1 addition & 1 deletion src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

--bg-defined-text-color: #FFFFFF;

--scroll-top-margin: 76px;
--scroll-top-margin: 130px;

/* TABLE */
--table-header-background-color: var(--primary-color);
Expand Down
2 changes: 1 addition & 1 deletion src/css/table.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
table {
width: 100% !important;
max-width: 100%;
margin-bottom: var(--ifm-spacing-vertical);
display: table;
}

table thead,
Expand Down
4 changes: 4 additions & 0 deletions src/css/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
border-color: var(--ifm-color-primary);
background-color: var(--ifm-hover-overlay);
}

.tabs {
margin-bottom: 10px !important;
}
3 changes: 2 additions & 1 deletion writedocs/styles/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function navbarTotalItems(externalLinks, navbar, homepage) {
}

function navbarHeight(externalLinks, navbar, homepage) {
return navbarTotalItems(externalLinks, navbar, homepage) < navbarBreakpoint ? '76px' : '130px';
// return navbarTotalItems(externalLinks, navbar, homepage) < navbarBreakpoint ? '76px' : '130px';
return "130px";
}

function sidebarTocPosition(externalLinks, navbar, homepage) {
Expand Down

0 comments on commit e90e7ed

Please sign in to comment.