docs: 🐛 css enhancement + add gtag

Signed-off-by: slumbering <slumbering.pierrot@gmail.com>
This commit is contained in:
slumbering 2021-06-17 17:50:08 +02:00
parent f8d8a68a5e
commit 54212596ac
12 changed files with 248 additions and 69 deletions

View File

@ -6,4 +6,6 @@ slug: /learn/103-script
In this guide, you will learn how to incorporate your custom shell scripts into a Dagger environment. For example, to run integration tests before deployment; call a custom processing step; or any other custom task which you have already automated, and want to incorporate into your Dagger environment with minimal effort. In this guide, you will learn how to incorporate your custom shell scripts into a Dagger environment. For example, to run integration tests before deployment; call a custom processing step; or any other custom task which you have already automated, and want to incorporate into your Dagger environment with minimal effort.
[FIXME: This section is not yet written](https://github.com/dagger/dagger/blob/main/CONTRIBUTING.md) This section is not yet written. Help Dagger growing by suggesting content improvements.
[![github-contribute](https://user-images.githubusercontent.com/1186424/122426439-8cd5e380-cf90-11eb-944b-c75fadecaefe.png)](https://github.com/dagger/dagger/blob/main/CONTRIBUTING.md)

View File

@ -39,6 +39,10 @@ module.exports = {
lightIcon: "img/Icon_Day-mode.svg", lightIcon: "img/Icon_Day-mode.svg",
}, },
}, },
gtag: {
trackingID: 'G-RDXG80F635',
anonymizeIP: true,
},
}, },
presets: [ presets: [
[ [
@ -62,6 +66,7 @@ module.exports = {
"docusaurus2-dotenv", { "docusaurus2-dotenv", {
systemvars: true, systemvars: true,
}, },
] ],
"@docusaurus/plugin-google-gtag"
], ],
}; };

View File

@ -15,6 +15,7 @@
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "2.0.0-beta.0", "@docusaurus/core": "2.0.0-beta.0",
"@docusaurus/plugin-google-gtag": "^2.0.0-beta.0",
"@docusaurus/preset-classic": "2.0.0-beta.0", "@docusaurus/preset-classic": "2.0.0-beta.0",
"@mdx-js/react": "^1.6.21", "@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0", "@svgr/webpack": "^5.5.0",

View File

@ -9,6 +9,14 @@
/* You can override the default Infima variables here. */ /* You can override the default Infima variables here. */
:root { :root {
--ifm-background-color: var(--ifm-color-primary-light);
--ifm-code-background: var(--ifm-color-primary-dark);
--ifm-code-font-size: 100%;
--ifm-code-border-radius: 2rem;
--ifm-code-color: var(--ifm-color-primary-light);
--ifm-code-padding-vertical: 0;
--ifm-code-padding-horizontal: 0.2rem;
--ifm-color-primary: #0e2b3d; --ifm-color-primary: #0e2b3d;
--ifm-color-primary-dark: #131226; --ifm-color-primary-dark: #131226;
--ifm-color-primary-darker: rgb(31, 165, 136); --ifm-color-primary-darker: rgb(31, 165, 136);
@ -21,43 +29,39 @@
--ifm-color-info: #40b9bc; --ifm-color-info: #40b9bc;
--ifm-color-warning: #ef7b1a; --ifm-color-warning: #ef7b1a;
--ifm-color-danger: #be1d43; --ifm-color-danger: #be1d43;
--ifm-navbar-height: 5rem; --ifm-font-color-base: var(--ifm-color-primary-dark);
--ifm-background-color: var(--ifm-color-primary-light); --ifm-font-family-base: "Karla", sans-serif;
--ifm-navbar-background-color: var(--ifm-color-primary-light); --ifm-font-family-monospace: "Courier new", sans-serif;
--ifm-h2-font-size: 2rem;
--ifm-leading-desktop: 1;
--ifm-link-color: var(--ifm-color-primary-dark);
--ifm-link-hover-color: var(--ifm-color-primary);
--ifm-menu-color: var(--ifm-color-primary-dark); --ifm-menu-color: var(--ifm-color-primary-dark);
--ifm-menu-color-active: var(--ifm-color-primary-dark); --ifm-menu-color-active: var(--ifm-color-primary-dark);
--ifm-menu-color-background-hover: #fdf9d7; --ifm-menu-color-background-hover: #fdf9d7;
--ifm-font-family-base: "Karla", sans-serif; --ifm-menu-color-background-active: #fdf9d7;
--ifm-font-family-monospace: "Courier new", sans-serif; --ifm-menu-link-sublist-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M3.318 9.128a24.776 24.776 0 004.224-3.993.842.842 0 011.32.026c1.227 1.618 2.107 3.387 3.831 4.556.889.6-.159 1.9-1.044 1.3A14.369 14.369 0 018.14 7a30.457 30.457 0 01-3.829 3.463c-.845.671-1.834-.67-.993-1.335z" fill="%23131226" /></svg>');
--ifm-code-background: var(--ifm-color-primary); --ifm-navbar-height: 6rem;
--ifm-code-font-size: 100%; --ifm-navbar-background-color: var(--ifm-color-primary-light);
--ifm-code-border-radius: 2rem; --ifm-pagination-nav-border-radius: 0;
--ifm-code-color: var(--ifm-color-primary-light); --ifm-pre-padding: 2rem;
--ifm-code-padding-vertical: 0; --doc-sidebar-width: 250px;
--ifm-code-padding-horizontal: 0.2rem;
--ifm-h2-font-size: 2rem;
--ifm-menu-color-background-active: var(--ifm-color-primary);
--ifm-menu-color-active: var(--ifm-color-primary-light);
--ifm-leading-desktop: 1;
--ifm-toc-border-color: transparent; --ifm-toc-border-color: transparent;
--ifm-toc-link-color: var(--ifm-color-primary-dark); --ifm-toc-link-color: var(--ifm-color-primary-dark);
--ifm-font-color-base: var(--ifm-color-primary-dark);
--ifm-link-color: var(--ifm-color-primary-dark);
--ifm-link-hover-color: var(--ifm-color-primary);
--ifm-pre-padding: 2rem;
--ifm-pagination-nav-border-radius: 0;
--doc-sidebar-width: 250px;
} }
html[data-theme="dark"] { html[data-theme="dark"] {
--ifm-background-color: var(--ifm-color-primary-dark); --ifm-background-color: var(--ifm-color-primary-dark);
--ifm-navbar-background-color: transparent; --ifm-navbar-background-color: transparent;
--ifm-menu-color-active: var(--ifm-color-primary-light); --ifm-menu-color-active: var(--ifm-color-primary-light);
--ifm-menu-color-background-active: var(--ifm-color-primary);
--ifm-link-color: var(--ifm-color-primary-light); --ifm-link-color: var(--ifm-color-primary-light);
--ifm-link-hover-color: var(--ifm-color-primary-light); --ifm-link-hover-color: var(--ifm-color-primary-light);
--ifm-toc-link-color: var(--ifm-color-primary-light); --ifm-toc-link-color: var(--ifm-color-primary-light);
--ifm-pagination-nav-color-hover: var(--ifm-color-primary-light); --ifm-pagination-nav-color-hover: var(--ifm-color-primary-light);
--ifm-tabs-color-active: var(--ifm-color-primary-light); --ifm-tabs-color-active: var(--ifm-color-primary-light);
--ifm-table-stripe-background: #2e526a;
--ifm-code-background: var(--ifm-color-primary-dark);
} }
/* global */ /* global */
@ -73,8 +77,44 @@ h2 {
line-height: 32px; line-height: 32px;
} }
.markdown > h2 { code {
--ifm-h2-font-size: 1.5rem; margin: 0 1px;
}
.markdown {
& > h2 {
--ifm-h2-font-size: 1.5rem;
--ifm-h2-vertical-rhythm-top: 3;
}
& > h3 {
--ifm-h3-font-size: 1.1875rem;
--ifm-h3-vertical-rhythm-top: 3;
}
a {
font-weight: bold;
text-decoration: underline;
color: var(--ifm-color-primary-dark);
html[data-theme="dark"] & {
color: var(--ifm-color-primary-light);
}
&:hover {
color: var(--ifm-color-primary);
html[data-theme="dark"] & {
color: #fefad8;
}
}
&:active {
color: var(--ifm-color-info);
html[data-theme="dark"] & {
color: var(--ifm-color-info);
}
}
}
} }
p { p {
@ -85,17 +125,27 @@ p {
a[class*="menuLinkExternal"]:after { a[class*="menuLinkExternal"]:after {
background: url("/img/Dagger_Icons_External-link.svg") no-repeat; background: url("/img/Dagger_Icons_External-link.svg") no-repeat;
position: absolute;
right: var(--ifm-menu-link-padding-horizontal);
top: var(--ifm-menu-link-padding-vertical);
}
h1[class^="docTitle"] {
margin-bottom: 3rem;
}
.edit-this-page {
font-weight: bold;
display: flex;
align-items: center;
} }
#__docusaurus { #__docusaurus {
background-color: var(--ifm-color-primary-light); background-color: var(--ifm-color-primary-light);
padding-bottom: 3rem;
html[data-theme="dark"] & { html[data-theme="dark"] & {
background: linear-gradient( background: #0d0c1b;
180deg,
var(--ifm-color-primary-dark),
var(--ifm-color-primary)
);
} }
} }
@ -108,7 +158,7 @@ a[class*="menuLinkExternal"]:after {
/* navbar */ /* navbar */
.navbar__brand { .navbar__brand {
height: var(--ifm-navbar-height); height: 5rem;
} }
.navbar { .navbar {
@ -150,7 +200,7 @@ main[class^="docMainContainer"] {
box-shadow: 0px 4px 16px 4px #13122610; box-shadow: 0px 4px 16px 4px #13122610;
border-radius: 2rem; border-radius: 2rem;
margin-top: 1rem; margin-top: 1rem;
color: #fffef6; color: var(--ifm-color-primary-light);
} }
} }
@ -178,6 +228,8 @@ div[class^="codeBlockContainer"] {
margin-bottom: 2.5rem; margin-bottom: 2.5rem;
div[class^="codeBlockTitle"] { div[class^="codeBlockTitle"] {
background-color: var(--ifm-color-primary-dark) !important;
font-family: var(--ifm-font-family-monospace);
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
@ -203,18 +255,28 @@ button[class^="copyButton"] {
/* hash-link */ /* hash-link */
.hash-link { .hash-link {
color: #40b8bb; svg path + path {
fill: #40b8bb;
&:hover {
color: #175761;
} }
&:focus { &:hover svg path + path {
color: var(--ifm-color-primary-dark); fill: #175761;
}
&:focus svg path + path {
fill: var(--ifm-color-primary-dark);
} }
} }
/* menu */ /* menu */
.menu {
scrollbar-color: #f0efe7 transparent;
}
html[data-theme="dark"] .menu {
scrollbar-color: #3d6581 transparent;
}
.menu__list { .menu__list {
padding-top: 3.5rem; padding-top: 3.5rem;
@ -232,49 +294,41 @@ button[class^="copyButton"] {
color: var(--ifm-color-primary-light); color: var(--ifm-color-primary-light);
} }
html[data-theme="dark"] & { html[data-theme="dark"] &,
color: var(--ifm-color-primary-light); html[data-theme="dark"] &:not([href]),
}
html[data-theme="dark"] &:hover {
color: var(--ifm-color-primary-dark);
}
html[data-theme="dark"] &--active:hover {
color: var(--ifm-color-primary-light);
}
html[data-theme="dark"] &:not([href]) {
color: var(--ifm-color-primary-light);
}
html[data-theme="dark"] &:focus { html[data-theme="dark"] &:focus {
color: var(--ifm-color-primary-light); color: var(--ifm-color-primary-light);
} }
html[data-theme="dark"] &:hover {
background-color: var(--ifm-color-primary);
}
html[data-theme="dark"] &:active { html[data-theme="dark"] &:active {
background-color: var(--ifm-color-primary-light); background-color: var(--ifm-color-primary);
color: var(--ifm-color-primary-dark); color: var(--ifm-color-primary-light);
} }
&.menu__link--sublist { &.menu__link--sublist {
color: var(--ifm-color-primary-dark); color: var(--ifm-color-primary-dark);
&:active, &:active,
&:focus { &:focus {
background-color: var(--ifm-color-primary-light); background-color: var(--ifm-color-primary-light);
} }
&:hover {
background-color: #fdf9d7;
}
html[data-theme="dark"] & { html[data-theme="dark"] & {
color: var(--ifm-color-primary-light); color: var(--ifm-color-primary-light);
} }
html[data-theme="dark"] &:active, html[data-theme="dark"] &:active,
html[data-theme="dark"] &:focus, html[data-theme="dark"] &:focus,
html[data-theme="dark"] &:hover { html[data-theme="dark"] &:hover {
color: var(--ifm-color-primary-dark); color: var(--ifm-color-primary-light);
} background-color: var(--ifm-color-primary);
html[data-theme="dark"] &:active:after,
html[data-theme="dark"] &:focus:after,
html[data-theme="dark"] &:hover:after {
filter: none;
} }
} }
} }
@ -307,6 +361,12 @@ div[class*="admonition-"] .admonition-icon svg {
display: none; display: none;
} }
img[alt="github-contribute"] {
display: block;
margin: auto;
width: 180px;
}
@mixin admonitionIcon($args...) { @mixin admonitionIcon($args...) {
@each $name, $path in meta.keywords($args) { @each $name, $path in meta.keywords($args) {
$bgColor: if( $bgColor: if(

View File

@ -6,12 +6,12 @@
*/ */
import React from 'react'; import React from 'react';
import Link from '@docusaurus/Link'; import Link from '@docusaurus/Link';
import Translate, {translate} from '@docusaurus/Translate'; import Translate, { translate } from '@docusaurus/Translate';
import DocPaginatorPrev from "./Dagger_Icons_Arrow-previous.svg" import DocPaginatorPrev from "./Dagger_Icons_Arrow-previous.svg"
import DocPaginatorNext from "./Dagger_Icons_Arrow-next.svg" import DocPaginatorNext from "./Dagger_Icons_Arrow-next.svg"
function DocPaginator(props) { function DocPaginator(props) {
const {metadata} = props; const { metadata } = props;
return ( return (
<nav <nav
className="pagination-nav" className="pagination-nav"
@ -33,7 +33,7 @@ function DocPaginator(props) {
</Translate> </Translate>
</div> </div>
<div className="pagination-nav__label"> <div className="pagination-nav__label">
<DocPaginatorPrev height={23}/>{metadata.previous.title} <DocPaginatorPrev height={23} style={{ marginRight: '0.5rem' }} />{metadata.previous.title}
</div> </div>
</Link> </Link>
)} )}
@ -49,7 +49,7 @@ function DocPaginator(props) {
</Translate> </Translate>
</div> </div>
<div className="pagination-nav__label"> <div className="pagination-nav__label">
{metadata.next.title}<DocPaginatorNext height={23}/> {metadata.next.title}<DocPaginatorNext height={23} style={{ marginLeft: '0.5rem' }} />
</div> </div>
</Link> </Link>
)} )}

View File

@ -0,0 +1,22 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import Translate from '@docusaurus/Translate';
import IconEdit from '../../../static/img/Dagger_Icons_Edit.svg';
export default function EditThisPage({ editUrl }) {
return (
<a href={editUrl} className='edit-this-page' target="_blank" rel="noreferrer noopener">
<IconEdit width='1.2em' height='1.2em' />
<Translate
id="theme.common.editThisPage"
description="The link label to edit the current page">
Edit this page
</Translate>
</a>
);
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,52 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable jsx-a11y/anchor-has-content, jsx-a11y/anchor-is-valid */
import React from 'react';
import clsx from 'clsx';
import {translate} from '@docusaurus/Translate';
import {useThemeConfig} from '@docusaurus/theme-common';
import './styles.css';
import styles from './styles.module.css';
import AnchorIcon from "./anchor.svg"
const Heading = (Tag) =>
function TargetComponent({id, ...props}) {
const {
navbar: {hideOnScroll},
} = useThemeConfig();
if (!id) {
return <Tag {...props} />;
}
return (
<Tag {...props}>
<a
aria-hidden="true"
tabIndex={-1}
className={clsx('anchor', {
[styles.enhancedAnchor]: !hideOnScroll,
})}
id={id}
/>
{props.children}
<a
className="hash-link"
href={`#${id}`}
title={translate({
id: 'theme.common.headingLinkTitle',
message: 'Direct link to heading',
description: 'Title for link to heading',
})}>
<AnchorIcon />
</a>
</Tag>
);
};
export default Heading;

View File

@ -0,0 +1,23 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
.anchor {
display: block;
position: relative;
top: -0.5rem;
}
.hash-link {
opacity: 0;
padding-left: 0.5rem;
transition: opacity var(--ifm-transition-fast);
}
.hash-link:focus,
*:hover > .hash-link {
opacity: 1;
}

View File

@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
.enhancedAnchor {
top: calc(var(--ifm-navbar-height) * -1 - 0.5rem);
}

View File

@ -1 +1 @@
<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#131226;}</style></defs><path class="cls-1" d="M6.4,12.426a60.626,60.626,0,0,0,5.362-5.9.736.736,0,0,0,.085-.157,1.136,1.136,0,0,0,.345-.09,3.278,3.278,0,0,0,1.622-1.426A.844.844,0,0,0,13.9,4.6a.756.756,0,0,0-.022-.779c-.613-.858-1.157-1.937-2.333-2.026a.968.968,0,0,0-.2.005.786.786,0,0,0-.533.243c-.53.526-1.2,1.126-1.193,1.935a.921.921,0,0,0,.015.152.341.341,0,0,0-.066.022.608.608,0,0,0-.745.283A15.045,15.045,0,0,1,6.5,6.954c-.863.911-1.716,1.83-2.62,2.7a.629.629,0,0,0-.18.309.927.927,0,0,0-.177.182,4.583,4.583,0,0,0-.768,2.018.831.831,0,0,0,.048.434.777.777,0,0,0-.142.11l-.308.308a.653.653,0,1,0,.923.923l.28-.28a.586.586,0,0,0,.637.194,4.108,4.108,0,0,0,2.1-1.34A.626.626,0,0,0,6.4,12.426ZM4,12.547a.285.285,0,0,0,.015-.052,4.518,4.518,0,0,1,.272-1.018c.235.185.478.359.721.535A2.972,2.972,0,0,1,4,12.547Zm6.422-6.4A55.715,55.715,0,0,1,5.9,11.077a.9.9,0,0,0-.117-.114c-.262-.19-.526-.374-.774-.581.83-.811,1.624-1.659,2.42-2.5A23.325,23.325,0,0,0,9.732,5.445,2.367,2.367,0,0,1,10.426,6.146Zm1.439-2.278c.1.137.2.278.291.42a2.164,2.164,0,0,1-.8.522.63.63,0,0,0-.233.18c-.085-.094-.171-.187-.261-.275a.757.757,0,0,0,.45-.691c.025-.044.052-.088.081-.131l.015-.023a.654.654,0,0,0,.053-.06c.057-.066.119-.128.18-.192A2.257,2.257,0,0,1,11.865,3.868Z"/></svg> <svg id="Calque_1" class="iconEdit_2_ui" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#131226;}</style></defs><path class="cls-1" d="M6.4,12.426a60.626,60.626,0,0,0,5.362-5.9.736.736,0,0,0,.085-.157,1.136,1.136,0,0,0,.345-.09,3.278,3.278,0,0,0,1.622-1.426A.844.844,0,0,0,13.9,4.6a.756.756,0,0,0-.022-.779c-.613-.858-1.157-1.937-2.333-2.026a.968.968,0,0,0-.2.005.786.786,0,0,0-.533.243c-.53.526-1.2,1.126-1.193,1.935a.921.921,0,0,0,.015.152.341.341,0,0,0-.066.022.608.608,0,0,0-.745.283A15.045,15.045,0,0,1,6.5,6.954c-.863.911-1.716,1.83-2.62,2.7a.629.629,0,0,0-.18.309.927.927,0,0,0-.177.182,4.583,4.583,0,0,0-.768,2.018.831.831,0,0,0,.048.434.777.777,0,0,0-.142.11l-.308.308a.653.653,0,1,0,.923.923l.28-.28a.586.586,0,0,0,.637.194,4.108,4.108,0,0,0,2.1-1.34A.626.626,0,0,0,6.4,12.426ZM4,12.547a.285.285,0,0,0,.015-.052,4.518,4.518,0,0,1,.272-1.018c.235.185.478.359.721.535A2.972,2.972,0,0,1,4,12.547Zm6.422-6.4A55.715,55.715,0,0,1,5.9,11.077a.9.9,0,0,0-.117-.114c-.262-.19-.526-.374-.774-.581.83-.811,1.624-1.659,2.42-2.5A23.325,23.325,0,0,0,9.732,5.445,2.367,2.367,0,0,1,10.426,6.146Zm1.439-2.278c.1.137.2.278.291.42a2.164,2.164,0,0,1-.8.522.63.63,0,0,0-.233.18c-.085-.094-.171-.187-.261-.275a.757.757,0,0,0,.45-.691c.025-.044.052-.088.081-.131l.015-.023a.654.654,0,0,0,.053-.06c.057-.066.119-.128.18-.192A2.257,2.257,0,0,1,11.865,3.868Z"/></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1356,7 +1356,7 @@
dependencies: dependencies:
"@docusaurus/core" "2.0.0-beta.0" "@docusaurus/core" "2.0.0-beta.0"
"@docusaurus/plugin-google-gtag@2.0.0-beta.0": "@docusaurus/plugin-google-gtag@2.0.0-beta.0", "@docusaurus/plugin-google-gtag@^2.0.0-beta.0":
version "2.0.0-beta.0" version "2.0.0-beta.0"
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.0.0-beta.0.tgz#4836770130cf54ff2cd83affbff9644ee7293e9e" resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.0.0-beta.0.tgz#4836770130cf54ff2cd83affbff9644ee7293e9e"
integrity sha512-V7zaYbhAMv0jexm5H/5sAnoM1GHibcn9QQk5UWC++x1kE0KRuLDZHV+9OyvW5wr0wWFajod/b88SpUpSMF5u+g== integrity sha512-V7zaYbhAMv0jexm5H/5sAnoM1GHibcn9QQk5UWC++x1kE0KRuLDZHV+9OyvW5wr0wWFajod/b88SpUpSMF5u+g==