diff --git a/gulp.d/tasks/build.js b/gulp.d/tasks/build.js index 326a4ad9..b036d8b2 100644 --- a/gulp.d/tasks/build.js +++ b/gulp.d/tasks/build.js @@ -47,7 +47,7 @@ module.exports = (src, dest, preview) => () => { }, ]), // NOTE importFrom is for use in supplemental CSS files - postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: preview }), + postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: true }), preview ? postcssCalc : () => {}, autoprefixer, preview ? () => {} : cssnano({ preset: 'default' }), diff --git a/src/css/asciidoctor-external-callout.css b/src/css/asciidoctor-external-callout.css deleted file mode 100644 index 74b356cf..00000000 --- a/src/css/asciidoctor-external-callout.css +++ /dev/null @@ -1,5 +0,0 @@ -/* Add some spacing between the externally-defined callouts in a source block */ -div.external-callout-block i.conum { - margin-left: 10px; - margin-right: 10px; -} diff --git a/src/css/base.css b/src/css/base.css index 744c3605..70af9314 100644 --- a/src/css/base.css +++ b/src/css/base.css @@ -1,3 +1,8 @@ +/** base.css + * + * Resets and other basic CSS + */ + *, *::before, *::after { @@ -91,7 +96,6 @@ i { .container, .container-fluid { margin: 0 auto; - /* max-width: var(--width-container); */ padding: 0 var(--width-container-gutter); } @@ -119,16 +123,8 @@ i { padding-left: 0; } } -/* .container-fluid { - max-width: var(--width-container-fluid); - padding: 0; - margin: 0 auto; -} */ - -/* checkbox css */ - -/* Base for label styling */ +/* Checkbox css */ [type="checkbox"]:not(:checked), [type="checkbox"]:checked { position: absolute; @@ -203,6 +199,7 @@ i { color: #aaa; } +/* Labels */ label:hover::before { border: 2px solid var(--color-brand-blue); outline: none; @@ -216,218 +213,3 @@ label::after { outline: none; outline-width: 0; } - -/* Common margin padding css class */ -/* margin-top */ -.mt-0 { - margin-top: 0 !important; -} - -.mt-1 { - margin-top: var(--base-extra-small-space) !important; /* 8px */ -} - -.mt-2 { - margin-top: var(--base-small-space) !important; /* 12px */ -} - -.mt-3 { - margin-top: var(--base-space) !important; /* 16px */ -} - -.mt-4 { - margin-top: var(--base-medium-space) !important; /* 24px */ -} - -.mt-5 { - margin-top: var(--base-large-space) !important; /* 32px */ -} - -/* margin-bottom */ -.mb-0 { - margin-bottom: 0 !important; -} - -.mb-1 { - margin-bottom: var(--base-extra-small-space) !important; /* 8px */ -} - -.mb-2 { - margin-bottom: var(--base-small-space) !important; /* 12px */ -} - -.mb-3 { - margin-bottom: var(--base-space) !important; /* 16px */ -} - -.mb-4 { - margin-bottom: var(--base-medium-space) !important; /* 24px */ -} - -.mb-5 { - margin-bottom: var(--base-large-space) !important; /* 32px */ -} - -/* Responsive css */ -/* For tablet,ipad Portrait view mode 1024px screen */ -@media screen and (min-width: 740px) { - /* Spacing media query */ - .mt-sm-0 { - margin-top: 0 !important; - } - - .mt-sm-1 { - margin-top: var(--base-extra-small-space) !important; /* 8px */ - } - - .mt-sm-2 { - margin-top: var(--base-small-space) !important; /* 12px */ - } - - .mt-sm-3 { - margin-top: var(--base-space) !important; /* 16px */ - } - - .mt-sm-4 { - margin-top: var(--base-medium-space) !important; /* 24px */ - } - - .mt-sm-5 { - margin-top: var(--base-large-space) !important; /* 32px */ - } - - /* margin-bottom */ - .mb-sm-0 { - margin-bottom: 0 !important; - } - - .mb-sm-1 { - margin-bottom: var(--base-extra-small-space) !important; /* 8px */ - } - - .mb-sm-2 { - margin-bottom: var(--base-small-space) !important; /* 12px */ - } - - .mb-sm-3 { - margin-bottom: var(--base-space) !important; /* 16px */ - } - - .mb-sm-4 { - margin-bottom: var(--base-medium-space) !important; /* 24px */ - } - - .mb-sm-5 { - margin-bottom: var(--base-large-space) !important; /* 32px */ - } -} -/* For tablet,ipad landscape mode 1024px screen */ -@media screen and (min-width: 993px) { - .container-fluid { - /* max-width: var(--width-container-fluid); */ - padding: 0; - margin: 0 auto; - } - - /* Spacing media query */ - .mt-md-0 { - margin-top: 0 !important; - } - - .mt-md-1 { - margin-top: var(--base-extra-small-space) !important; /* 8px */ - } - - .mt-md-2 { - margin-top: var(--base-small-space) !important; /* 12px */ - } - - .mt-md-3 { - margin-top: var(--base-space) !important; /* 16px */ - } - - .mt-md-4 { - margin-top: var(--base-medium-space) !important; /* 24px */ - } - - .mt-md-5 { - margin-top: var(--base-large-space) !important; /* 32px */ - } - - /* margin-bottom */ - .mb-md-0 { - margin-bottom: 0 !important; - } - - .mb-md-1 { - margin-bottom: var(--base-extra-small-space) !important; /* 8px */ - } - - .mb-md-2 { - margin-bottom: var(--base-small-space) !important; /* 12px */ - } - - .mb-md-3 { - margin-bottom: var(--base-space) !important; /* 16px */ - } - - .mb-md-4 { - margin-bottom: var(--base-medium-space) !important; /* 24px */ - } - - .mb-md-5 { - margin-bottom: var(--base-large-space) !important; /* 32px */ - } -} -/* For large desktop to small desktop screen */ -@media screen and (min-width: 1200px) { - /* Spacing media query */ - .mt-lg-0 { - margin-top: 0 !important; - } - - .mt-lg-1 { - margin-top: var(--base-extra-small-space) !important; /* 8px */ - } - - .mt-lg-2 { - margin-top: var(--base-small-space) !important; /* 12px */ - } - - .mt-lg-3 { - margin-top: var(--base-space) !important; /* 16px */ - } - - .mt-lg-4 { - margin-top: var(--base-medium-space) !important; /* 24px */ - } - - .mt-lg-5 { - margin-top: var(--base-large-space) !important; /* 32px */ - } - - /* margin-bottom */ - .mb-lg-0 { - margin-bottom: 0 !important; - } - - .mb-lg-1 { - margin-bottom: var(--base-extra-small-space) !important; /* 8px */ - } - - .mb-lg-2 { - margin-bottom: var(--base-small-space) !important; /* 12px */ - } - - .mb-lg-3 { - margin-bottom: var(--base-space) !important; /* 16px */ - } - - .mb-lg-4 { - margin-bottom: var(--base-medium-space) !important; /* 24px */ - } - - .mb-lg-5 { - margin-bottom: var(--base-large-space) !important; /* 32px */ - } -} diff --git a/src/css/body.css b/src/css/body.css index 49241fed..ac861d42 100644 --- a/src/css/body.css +++ b/src/css/body.css @@ -1,8 +1,12 @@ -/* NOTE min-width of flex: 1 container = content-width to prevent wrapping by default; min-width: 0 lets content wrap */ +/** body.css + * + * Styles for body, main, and .nav + * TODO: compare main.css and nav.css + */ + div.body { display: flex; margin-top: var(--height-to-body); - /* overflow-wrap: break-word; */ word-wrap: break-word; /* IE only supports word-wrap, which is an alias of overflow-wrap */ } @@ -13,6 +17,9 @@ div.body { margin-top: var(--height-navbar); } +/* NOTE + min-width of flex: 1 container = content-width to prevent wrapping by default; + min-width: 0 lets content wrap */ main { flex: 1; min-width: 0; diff --git a/src/css/callouts.css b/src/css/callouts.css new file mode 100644 index 00000000..851c4154 --- /dev/null +++ b/src/css/callouts.css @@ -0,0 +1,23 @@ +/** callouts.css + * + * Format code callouts https://docs.asciidoctor.org/asciidoc/latest/verbatim/callouts/ + * + * Support for Ray's Externally defined callouts: + * https://www.npmjs.com/package/asciidoctor-external-callout + * + * Utility class `.no-callouts` lets you hide callouts in listing blocks. + * Example: + * [source.no-callouts,sqlpp] + * -- + * SELECT foo from... <1> + * -- + */ + +div.external-callout-block i.conum { + margin-left: 10px; + margin-right: 10px; +} + +.no-callouts .conum { + display: none !important; +} diff --git a/src/css/clipboard.css b/src/css/clipboard.css index f049e206..377d6ff4 100644 --- a/src/css/clipboard.css +++ b/src/css/clipboard.css @@ -1,3 +1,9 @@ +/** clipboard.css + * + * Styles for View Source code button + * and other listing block formatting + */ + .view-source-button, .copy-code-button { color: var(--color-brand-gray4); diff --git a/src/css/component-frame.css b/src/css/component-frame.css index bd90c8b4..1a9d29f1 100644 --- a/src/css/component-frame.css +++ b/src/css/component-frame.css @@ -1,9 +1,13 @@ +/** component-frame.css + * + * .component-frame and .frame-body + * NB: may be unused, deleted in 4d2db54746392090df7084978770f58f4709e56c ? + */ + .component-frame { - /* rgba(87, 160, 255, 1) */ background: var(--color-brand-gray6); padding: 0 15px 0 15px; display: flex; - /* align-items: center; */ justify-content: center; position: relative; } @@ -20,7 +24,6 @@ .frame-body { margin-left: var(--base-extra-small-space); - /* position: relative; */ padding-top: 12px; padding-bottom: 12px; padding-right: 0; @@ -48,9 +51,6 @@ .component-frame .frame-link-dropdowns { display: inline-block; line-height: 1; - /* position: relative; - padding-bottom: 20px; - margin-bottom: -20px; */ } .frame-body .frame-link { @@ -99,7 +99,6 @@ .frame-dropdown ul { background: var(--color-brand-white); border-radius: 0; - /* box-shadow: 0 3px 10px -4px var(--color-brand-gray8); */ margin: 0; } @@ -127,11 +126,6 @@ border-left: 3px solid var(--color-brand-gray8); } -/* .frame-dropdown ul.frame-dropdown-list li, -.frame-dropdown ul.related li { - border-bottom: 1px solid var(--color-brand-gray8); -} */ - ul.frame-dropdown-list li:last-child, .frame-dropdown ul.related li:last-child { border-bottom: 0; diff --git a/src/css/contributor.css b/src/css/contributor.css deleted file mode 100644 index 7c3c4cb1..00000000 --- a/src/css/contributor.css +++ /dev/null @@ -1,70 +0,0 @@ -.contributor-list-box { - /* display: flex; */ - align-items: center; - flex-wrap: wrap; - margin: 15px 0 0; - visibility: hidden; - display: none; -} - -.contributor-list-box.show { - visibility: visible; -} - -.contributor-list-box span { - font-size: 0.875rem; - line-height: 1; - color: var(--color-brand-gray3); - position: relative; - padding-right: 15px; -} - -.contributor-list-box .last-commit-date::after { - content: ""; - width: 1px; - height: 100%; - background: var(--color-brand-gray3); - position: absolute; - right: 0; - top: 0; -} - -#otherContributor { - margin-left: 5px; -} - -.contributor-list-box ul { - display: flex; - flex-wrap: wrap; - padding-left: 10px; -} - -.contributor-list-box ul::before { - content: none; -} - -.contributor-list-box ul li { - margin-right: 10px; - width: 22px; - height: 22px; - list-style: none; -} - -.contributor-list-box ul li:last-child { - margin-right: 0; -} - -.contributor-list-box ul li img { - max-width: 100%; - border-radius: 50%; -} - -@media only screen and (max-width: 767px) { - .contributor-list-box span { - padding-right: 10px; - } - - #otherContributor { - padding-right: 0; - } -} diff --git a/src/css/crumbs.css b/src/css/crumbs.css index 62fa348f..3f1d09df 100644 --- a/src/css/crumbs.css +++ b/src/css/crumbs.css @@ -1,3 +1,8 @@ +/** crumbs.css + * + * Format the breadcrumbs + */ + .crumbs { color: var(--color-muted); font-weight: var(--weight-light); diff --git a/src/css/disable-callouts.css b/src/css/disable-callouts.css deleted file mode 100644 index c43050c9..00000000 --- a/src/css/disable-callouts.css +++ /dev/null @@ -1,3 +0,0 @@ -.no-callouts .conum { - display: none !important; -} diff --git a/src/css/doc.css b/src/css/doc.css index 308d3b29..24a928dd 100644 --- a/src/css/doc.css +++ b/src/css/doc.css @@ -1,3 +1,10 @@ +/** doc.css + * + * Styles for
+ * + * Looks like base formatting for the Asciidoc content. + */ + .doc { padding-top: 1.25rem; } @@ -49,21 +56,11 @@ .doc h2 { font-size: var(--heading-h2); - /* max-width: fit-content; */ width: 100%; margin-top: var(--base-extra-large-space); /* NOTE used to restrict width of key line */ } -/* .doc h2::after { - content: ""; - display: block; - max-width: 5.75rem; - height: 0; - outline: 0.5px solid currentColor; - margin-top: 1.0625rem; -} */ - .doc h3 { font-size: var(--heading-h3); margin-top: var(--base-extra-large-space); @@ -122,11 +119,6 @@ text-decoration: underline; } -/* .doc code { - color: var(--color-text); - font-weight: var(--weight-medium); -} */ - .doc pre code { display: block; color: inherit; @@ -185,7 +177,6 @@ occur inside lists. .doc caption { font-size: var(--font-base); font-weight: var(--weight-semibold); - /* letter-spacing: -0.025em; */ line-height: 1.2; margin-bottom: var(--base-space); color: var(--color-brand-gray3); @@ -222,18 +213,6 @@ ul ul ul { margin-bottom: var(--base-extra-small-space); } -/* .doc table.tableblock, -.doc th.tableblock, -.doc td.tableblock { - border: 0 solid var(--color-border-table); -} - -.doc table.tableblock { - border-width: 1px; - border-collapse: collapse; - margin: 1.5rem 0 2rem; -} */ - /* TODO drop .spread after upgrading to Asciidoctor 1.5.7 */ .doc table.spread, @@ -245,16 +224,6 @@ ul ul ul { text-align: left; } -/* .doc table.tableblock > tbody { - font-weight: var(--weight-light); -} */ - -/* NOTE prevent wide tables from exceeding bounds */ - -/* TODO could also target table.tableblock[style^="width:"] */ - -/* TODO drop .spread after upgrading to Asciidoctor 1.5.7 */ - .doc table.spread > tbody > tr > *, .doc table.stretch > tbody > tr > * { /* NOTE setting max-width reactivates overflow-wrap behavior on the table cell */ @@ -444,7 +413,6 @@ ul ul ul { flex-direction: column; border: 1px solid var(--color-brand-gray8); padding: var(--base-space); - /* padding-left: var(--base-space); */ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06); border-radius: 5px; align-items: center; @@ -509,19 +477,6 @@ ul ul ul { font-weight: inherit; } -/* Use this for a working pseudo element before an [abstract] attribute-marked block in the documentation. - This one adds the words "Quick Summary" before any text inside the [abstract] block. */ - -/* -.doc .abstract blockquote::before { - content: "Quick Summary \a"; - white-space: pre; - color: var(--color-muted); - font-weight: var(--weight-medium); - font-size: var(--heading-h4); - padding-bottom: 1rem; -} */ - .doc ul { margin: 0; padding: 0 0 0 1rem; @@ -546,11 +501,11 @@ ul ul ul { } .doc ul.checklist i.fa-check-square-o::before { - content: "\2713"; + content: "\2713"; /* check-mark */ } .doc ul.checklist i.fa-square-o::before { - content: "\274f"; + content: "\274f"; /* square with a shadow outline */ } .doc .dlist .dlist, @@ -626,18 +581,6 @@ ul ul ul { /* NOTE assume pre.highlight contains code[data-lang] */ -/* .doc pre.highlight code::after, -.doc pre:not(.highlight)::after{ - content: ''; - display: inline-block; - background: transparent linear-gradient(180deg, #F1F7FE0D 0%, #F1F7FE40 18%, #F1F7FE 68%, #F1F7FE 100%) 0% 0% no-repeat padding-box; - width: 65px; - height: 100%; - position: absolute; - right: 0; - top: 0; -} */ - .doc pre.highlight { position: relative; } @@ -648,41 +591,6 @@ ul ul ul { padding: 0; } -/* .doc pre.highlight .hljs-attr { - color: var(--hljs-attr); -} */ - -/* .doc pre.highlight .hljs-string { - color: var(--hljs-string); -} */ - -/* .doc pre.highlight .hljs-number { - color: var(--hljs-number); -} */ - -/* .doc .listingblock code[data-lang]::before { - content: attr(data-lang); - color: var("--color-brand-gray1"); - display: none; - font-size: 0.75rem; - font-weight: var(--weight-normal); - letter-spacing: 1px; - line-height: 18px; - text-transform: uppercase; - position: absolute; - top: 0.375rem; - right: 2rem; - font-family: "Source Sans Pro", sans-serif; - padding-right: 6px; - border-right: 1px solid var(--color-brand-gray9); -} - -.doc .listingblock:hover code[data-lang]::before { - display: block; -} - -*/ - table.tableblock code.language-console.hljs.shell, table.tableblock pre code.language-bash.hljs { white-space: normal; @@ -717,10 +625,6 @@ table.tableblock pre code.language-bash.hljs { margin-top: var(--base-extra-small-space); } -/* .doc .dlist dd > .openblock > .content > :first-child { - margin-top: 0; -} */ - .doc .sidebarblock > .content { border: 1px solid var(--color-border); padding: 2.5rem; diff --git a/src/css/external-link-icon.css b/src/css/external-link-icon.css index 923a5709..8fc8824f 100644 --- a/src/css/external-link-icon.css +++ b/src/css/external-link-icon.css @@ -1,8 +1,13 @@ +/** external-link-icon.css + * + * Add external link icon to links that aren't to couchbase.com + */ + .doc a[href^="https://"]:not([href*=".couchbase.com"]):not([href*="localhost"]):not([href*="127.0.0.1"]):not(.remove-ext-icon)::after, .doc a[href^="http://"]:not([href*=".couchbase.com"]):not([href*="localhost"]):not([href*="127.0.0.1"]):not(.remove-ext-icon)::after, a.add-ext-icon::after { font-family: "Font Awesome Light", serif; - content: "\f35d"; + content: "\f35d"; /* alternate external link icon */ font-size: inherit; color: inherit; display: none; diff --git a/src/css/feedback.css b/src/css/feedback.css index 60245af7..e290ab50 100644 --- a/src/css/feedback.css +++ b/src/css/feedback.css @@ -1,3 +1,10 @@ +/** feedback.css + * + * I believe these elements are created by + * Jira Issue Collector script. + * e.g. we don't output these in docs-ui + */ + #atlwdg-trigger.atlwdg-trigger { display: none; background: linear-gradient(to right, var(--color-brand-pink) 0%, var(--color-brand-orange) 100%); diff --git a/src/css/footer.css b/src/css/footer.css index e68050df..89b867ba 100644 --- a/src/css/footer.css +++ b/src/css/footer.css @@ -1,10 +1,15 @@ +/** footer.css + * + * Styles for footer + * NB: we have a couple of 'float' declarations below, to investigate. + */ + .footer { background-color: var(--color-footer-bg); color: var(--color-footer-text); padding: 2.5rem 0; position: relative; z-index: var(--z-index-footer); - /* box-shadow: 0 0 10px -5px #999; FIX BELOW */ border-top: 1px solid var(--color-border-table); } @@ -162,8 +167,6 @@ h2.footer-column-title { .footer-terms { font-size: 0.575rem; - - /* font-size: 0.875rem; */ line-height: 1; border-top: 1px solid var(--color-footer-text); padding: 2.125rem 0 0.3125rem; diff --git a/src/css/header.css b/src/css/header.css index 96e5471a..d956c10f 100644 --- a/src/css/header.css +++ b/src/css/header.css @@ -1,3 +1,8 @@ +/** header.css + * + * Styles for header + */ + .header-top-row { background: var(--color-brand-white); padding: 0 var(--width-container-gutter); @@ -135,19 +140,6 @@ display: inline-block; } -.parent-site { - /* margin: 0 10px; - padding: 0 10px; */ - /* border-right: 1px solid var(--color-brand-gray5); - border-left: 1px solid var(--color-brand-gray5); */ -} - -/* .parent-site a { - color: var(--color-brand-gray4); - font-size: 1rem; - font-family: "Source Sans Pro", sans-serif; -} */ - .search { position: relative; } @@ -208,7 +200,7 @@ } .navbar-dropdown li.current a.navbar-item::before { - content: "\2023"; + content: "\2023"; /* ‣ */ position: absolute; left: -0.75em; } @@ -255,11 +247,6 @@ width: 283px; } - /* .parent-site { - margin: 0; - padding: 0 var(--column-space); - } */ - .navbar.navbar-new-top { padding: 1.25rem 0; line-height: 1; @@ -318,13 +305,6 @@ font-size: 18px; color: #ffffffbf; } - /* .parent-site { - border-left: none; - } - - .parent-site a { - color: var(--color-brand-white); - } */ .free-trial-link { background: var(--color-brand-white); diff --git a/src/css/highlight.css b/src/css/highlight.css index 3465519f..a897ad15 100644 --- a/src/css/highlight.css +++ b/src/css/highlight.css @@ -1,4 +1,5 @@ -/** +/** highlight.css + Steps to change the highlight.js theme: 1. View available themes on https://highlightjs.org/static/demo/ @@ -11,9 +12,9 @@ Other CSS rules for styling code blocks: - In doc.css, the `.doc pre:not(.highlight), .doc pre.highlight code` selector sets the code block `color` and `background-color` - In docs.css, the `.doc .listingblock code[data-lang]::before` selector sets the language label `color` */ + .hljs-comment, .hljs-meta { - /* color: #708090; */ color: var(--color-brand-gray1); } @@ -47,7 +48,6 @@ Other CSS rules for styling code blocks: .hljs-built_in, .hljs-function .hljs-title { - /* color: #e6db74; */ color: var(--color-brand-orange); } diff --git a/src/css/home.css b/src/css/home.css index 6ce4a69b..37f170c8 100644 --- a/src/css/home.css +++ b/src/css/home.css @@ -1,3 +1,14 @@ +/** home.cs + * + * Styles for .home + * NB: not sure where this is? Landing pages? + * We can have body, div, main with class of .home + * via layout: home + * But grep suggests this may no longer be used. + * + * Also for .tutorials and .searchbar + */ + .home .paragraph { margin-top: 1.25rem; } @@ -139,7 +150,6 @@ .home .card .ulist { font-weight: var(--weight-bold); margin: 1.5rem 0 0.5rem; - /* overflow-wrap: normal; */ word-wrap: normal; /* NOTE not sure why this is required, but without it, list items get spaced apart */ } @@ -149,7 +159,7 @@ } .home .card a::after { - content: "\00a0>"; + content: "\00a0>"; /* non breaking space then > */ width: 0; display: inline-block; } @@ -281,10 +291,6 @@ font-size: 1.3rem; } -mark { - /* background: #f4f8fd; */ -} - .tutorials.body.tiles .sect1 { border: 1px solid var(--color-brand-silver); margin: 0 0 1.25rem 0; @@ -313,11 +319,6 @@ mark { margin-bottom: 1.25rem; } -/* fix the height. some titles span over 2 lines */ -.tutorials.body.tiles .title { - /* height: 62px; */ -} - /* fix the height. tutorial summaries vary in length */ .tutorials.body.tiles .sect2 .summary p { height: 100%; diff --git a/src/css/info-banner.css b/src/css/info-banner.css index 0acab440..83014b64 100644 --- a/src/css/info-banner.css +++ b/src/css/info-banner.css @@ -1,10 +1,21 @@ +/** info-banner.css + * + * Home pages all have + * + * include::home::partial$info-banner.adoc[] + * + * The partial itself may be switched off + * (e.g. commented out) + * to remove the element from all pages. + */ + .info-banner { display: block; border: 1px solid #e5e5e5; border-radius: 3px; -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06); - background-image: linear-gradient(to right, #00ace0, #636cdc); + background-image: linear-gradient(to right, var(--color-brand-purple) 0%, var(--color-brand-light-blue) 100%); padding: 0.75em; margin-top: 0; margin-bottom: 1em; diff --git a/src/css/is-this-helpful.css b/src/css/is-this-helpful.css index 521dd711..a26d73dd 100644 --- a/src/css/is-this-helpful.css +++ b/src/css/is-this-helpful.css @@ -1,5 +1,8 @@ - -@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700&display=swap"); +/** is-this-helpful.css + * + * Style the Is this helpful? thumbs up/down feature + * in the table of contents + */ .is-this-helpful-box * { font-family: "Source Sans Pro", sans-serif; @@ -9,7 +12,6 @@ display: inline-block; width: 100%; margin-bottom: 25px; - /* border-top: 1px solid #ccc; */ padding-top: 25px; font-family: "Source Sans Pro", sans-serif; } diff --git a/src/css/labels.css b/src/css/labels.css index 5fe02cf3..bfb715b1 100644 --- a/src/css/labels.css +++ b/src/css/labels.css @@ -1,3 +1,8 @@ +/** labels.css + * + * doc .labels, .edition, .status + */ + .doc .labels ul, .doc .labels p { display: flex; @@ -34,21 +39,10 @@ top: -1rem; } -/* .doc .labels li:first-child::before, -.doc .labels span:first-child::before { - content: ""; - display: block; - position: absolute; - left: calc(50% - 0.5rem); - border: 0.5rem solid transparent; - top: -1rem; -} */ - .doc .labels li, .doc .edition, .doc .status, .doc .edition.page-edition { - /* color: #fff; */ display: inline-block; padding: 6px; text-transform: uppercase; @@ -69,10 +63,6 @@ color: inherit; } -/* .doc .labels li.edition { - background-color: var(--color-brand-light-blue); -} */ - .doc .edition { color: var(--color-brand-blue-secondary); border: 1px solid var(--color-brand-blue-secondary); @@ -139,26 +129,3 @@ .doc .edition.page-edition:hover { opacity: 1; } - -/* .doc .labels span:first-child, -.doc .labels li:first-child { - opacity: 1; -} */ - -/* .doc .labels span.edition::before{ - color: var(--color-brand-blue-secondary); - border:1px solid var(--color-brand-blue-secondary); -} */ - -/* .doc .labels li.edition::before { - border-bottom-color: var(--color-brand-light-blue); -} */ - -/* .doc .labels li.status { - background-color: var(--color-brand-orange); -} */ - -/* .doc .labels li.status:first-child::before, -.doc .labels span.status:first-child::before { - border-bottom-color: var(--color-brand-orange); -} */ diff --git a/src/css/landing-page.css b/src/css/landing-page.css index 8c3f82b1..a660c8a8 100644 --- a/src/css/landing-page.css +++ b/src/css/landing-page.css @@ -1,4 +1,7 @@ -/* Landing Page CSS */ +/** landing-page.css + * + * Styles for Landing Pages + */ .doc.landing-page-doc h1 { color: var(--color-brand-gray1); @@ -41,10 +44,6 @@ } .doc.landing-page-doc .sub-heading.two-column-heading { - /* display: flex; - justify-content: space-between; - align-items: center; - flex-wrap: wrap; */ display: block; } @@ -245,10 +244,6 @@ display: none; } -/* .card-row.two-column-row .column:nth-child(even) { - padding-left: 5%; -} */ - .doc.landing-page-doc iframe { width: 100%; height: 315px; diff --git a/src/css/main.css b/src/css/main.css index ee8b6432..dde6441e 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1,17 +1,43 @@ +/** main.css + * + * Styles for: + +
+
... +
... + + */ + main { padding-bottom: 4rem; } -/* IMPORTANT for this to work, the element cannot be display: flex and cannot have padding top or border top */ +/* This pseudo-element appears to be a home-brewed scroll-padding-top, + e.g. is to prevent navigation anchor links from being hidden behind the Menu bar. + + For this to work, the element cannot be display: flex + and cannot have padding top or border top. + + By default the var(--scroll-margin-top-space) is set to 7.1em + (e.g. the height of the navbar). + When a banner ("A newer version of this documentation is available") + is shown, this variable is dynamically replaced to account for the + banner height. + */ + main [id]::before { content: ""; display: inherit; - height: var(--h2-heading-top-space); - margin-top: calc(-1 * var(--h2-heading-top-space)); + height: var(--scroll-margin-top-space); + margin-top: calc(-1 * var(--scroll-margin-top-space)); visibility: hidden; width: 0; } +main.with-banner { + --scroll-margin-top-space: var(--scroll-margin-top-space-plus-banner); +} + main table[id]::before { display: block; } @@ -42,21 +68,26 @@ main p { hyphens: auto; /* NOTE in Chrome, hyphens: auto is only supported on macOS and Android */ } +/* The "You are viewing a pre-release" banner */ .article-banner { align-items: center; - /* background: linear-gradient(to right, var(--color-brand-purple) 0%, var(--color-brand-light-blue) 100%); */ - background: transparent; + background: white; border: 1px solid #1174e0; color: var(--color-brand-blue-secondary); display: flex; line-height: 1; margin: 1.25rem 0 0; - /* margin: calc(-1 * var(--height-spacer)) calc(-1 * var(--width-container-gutter)) var(--height-spacer); */ padding: var(--base-space); border-radius: 3px; font-family: "Open Sans", sans-serif; font-weight: var(--weight-normal); flex-wrap: wrap; + /* sticky, 2px from the top menu. + Add a white shadow to top to avoid flashing moire as the text scrolls past. */ + position: sticky; + z-index: 9; + top: calc(7.1rem + 2px); + box-shadow: 0 -2px white; } .article-banner p { @@ -65,12 +96,6 @@ main p { color: var(--color-brand-blue-secondary); } -/* .article-banner span { - font-size: var(--font-small); - margin: 0.5rem 1rem 0 0; - color: var(--color-brand-gray4); -} */ - .article-banner svg { margin-right: 10px; margin-bottom: 10px; @@ -119,7 +144,7 @@ main p { min-width: 0; } -/* color css */ +/* color css NB: unused? */ .text-color-brand-blue { color: var(--color-brand-blue); } @@ -141,9 +166,6 @@ main p { .toc { margin: 0 auto 0 0; } - /* .article-banner { - margin: var(--base-small-space) 0 var(--base-space); - } */ .article-header { align-items: flex-start; diff --git a/src/css/nav.css b/src/css/nav.css index 2cdd1e11..993dfd26 100644 --- a/src/css/nav.css +++ b/src/css/nav.css @@ -1,3 +1,8 @@ +/** nav.css + * + * Styles for nav, left-sidebar, menus, and tutorials-filter + */ + .left-sidebar { width: 20rem; } @@ -117,7 +122,6 @@ } .menu_list.is-current-page > .menu_line { - /* background: #4287d60f; */ border-right: 4px solid rgba(66, 135, 214, 0.44); font-weight: var(--weight-semibold); } @@ -129,7 +133,6 @@ word-break: break-word; font-family: 'Source Sans Pro', sans-serif; text-decoration: none; - /* padding: 0.25rem 0; */ } a.menu_link { diff --git a/src/css/optanon.css b/src/css/optanon.css index 0bd024f1..930a55d5 100644 --- a/src/css/optanon.css +++ b/src/css/optanon.css @@ -1,3 +1,8 @@ +/** optanon.css + * + * Style vendor popup from optanon (OneTrust Cookie) + */ + .optanon-alert-box-wrapper, #optanon-popup-wrapper { position: fixed; diff --git a/src/css/pagination.css b/src/css/pagination.css index a3118661..6685b22c 100644 --- a/src/css/pagination.css +++ b/src/css/pagination.css @@ -1,3 +1,12 @@ +/** pagination.css + * + * Styles for Prev and Next navigation, enabled on some pages + * by e.g.: + * :page-pagination: full + * + * See e.g. https://docs.couchbase.com/php-sdk/current/hello-world/platform-help.html + */ + nav.pagination { display: flex; border-top: 1px solid var(--color-border-table); @@ -54,10 +63,10 @@ nav.pagination a::after { } nav.pagination .prev a::before { - content: "\2039"; + content: "\2039"; /* < */ transform: translateX(-100%); } nav.pagination .next a::after { - content: "\203a"; + content: "\203a"; /* > */ } diff --git a/src/css/site.css b/src/css/site.css index 8ca90e74..1abe68d6 100644 --- a/src/css/site.css +++ b/src/css/site.css @@ -1,37 +1,47 @@ +/** site.css + * + * Index of all CSS for site + */ + +/* Font imports */ @import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700&display=swap"); @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@300;400;500;600;700&display=swap'); -@import "common.css"; @import "typeface-gotham.css"; @import "typeface-roboto-mono.css"; -@import "vars.css"; + +/* Foundation */ @import "base.css"; +@import "common.css"; +@import "vars.css"; + +/* Major structural components */ @import "body.css"; @import "nav.css"; -@import "toc.css"; -@import "main.css"; -@import "crumbs.css"; -@import "toolbar.css"; -@import "labels.css"; @import "doc.css"; -/* @import "@asciidoctor/tabs"; */ -@import "tabs.css"; +@import "footer.css"; +@import "header.css"; +@import "main.css"; @import "pagination.css"; -@import "swagger-ui.css"; +@import "toc.css"; + +/* Landing pages */ @import "home.css"; -@import "header.css"; -@import "footer.css"; -@import "optanon.css"; -@import "highlight.css"; -@import "feedback.css"; +@import "landing-page.css"; + +/* Other components */ +@import "callouts.css"; +@import "clipboard.css"; @import "component-frame.css"; +@import "crumbs.css"; +@import "external-link-icon.css"; +@import "feedback.css"; +@import "highlight.css"; @import "is-this-helpful.css"; -@import "clipboard.css"; +@import "info-banner.css"; +@import "labels.css"; +@import "optanon.css"; +@import "swagger-ui.css"; @import "table.css"; -@import "landing-page.css"; -@import "contributor.css"; +@import "tabs.css"; @import "terminal.css"; -@import "external-link-icon.css"; -@import "disable-callouts.css"; -@import "asciidoctor-external-callout.css"; -@import "info-banner.css"; diff --git a/src/css/swagger-ui.css b/src/css/swagger-ui.css index cdd55f43..12151a53 100644 --- a/src/css/swagger-ui.css +++ b/src/css/swagger-ui.css @@ -1,3 +1,8 @@ +/** swagger-ui.css + * + * Style vendor css override for Swagger UI + */ + .doc .swagger-ui .topbar, .doc .swagger-ui .wrapper.information-container { display: none; diff --git a/src/css/table.css b/src/css/table.css index d76c4013..b8a3773c 100644 --- a/src/css/table.css +++ b/src/css/table.css @@ -1,6 +1,7 @@ -/* ============================================================================= - Responsive Table CSS - ========================================================================== */ +/** table.css + * + * Responsive table CSS + */ table.tableblock, table.tableblock thead, @@ -45,18 +46,10 @@ table.tableblock thead th { font-weight: var(--weight-semibold); } -/* table.tableblock tbody td:first-child strong { - font-size: 1.125rem; -} */ - table.tableblock tbody tr { display: table-cell; } -/* .tableblock tbody tr :hover{ - background: var(--color-brand-gray7); - } */ - table.tableblock > tbody td, table.tableblock > tbody th { display: block; @@ -85,37 +78,21 @@ table.tableblock tbody td.tableblock p.tableblock { margin-top: 1rem; } -/* table.tableblock .content .paragraph, -table.tableblock .content .ulist { - margin-top: 0; -} */ - -/* table.tableblock tr:nth-child(odd) { - background: rgba(0, 0, 0, 0.07);g29 - - } - */ - -/* table.tableblock tbody tr:hover { - background: var(--color-brand-gray7); -} */ - table.tableblock .title { - display: inline-block; + /* display: table-caption; + compresses caption on e.g. + https://docs.couchbase.com/server/current/backup-restore/enterprise-backup-restore.html + into single cell at width < 768px. + */ width: 100%; padding: 10px 0 0; - margin-bottom: 10px; + margin: 10px 0; } .doc .admonitionblock td.icon { border-bottom: none; } -/* table.table-merge-cells tr:hover { - background-color: var(--color-brand-gray7); -} -*/ - table.table-tutorial tr th:last-child, table.table-tutorial tr td:last-child { background-color: var(--color-brand-gray7); @@ -152,19 +129,12 @@ table.table-tutorial tr td:last-child { } /* Responsive css */ - @media screen and (min-width: 768px) { table.tableblock { display: table; position: relative; } - table.tableblock caption.title { - position: absolute; - left: 0; - top: -30px; - } - table.tableblock.caption-table, div.ulist + table.tableblock, table.tableblock + table.tableblock { diff --git a/src/css/tabs.css b/src/css/tabs.css index 84e938b9..f32108fd 100644 --- a/src/css/tabs.css +++ b/src/css/tabs.css @@ -1,6 +1,11 @@ -/* Starting point: - * Asciidoctor Tabs | Copyright (c) 2018-present Dan Allen | MIT License - * Then hand-edited to match previous style as well as possible */ +/** tabs.css + * + * Style vendor css for @asciidoctor/tabs + * + * NB: we currently do NOT + * @import "@asciidoctor/tabs" + * so this defines the full CSS rather than overriding. + */ .tabs { margin-top: 2em; diff --git a/src/css/terminal.css b/src/css/terminal.css index 86189062..0a6f8fc7 100644 --- a/src/css/terminal.css +++ b/src/css/terminal.css @@ -1,3 +1,9 @@ +/** terminal.css + * + * Style the Try It Now box + * (source code to couchbase.live integration) + */ + .action-panel { display: none; position: absolute; diff --git a/src/css/toc.css b/src/css/toc.css index 332c5e7e..170d0816 100644 --- a/src/css/toc.css +++ b/src/css/toc.css @@ -1,3 +1,12 @@ +/** toc.css + * + * Styles for Table of Contents + * which also includes: + * - Tools (edit on github) + * + * See also: is-it-helpful.css + */ + .toc { font-size: 0.875rem; } @@ -7,23 +16,6 @@ line-height: 1; } -.sidebar-box { - position: fixed; /* for IE */ - width: inherit; /* for position: fixed */ - position: sticky; /* stylelint-disable-line declaration-block-no-duplicate-properties */ - top: var(--height-to-body); - max-height: var(--height-toc-sidebar); - overflow-y: auto; - -ms-overflow-style: none; - scrollbar-width: none; - padding-right: var(--base-space); - padding-left: var(--base-space); -} - -.sidebar-box::-webkit-scrollbar { - width: 0; -} - .toc.embedded .toc-menu { margin-top: 1rem; display: none; @@ -58,10 +50,6 @@ line-height: 1.2; } -/* .toc .toc-menu h3, -.toc .toc-menu ul { - margin-left: 0.75rem; -} */ .toc .toc-menu li { margin: 0; } @@ -129,3 +117,57 @@ .toc ul li[data-level="2"] a { padding-top: 2px; } + +/* Sidebar Box and Tools */ + +.sidebar-box { + position: fixed; /* for IE */ + width: inherit; /* for position: fixed */ + position: sticky; /* stylelint-disable-line declaration-block-no-duplicate-properties */ + top: var(--height-to-body); + max-height: var(--height-toc-sidebar); + overflow-y: auto; + -ms-overflow-style: none; + scrollbar-width: none; + padding-right: var(--base-space); + padding-left: var(--base-space); +} + +.sidebar-box::-webkit-scrollbar { + width: 0; +} + +/* Tools e.g. "Edit on Github" */ + +.sidebar-box .tools { + padding-top: 1.25rem; + display: inline-block; + width: 100%; +} + +.tools ul { + margin: 0; + padding: 0; + line-height: 1; +} + +.tools .edit { + line-height: 1; + display: inline-block; + width: 100%; + list-style: none; +} + +.tools .edit a { + display: inline-block; + white-space: nowrap; + overflow: hidden; + background: url(../img/edit.svg) no-repeat center left; + background-size: 15px; + vertical-align: top; + color: #999; + padding-left: 25px; + padding-top: 0; + padding-bottom: 0; + font-family: "Source Sans Pro", sans-serif; +} diff --git a/src/css/toolbar.css b/src/css/toolbar.css deleted file mode 100644 index 431ad54c..00000000 --- a/src/css/toolbar.css +++ /dev/null @@ -1,38 +0,0 @@ -/* .sidebar-box .tools { - margin-left: 0.75rem; -} */ -.tools ul { - margin: 0; - padding: 0; - line-height: 1; -} - -.tools .edit { - line-height: 1; - display: inline-block; - width: 100%; - list-style: none; -} - -.tools .edit a { - display: inline-block; - /* width: 100%; - height: 100%; - text-indent: 100%; */ - white-space: nowrap; - overflow: hidden; - background: url(../img/edit.svg) no-repeat center left; - background-size: 15px; - vertical-align: top; - color: #999; - padding-left: 25px; - padding-top: 0; - padding-bottom: 0; - font-family: "Source Sans Pro", sans-serif; -} - -.sidebar-box .tools { - padding-top: 1.25rem; - display: inline-block; - width: 100%; -} diff --git a/src/css/vars.css b/src/css/vars.css index f17022a6..2c853141 100644 --- a/src/css/vars.css +++ b/src/css/vars.css @@ -1,11 +1,13 @@ :root { /* NOTE tint colors are 15% transparent */ + /* primary */ --color-brand-primary: #262626; --color-brand-black: #000; --color-brand-red: #ea2328; --color-brand-red-tint: #fcdedf; --color-brand-white: #fff; + /* secondary */ --color-brand-secondary: #fff; --color-brand-blue: #4287d6; @@ -21,6 +23,7 @@ --color-brand-important: #b36cdb; --color-brand-warning: #ea2328; --color-brand-caution: #ff8f00; + /* tertiary */ --color-gray-rgb: 115, 118, 138; --color-brand-gray1: #292b36; @@ -32,7 +35,6 @@ --color-brand-gray7: #f9f9f9; --color-brand-gray8: #e5e5e5; --color-brand-gray9: #bfbfbf; - /* --color-brand-silver: #ccc; */ --color-brand-silver: #c1c1c1; --color-brand-blue-secondary: #0074e0; --color-brand-blue-secondary-light: #2689e5; @@ -53,7 +55,7 @@ --color-link-active: var(--color-brand-blue-secondary-light); --color-link-hover: var(--color-brand-blue-secondary-extra-light); - /* --color-border-table: #666; */ + /* other colors */ --color-border-table: #dadada; --color-shade: #f3f3f3; --color-navbar-bg: var(--color-brand-black); @@ -66,7 +68,11 @@ --hljs-attr: #407787; --hljs-string: #295d1e; --hljs-number: #0711ba; - /* --height-navbar: 4rem; */ + + /* Color brand tabsets */ + --color-active-tabset: #57a1ff; + + /* heights */ --height-spacer: 1.1rem; --height-navbar: 6rem; --height-version-control: 4.5rem; @@ -78,8 +84,10 @@ --height-nav: calc(var(--height-min-body) + var(--height-spacer) - var(--height-footer)); --height-nav-with-version: calc(100vh - var(--height-to-body) - var(--height-version-control)); --nav-menu-top-space: calc(var(--height-to-body) + var(--height-version-control)); - --h2-heading-top-space: calc(var(--height-to-body) + 0.5rem); - /* --width-main-gutter: 1.5rem; */ + --scroll-margin-top-space: calc(var(--height-to-body) + 0.5rem); + --scroll-margin-top-space-plus-banner: calc(var(--height-to-body) + 0.5rem + 5rem); + + /* widths */ --width-main-gutter: 2.5rem; --width-container: 90rem; --width-container-fluid: 100%; @@ -87,12 +95,14 @@ --width-nav: 20rem; --width-toc: 13rem; --width-page-area: calc(var(--width-container) + var(--width-nav) + var(--width-toc)); + /* Font weight */ --weight-light: 300; --weight-normal: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700; + /* Z-index */ --z-index-feedback: 8; --z-index-nav-toggle: 7; @@ -103,23 +113,19 @@ --z-index-footer: 2; --z-index-nav: 1; - /* Color brand tabsets */ - --color-active-tabset: #57a1ff; - /* New design font style */ - - --font-base: 1rem; /* ~16px */ - --font-medium: 1.25rem; /* ~20px */ - --font-small: 0.875rem; /* ~14px */ - --labels-font-size: 0.75rem; /* ~12px */ + --font-base: 1rem; /* ~16px */ + --font-medium: 1.25rem; /* ~20px */ + --font-small: 0.875rem; /* ~14px */ + --labels-font-size: 0.75rem; /* ~12px */ --labels-line-height: 1; /* Heading fonts */ - --heading-h1: 2.5rem; /* ~40px */ - --heading-h2: 2rem; /* ~32px */ - --heading-h3: 1.5rem; /* ~24px */ - --heading-h4: 1.25rem; /* ~20px */ - --heading-h5: var(--font-base); /* ~16px */ + --heading-h1: 2.5rem; /* ~40px */ + --heading-h2: 2rem; /* ~32px */ + --heading-h3: 1.5rem; /* ~24px */ + --heading-h4: 1.25rem; /* ~20px */ + --heading-h5: var(--font-base); /* ~16px */ /* line height */ --line-height-body: 160%; @@ -127,14 +133,14 @@ --line-height-base: 1.375rem; /* Spacing variables */ - --base-space: 1rem; /* ~ 16px */ - --base-small-space: 0.75rem; /* ~ 12px */ + --base-space: 1rem; /* ~ 16px */ + --base-small-space: 0.75rem; /* ~ 12px */ --base-extra-small-space: 0.5rem; /* ~ 8px */ - --base-medium-space: 1.5rem; /* ~ 24px */ - --base-large-space: 2rem; /* ~ 32px */ + --base-medium-space: 1.5rem; /* ~ 24px */ + --base-large-space: 2rem; /* ~ 32px */ --base-extra-large-space: 2.5rem; /* ~ 40px */ - --column-space: 2.5rem; /* ~ 40px */ - --admonition-icon-space: 1rem; /* ~ 16px */ + --column-space: 2.5rem; /* ~ 40px */ + --admonition-icon-space: 1rem; /* ~ 16px */ --admonition-content-space: 1rem; /* ~ 16px */ /* Heading fonts for responsive */ diff --git a/src/css/vendor/docsearch.css b/src/css/vendor/docsearch.css index eef78419..a7f2a522 100644 --- a/src/css/vendor/docsearch.css +++ b/src/css/vendor/docsearch.css @@ -19,9 +19,6 @@ display: grid !important; grid-template-columns: 5fr 2fr; grid-auto-rows: 1fr auto; - /* - max-height: calc(var(--viewport-height) - var(--navbar-height) - 4rem); - */ max-height: calc(100vh - var(--height-navbar) + 1.5rem); max-width: none; min-width: auto; @@ -217,16 +214,7 @@ @media screen and (min-width: 1024px) { .algolia-autocomplete .ds-dropdown-menu.ds-with-1 { width: 40rem; - /* - width: 34rem; - */ } - - /* - .algolia-autocomplete .ds-dropdown-menu { - max-height: calc(var(--viewport-height) - var(--navbar-height)); - } - */ } @supports (scrollbar-width: thin) { diff --git a/src/js/08-contributor-bot.js b/src/js/08-contributor-bot.js deleted file mode 100644 index 9304e27a..00000000 --- a/src/js/08-contributor-bot.js +++ /dev/null @@ -1,87 +0,0 @@ -;(function () { - 'use strict' - var showData = false - var contributors - if (document.getElementById('contributorList')) { - var contributorList = document.getElementById('contributorList') - var commitdateTag = document.getElementById('commitdate') - var otherContributor = document.getElementById('otherContributor') - var contributorListBox = document.querySelector('.contributor-list-box') - var apiURL = 'https://api.github.com' - var githubRepo = '/couchbase/docs-ui' - // var url = 'https://api.github.com/repos/couchbase/docs-ui/stats/contributors' - // var contributorEveryDayURL = 'repos/couchbase/docs-ui/stats/contributors' - // Call the fetch function passing the url of the API as a parameter - // eslint-disable-next-line no-undef - fetch(apiURL + '/repos' + githubRepo + '/stats/contributors') - .then(function (resp) { - var data = resp.json() - return data - }) - .then(function (data) { - showData = true - contributors = data - var otherContributorData = contributors.length - 5 - var maxCommitLength = contributors.length - 1 - var maxCommitAuthor = contributors[maxCommitLength] - // get last commit date - var totalWeek = maxCommitAuthor.weeks - var totaltWeekLength = totalWeek.length - 1 // array - var lastCommitWeek = totalWeek[totaltWeekLength] - var lastCommitTimeStamp = lastCommitWeek.w // object - var lastCommitDate = new Date(lastCommitTimeStamp * 1000) // convert timestamp to date - var getDate = lastCommitDate.getDate() - var getYear = lastCommitDate.getFullYear() - // eslint-disable-next-line no-array-constructor - var month = new Array() - month[0] = 'January' - month[1] = 'February' - month[2] = 'March' - month[3] = 'April' - month[4] = 'May' - month[5] = 'June' - month[6] = 'July' - month[7] = 'August' - month[8] = 'September' - month[9] = 'October' - month[10] = 'November' - month[11] = 'December' - var getMonth = month[lastCommitDate.getMonth()] - var latestCommitDate = getMonth + ' ' + getDate + ', ' + getYear - commitdateTag.append(latestCommitDate) - otherContributor.append(otherContributorData) - - // show html data - if (showData) { - contributorListBox.classList.add('show') - } - // map function - - contributors - .slice(0) - .reverse() - .map(function (contributor, index, arrayobj) { - //show only top 5 contributor - if (index <= 4) { - var contributorAvtar = contributor.author.avatar_url - // var contributorTotalCommit = contributor.total - var authorURL = contributor.author.html_url - // append child in ul - var li = document.createElement('li') - var anchor = document.createElement('a') - var image = document.createElement('img') - image.setAttribute('src', contributorAvtar) - image.setAttribute('alt', '') - anchor.setAttribute('href', authorURL) - anchor.setAttribute('target', '_blank') - li.appendChild(anchor) - anchor.appendChild(image) - contributorList.appendChild(li) - } - }) - }) - .catch(function (err) { - console.log(err, 13) - }) - } -})() diff --git a/src/partials/article.hbs b/src/partials/article.hbs index 93616b4a..6cba7b6e 100644 --- a/src/partials/article.hbs +++ b/src/partials/article.hbs @@ -5,7 +5,6 @@ {{> labels}}
{{/if}} -{{> contributor-bot}} {{{page.contents}}} {{> pagination}}
diff --git a/src/partials/contributor-bot.hbs b/src/partials/contributor-bot.hbs deleted file mode 100644 index 77aae769..00000000 --- a/src/partials/contributor-bot.hbs +++ /dev/null @@ -1,5 +0,0 @@ -
- - - + -
\ No newline at end of file diff --git a/src/partials/main.hbs b/src/partials/main.hbs index e0a3e041..ebb5d077 100644 --- a/src/partials/main.hbs +++ b/src/partials/main.hbs @@ -1,4 +1,7 @@ -
+
+ {{#unless (or (ne page.attributes.hide-view-latest undefined) (eq page.componentVersion page.component.latest))}} {{#with page.latest}} {{#if ./missing}}