Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2018-12-21 23:56:47 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-12-21 23:56:47 +0300
commit2cb9125dd7624176d034932b5f3b585fb9b325e6 (patch)
tree75be6bad23aa7217626765fe0df7f8d955d888bb
parent6c5e1087165c931d3da0537c4c7411537092fd22 (diff)
parentcc8d66a146ba020e5268d77d38f8bdc809cfb884 (diff)
Merge branch 'master' into 11.5
-rw-r--r--.gitignore1
-rw-r--r--.gitlab-ci.yml35
-rw-r--r--.gitlab/route-map.yml52
-rw-r--r--.ruby-version2
-rw-r--r--Dockerfile.master2
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock7
-rw-r--r--README.md24
-rw-r--r--Rules5
-rw-r--r--content/404.html2
-rw-r--r--content/_data/global-nav.yaml205
-rw-r--r--content/_data/versions.yaml3
-rw-r--r--content/assets/javascripts/404.js4
-rw-r--r--content/assets/javascripts/badges.js4
-rw-r--r--content/assets/javascripts/classlist-polyfill.js4
-rw-r--r--content/assets/javascripts/clipboardjs.js4
-rw-r--r--content/assets/javascripts/docs.js116
-rw-r--r--content/assets/javascripts/instantsearch.js4
-rw-r--r--content/assets/javascripts/table-display-block.js4
-rw-r--r--content/assets/stylesheets/_variables.scss152
-rw-r--r--content/assets/stylesheets/comments.scss19
-rw-r--r--content/assets/stylesheets/stylesheet.scss154
-rw-r--r--content/assets/stylesheets/toc.scss101
-rw-r--r--dockerfiles/Dockerfile.archives1
-rw-r--r--dockerfiles/Dockerfile.gitlab-docs-lint20
-rw-r--r--dockerfiles/README.md2
-rw-r--r--layouts/404.html4
-rw-r--r--layouts/archives.html4
-rw-r--r--layouts/default.html21
-rw-r--r--layouts/global_nav.html79
-rw-r--r--layouts/head.html12
-rw-r--r--layouts/instantsearch.html4
-rw-r--r--nanoc.yaml14
33 files changed, 914 insertions, 154 deletions
diff --git a/.gitignore b/.gitignore
index 40d72787..9158839d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ content/runner
content/debug
content/doc
content/docs
+content/charts
# Temporary file directory
tmp/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 18fc7d4b..71983295 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -91,13 +91,12 @@ compile_dev:
###############################################
#
-# Check for 404s in internal links
+# Check for broken internal links
#
-internal_links:
+test_internal_links:
stage: test
script:
- bundle exec nanoc check internal_links
- allow_failure: true
cache:
key: "test-$CI_COMMIT_REF_NAME"
paths:
@@ -106,6 +105,20 @@ internal_links:
<<: *retry
#
+# Check for broken external links
+#
+test_external_links:
+ stage: test
+ script:
+ - bundle exec nanoc check external_links
+ allow_failure: true
+ cache:
+ key: "test-$CI_COMMIT_REF_NAME"
+ paths:
+ - vendor/ruby
+ <<: *except_pipelines
+
+#
# SCSS linting
#
scss_lint:
@@ -272,6 +285,22 @@ pages:
<<: *retry
#
+# GitLab docs lint image containing all test tools
+#
+#image:docs-lint:
+# <<: *docker_prepare
+# stage: pre-deploy
+# variables:
+# IMAGE_NAME: $CI_REGISTRY_IMAGE:lint
+# DOCKERFILE: dockerfiles/Dockerfile.gitlab-docs-lint
+# script:
+# - docker build -t $IMAGE_NAME -f $DOCKERFILE .
+# - docker push $IMAGE_NAME
+# only:
+# - schedules
+# - master
+
+#
# Helper Docker image containing all build dependencies
# It must be rebuilt every time Gemfile.lock changes
#
diff --git a/.gitlab/route-map.yml b/.gitlab/route-map.yml
new file mode 100644
index 00000000..595fb6d9
--- /dev/null
+++ b/.gitlab/route-map.yml
@@ -0,0 +1,52 @@
+########################################
+## ##
+## Files under content/ and layouts/ ##
+## ##
+########################################
+
+## Versions pointing to archives/
+- source: '/(content\/_data\/versions.yaml|layouts\/archives.html)/'
+ public: 'archives/'
+
+## Everything under content/*/index.md
+- source: '/content/(.+)\/index.md/'
+ public: '\1'
+
+## Home page
+- source: '/(content\/index.erb|layouts\/home.html)'
+ public: 'index.html'
+
+## 404
+- source: '/(content|layouts)\/404.html'
+ public: '404.html'
+
+##########################
+## ##
+## Files under content/ ##
+## ##
+##########################
+
+## Everything ending in erb hosted under content/
+- source: '/content\/(.+).erb/'
+ public: '\1'
+
+## HTML files
+- source: '/content\/(.+?\/html)/'
+ public: '\1'
+
+## Other files
+- source: '/content\/(.*)/'
+ public: '\1'
+
+##########################
+## ##
+## Files under layouts/ ##
+## ##
+##########################
+
+## Search
+- source: '/layouts\/instantsearch*/'
+ public: 'search/'
+
+- source: 'layouts/landing-header.html'
+ public: 'index.html'
diff --git a/.ruby-version b/.ruby-version
index 73462a5a..aedc15bb 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.5.1
+2.5.3
diff --git a/Dockerfile.master b/Dockerfile.master
index 3ffe7e1c..63cdfc4a 100644
--- a/Dockerfile.master
+++ b/Dockerfile.master
@@ -24,9 +24,9 @@ RUN rm -rf /usr/share/nginx/html/*
# Get all the archive static HTML and put it into place
# Copy the versions found in 'content/_data/versions.yaml' under online.
+COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.6 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.5 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.4 ${TARGET} ${TARGET}
-COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.3 ${TARGET} ${TARGET}
# Get the built docs output from the previous build stage
# This ordering means all previous layers can come from cache unless an archive
diff --git a/Gemfile b/Gemfile
index a3a9fbce..f1e2e8de 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,6 @@ gem 'nanoc', '~> 4.10'
gem 'adsf', '~> 1.4'
gem 'adsf-live', '~> 1.4'
gem 'sass', '~> 3.6'
-gem 'kramdown'
gem 'rouge', '~> 3.2'
gem 'rake', '~> 12.3'
@@ -12,7 +11,7 @@ group :nanoc do
gem 'guard-nanoc', '~> 2.1'
# custom kramdown dialect
- gem 'gitlab_kramdown', '~> 0.4'
+ gem 'gitlab_kramdown', '~> 0.4.2'
# nanoc checks
gem 'nokogiri', '~> 1.7.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 28914c54..944f8441 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -28,8 +28,8 @@ GEM
eventmachine (1.2.7)
ffi (1.9.25)
formatador (0.2.5)
- gitlab_kramdown (0.4.0)
- kramdown (~> 1.16)
+ gitlab_kramdown (0.4.2)
+ kramdown (~> 1.16.2)
rouge (~> 3.0)
guard (2.14.2)
formatador (>= 0.2.4)
@@ -111,10 +111,9 @@ DEPENDENCIES
adsf (~> 1.4)
adsf-live (~> 1.4)
builder (~> 3.2)
- gitlab_kramdown (~> 0.4)
+ gitlab_kramdown (~> 0.4.2)
guard-nanoc (~> 2.1)
highline (~> 2.0)
- kramdown
nanoc (~> 4.10)
nokogiri (~> 1.7.0)
rake (~> 12.3)
diff --git a/README.md b/README.md
index 176467ce..bbc3ddf8 100644
--- a/README.md
+++ b/README.md
@@ -318,6 +318,30 @@ We can then loop over the `versions` array with something like:
Note that the data file must have the `yaml` extension (not `yml`) and that
we reference the array with a symbol (`:versions`).
+## Bumping versions of CSS and Javascript
+
+Whenever the custom CSS and Javascript files under `content/assets/` change,
+make sure to bump their version in the frontmatter. This method guarantees that
+your changes will take effect by clearing the cache of previous files.
+
+Always use Nanoc's way of including those files, do not hardcode them in the
+layouts. For example use:
+
+```erb
+<script async type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
+
+<link rel="stylesheet" href="<%= @items['/assets/stylesheets/toc.*'].path %>">
+```
+
+The links pointing to the files should be similar to:
+
+```erb
+<%= @items['/path/to/assets/file.*'].path %>
+```
+
+Nanoc will then build and render those links correctly according with what's
+defined in [`Rules`](/Rules).
+
## Review Apps for documentation merge requests
If you are contributing to GitLab docs read how to [create a Review App with each
diff --git a/Rules b/Rules
index 55a330e7..c59e75ed 100644
--- a/Rules
+++ b/Rules
@@ -97,6 +97,11 @@ compile '/**/*.scss' do
write item.identifier.without_ext + '-v' + rep.item[:version].to_s + '.css'
end
+compile '/**/*.js' do
+ filter :erb
+ write item.identifier.without_ext + '-v' + rep.item[:version].to_s + '.js'
+end
+
compile '/index.*' do
filter :erb
layout '/home.*'
diff --git a/content/404.html b/content/404.html
index f7d1ae92..c77a8011 100644
--- a/content/404.html
+++ b/content/404.html
@@ -39,7 +39,7 @@ searchbar: false
<script type="text/javascript">
// Redirect to /archives on a non-existing versions
// Place here all offline versions as seen inside content/_data/versions.yaml
- if (/10.3|10.4|10.5|10.6|10.7|10.8|11.0|11.1|11.2/.test(window.location.href)) {
+ if (/10.3|10.4|10.5|10.6|10.7|10.8|11.0|11.1|11.2|11.3/.test(window.location.href)) {
window.location.replace("https://docs.gitlab.com/archives");
}
</script>
diff --git a/content/_data/global-nav.yaml b/content/_data/global-nav.yaml
new file mode 100644
index 00000000..940c5e0f
--- /dev/null
+++ b/content/_data/global-nav.yaml
@@ -0,0 +1,205 @@
+# use "ee_only: true" for categories and docs available only in EE
+# use "external_url: true" for external URLs in docs and categories
+# do not start the URL with "/"
+
+sections:
+ - section_title: GitLab
+ section_url: 'README.html'
+
+ - section_title: User
+ section_url: 'user/'
+ section_categories:
+ - category_title: Groups
+ category_url: 'user/group/'
+ docs:
+ - doc_title: Subgroups
+ doc_url: 'user/group/subgroups/'
+ - doc_title: "Epics"
+ doc_url: 'user/group/epics/'
+ ee_only: true
+ - doc_title: Roadmaps
+ doc_url: 'user/group/roadmap/'
+ ee_only: true
+
+ - category_title: Projects
+ category_url: 'user/project/'
+ docs:
+ - doc_title: Settings
+ doc_url: 'user/project/settings/'
+ - doc_title: Members
+ doc_url: 'user/project/members/'
+ - doc_title: Security Dashboard
+ doc_url: 'user/project/security_dashboard.html'
+ ee_only: true
+ - doc_title: Cycle Analytics
+ doc_url: 'user/project/cycle_analytics.html'
+ - doc_title: Wikis
+ doc_url: 'user/project/wiki/'
+ - doc_title: Snippets
+ doc_url: 'user/snippets.html'
+ - doc_title: Discussions
+ doc_url: 'user/discussions/'
+
+ - category_title: Repositories
+ category_url: 'user/project/repository/'
+ docs:
+ - doc_title: Branches
+ doc_url: 'user/project/repository/branches/'
+ - doc_title: Signed Commits
+ doc_url: 'user/project/repository/gpg_signed_commits/'
+ - doc_title: Web Editor
+ doc_url: 'user/project/repository/web_editor.html'
+ - doc_title: Web IDE
+ doc_url: 'user/project/web_ide/'
+ - doc_title: Locked files
+ doc_url: 'user/project/file_lock.html'
+ ee_only: true
+
+ - category_title: Issues
+ category_url: 'user/project/issues/'
+ docs:
+ - doc_title: Issue Boards
+ doc_url: 'user/project/issue_board.html'
+ - doc_title: Labels
+ doc_url: 'user/project/labels.html'
+ - doc_title: Milestones
+ doc_url: 'user/project/milestones/'
+ - doc_title: Service Desk
+ doc_url: 'user/project/service_desk.html'
+ ee_only: true
+
+ - category_title: Merge Requests
+ category_url: 'user/project/merge_requests/'
+
+ - category_title: "GitLab CI/CD"
+ category_url: 'ci/README.html'
+ docs:
+ - doc_title: Configuration
+ doc_url: 'ci/yaml/README.html'
+ - doc_title: Examples
+ doc_url: 'ci/examples/README.html'
+ - doc_title: Pipelines
+ doc_url: 'ci/pipelines.html'
+ - doc_title: Schedules
+ doc_url: 'user/project/pipelines/schedules.html'
+ - doc_title: Review Apps
+ doc_url: 'ci/review_apps/'
+ - doc_title: GitLab Pages
+ doc_url: 'user/project/pages/'
+ - doc_title: Auto DevOps
+ doc_url: 'topics/autodevops/'
+
+ - category_title: Operations
+ category_url: 'user/project/integrations/prometheus_library/'
+ docs:
+ - doc_title: Metrics
+ doc_url: 'user/project/integrations/prometheus_library/'
+ - doc_title: Tracing
+ doc_url: 'user/project/operations/tracing.html'
+ ee_only: true
+ - doc_title: Environments
+ doc_url: 'ci/environments.html'
+ - doc_title: Kubernetes
+ doc_url: 'user/project/clusters/'
+ - doc_title: Feature Flags
+ doc_url: 'user/project/operations/feature_flags.html'
+ ee_only: true
+
+ - category_title: Container Registry
+ category_url: 'user/project/container_registry.html'
+
+ - category_title: Account
+ category_url: 'user/profile/'
+ docs:
+ - doc_title: Permissions
+ doc_url: 'user/permissions.html'
+ - doc_title: Markdown
+ doc_url: 'user/markdown.html'
+
+ - category_title: General
+ category_url: 'topics/authentication/'
+ docs:
+ - doc_title: Authentication
+ doc_url: 'topics/authentication/'
+ - doc_title: SSH
+ doc_url: 'ssh/README.html'
+ - doc_title: API
+ doc_url: 'api/README.html'
+ - doc_title: Integrations
+ doc_url: 'integration/README.html'
+ - doc_title: Git
+ doc_url: 'topics/git/'
+
+ - section_title: Administrator
+ section_url: 'administration/'
+ section_categories:
+ - category_title: Install
+ category_url: 'install/README.html'
+
+ - category_title: Update
+ category_url: 'update/README.html'
+
+ - category_title: Configure
+ category_url: 'user/admin_area/settings/'
+ docs:
+ - doc_title: Appearance
+ doc_url: 'customization/branded_login_page.html'
+ - doc_title: "CI/CD"
+ doc_url: 'user/admin_area/settings/continuous_integration.html'
+ - doc_title: Email
+ doc_url: 'user/admin_area/settings/email.html'
+ - doc_title: Gitaly
+ doc_url: 'administration/gitaly/'
+ - doc_title: GitLab Pages
+ doc_url: 'administration/pages/'
+ - doc_title: Health Check
+ doc_url: 'user/admin_area/monitoring/health_check.html'
+ - doc_title: Labels
+ doc_url: 'user/admin_area/labels.html'
+ - doc_title: Log system
+ doc_url: 'administration/logs.html'
+ - doc_title: OAuth applications
+ doc_url: 'administration/auth/README.html'
+ - doc_title: PlantUML Integration
+ doc_url: 'administration/integration/plantuml.html'
+ - doc_title: Repository checks
+ doc_url: 'administration/repository_checks.html'
+ - doc_title: Repository path
+ doc_url: 'administration/repository_storage_paths.html'
+ - doc_title: Repository size
+ doc_url: 'user/admin_area/settings/account_and_limit_settings.html'
+ ee_only: true
+ - doc_title: Runner
+ doc_url: 'ci/runners/README.html'
+ - doc_title: Service templates
+ doc_url: 'user/project/integrations/services_templates.html'
+ - doc_title: System Hooks
+ doc_url: 'system_hooks/system_hooks.html'
+
+ - category_title: Metrics
+ category_url: 'administration/monitoring/'
+ docs:
+ - doc_title: Influx
+ doc_url: 'administration/monitoring/performance/influxdb_configuration.html'
+ - doc_title: Prometheus
+ doc_url: 'administration/monitoring/prometheus/'
+ - doc_title: Performance bar
+ doc_url: 'administration/monitoring/performance/performance_bar.html'
+ - doc_title: Usage statistics
+ doc_url: 'user/admin_area/settings/usage_statistics.html'
+
+ - section_title: Contributor
+ section_url: 'development/README.html'
+ section_categories:
+ - category_title: Architecture
+ category_url: 'development/architecture.html#components'
+
+ - category_title: Documentation
+ category_url: 'development/documentation/'
+
+ - category_title: GitLab Design System
+ category_url: 'https://design.gitlab.com'
+ external_url: true
+
+ - category_title: Translate GitLab
+ category_url: 'development/i18n/'
diff --git a/content/_data/versions.yaml b/content/_data/versions.yaml
index 1dc5bd35..9badff30 100644
--- a/content/_data/versions.yaml
+++ b/content/_data/versions.yaml
@@ -1,11 +1,12 @@
# The first online version should always point to the
# current stable version.
online:
+ - "11.6"
- "11.5"
- "11.4"
- - "11.3"
offline:
+ - "11.3"
- "11.2"
- "11.1"
- "11.0"
diff --git a/content/assets/javascripts/404.js b/content/assets/javascripts/404.js
index 756d466d..8730f3ae 100644
--- a/content/assets/javascripts/404.js
+++ b/content/assets/javascripts/404.js
@@ -1,3 +1,7 @@
+---
+version: 1
+---
+
document.addEventListener('DOMContentLoaded', function() {
var el = document.getElementById('search-input');
var path = window.location.pathname
diff --git a/content/assets/javascripts/badges.js b/content/assets/javascripts/badges.js
index 26d63a66..f9bf8bdd 100644
--- a/content/assets/javascripts/badges.js
+++ b/content/assets/javascripts/badges.js
@@ -1,3 +1,7 @@
+---
+version: 1
+---
+
(function() {
var BADGES_TITLES = {
core: 'Available in GitLab Core, GitLab.com Free, and higher tiers',
diff --git a/content/assets/javascripts/classlist-polyfill.js b/content/assets/javascripts/classlist-polyfill.js
index 09b2e8b0..b56a0b6c 100644
--- a/content/assets/javascripts/classlist-polyfill.js
+++ b/content/assets/javascripts/classlist-polyfill.js
@@ -1,3 +1,7 @@
+---
+version: 1
+---
+
/*
* classList.js: Cross-browser full element.classList implementation.
* 1.1.20170427
diff --git a/content/assets/javascripts/clipboardjs.js b/content/assets/javascripts/clipboardjs.js
index 6c5214d5..e0cb252c 100644
--- a/content/assets/javascripts/clipboardjs.js
+++ b/content/assets/javascripts/clipboardjs.js
@@ -1,3 +1,7 @@
+---
+version: 1
+---
+
// add a copy button to every code // working
$('pre').append($('<button class="clip-btn" title="Click to copy" data-selector="true"><i class="fa fa-clipboard" aria-hidden="true"></i></button>'));
diff --git a/content/assets/javascripts/docs.js b/content/assets/javascripts/docs.js
index 2e06328f..c5e5b969 100644
--- a/content/assets/javascripts/docs.js
+++ b/content/assets/javascripts/docs.js
@@ -1,37 +1,40 @@
+---
+version: 1
+---
+
var NAV_INLINE_BREAKPOINT = 1100;
var landingHeaderBar = document.getElementById('landing-header-bar');
var headerLinks = document.getElementsByClassName('header-link');
if (landingHeaderBar) {
- window.addEventListener('scroll', function () {
+ window.addEventListener('scroll', function() {
if (window.scrollY >= 100) {
landingHeaderBar.classList.add('scrolling-header');
for (var i = 0; i < headerLinks.length; i++) {
- headerLinks[i].classList.add('scrolling-header-links')
+ headerLinks[i].classList.add('scrolling-header-links');
}
- }
- else {
+ } else {
landingHeaderBar.classList.remove('scrolling-header');
for (var i = 0; i < headerLinks.length; i++) {
- headerLinks[i].classList.remove('scrolling-header-links')
+ headerLinks[i].classList.remove('scrolling-header-links');
}
}
});
}
-var navtoggle = document.getElementById("docs-nav-toggle");
+var navtoggle = document.getElementById('docs-nav-toggle');
if (navtoggle) {
- navtoggle.addEventListener("click", toggleNavigation);
+ navtoggle.addEventListener('click', toggleNavigation);
}
function toggleNavigation() {
nav = document.getElementsByClassName('header')[0];
- nav.classList.toggle("active");
+ nav.classList.toggle('active');
}
// move document nav to sidebar
-(function () {
+(function() {
var timeofday = document.getElementById('timeofday');
var tocList = document.querySelector('.js-article-content > ul#markdown-toc');
var main = document.querySelector('.js-main-wrapper');
@@ -43,32 +46,31 @@ function toggleNavigation() {
var hour = date.getHours();
if (hour < 11) {
- timeofday.innerHTML = "morning"
+ timeofday.innerHTML = 'morning';
}
if (hour >= 11 && hour < 16) {
- timeofday.innerHTML = "afternoon"
+ timeofday.innerHTML = 'afternoon';
}
if (hour >= 16) {
- timeofday.innerHTML = "evening"
+ timeofday.innerHTML = 'evening';
}
}
// if the document has a top level nav
if (tocList) {
-
// append to the sidebar
var sidebar = document.getElementById('doc-nav');
if (sidebar) {
// if there are items
- if (tocList.children.length > 1) {
+ if (tocList.children.length >= 1) {
var menu = tocList;
// grab the h1's li anchor text
var title = document.createElement('h4');
- title.innerHTML = "On this page:";
+ title.innerHTML = 'On this page:';
// add the text as a title
menu.insertBefore(title, menu.children[0]);
@@ -79,36 +81,80 @@ function toggleNavigation() {
var sidebarContentHeight = 0;
// remove whitespace between elements to prevent list spacing issues
- sidebarContent.innerHTML = sidebarContent.innerHTML.replace(new RegExp( "\>[\s\r\n]+\<" , "g" ) , "><");
+ sidebarContent.innerHTML = sidebarContent.innerHTML.replace(
+ new RegExp('>[s\r\n]+<', 'g'),
+ '><'
+ );
// When we scroll down to the bottom, we don't want the footer covering
// the TOC list (sticky behavior)
- document.addEventListener('scroll', function () {
- // Wait a cycle for the dimensions to kick in
- if (!sidebarContentHeight) {
- sidebarContentHeight = sidebarContent.getBoundingClientRect().height + 55;
- }
-
- var isTouchingBottom = false;
- if (window.innerWidth >= NAV_INLINE_BREAKPOINT) {
- isTouchingBottom = window.scrollY + sidebarContentHeight >= main.offsetHeight;
- }
-
- if (isTouchingBottom) {
- sidebarContent.style.top = (main.offsetHeight - (window.scrollY + sidebarContentHeight)) + 'px';
- } else {
- sidebarContent.style.top = '';
- }
- }, {passive: true});
+ document.addEventListener(
+ 'scroll',
+ function() {
+ // Wait a cycle for the dimensions to kick in
+ if (!sidebarContentHeight) {
+ sidebarContentHeight =
+ sidebarContent.getBoundingClientRect().height + 55;
+ }
+
+ var isTouchingBottom = false;
+ if (window.innerWidth >= NAV_INLINE_BREAKPOINT) {
+ isTouchingBottom =
+ window.scrollY + sidebarContentHeight >= main.offsetHeight;
+ }
+
+ if (isTouchingBottom) {
+ sidebarContent.style.top =
+ main.offsetHeight -
+ (window.scrollY + sidebarContentHeight) +
+ 'px';
+ } else {
+ sidebarContent.style.top = '';
+ }
+ },
+ { passive: true }
+ );
}
}
// main content has-toc
if (main && main.classList) {
main.classList.add('has-toc');
- }
- else {
+ } else {
main.className += ' has-toc';
}
}
+
+ document.addEventListener('DOMContentLoaded', function() {
+ var globalNav = document.getElementById('global-nav');
+ var media = window.matchMedia('(max-width: 1099px)');
+
+ window.addEventListener('scroll', function(e) {
+ var isTouchingBottom = false;
+
+ if (!media.matches) {
+ isTouchingBottom =
+ window.scrollY + window.innerHeight >=
+ document.querySelector('.footer').offsetTop;
+ }
+
+ if (isTouchingBottom) {
+ globalNav.style.top =
+ main.offsetHeight -
+ (window.scrollY + globalNav.offsetHeight) +
+ 80 +
+ 'px';
+ } else {
+ globalNav.style.top = '';
+ }
+ });
+
+ if (media.matches) {
+ var el = document.getElementById('markdown-toc');
+ el.classList.add('collapse');
+ el.classList.add('out');
+ el.style.height = '34px';
+ el.previousElementSibling.classList.add('collapsed');
+ }
+ });
})();
diff --git a/content/assets/javascripts/instantsearch.js b/content/assets/javascripts/instantsearch.js
index 547fc72e..8e3c8578 100644
--- a/content/assets/javascripts/instantsearch.js
+++ b/content/assets/javascripts/instantsearch.js
@@ -1,3 +1,7 @@
+---
+version: 1
+---
+
const search = instantsearch({
appId: 'BH4D9OD16A',
apiKey: 'ce1690e1421303458a1fcbea0cc4a927',
diff --git a/content/assets/javascripts/table-display-block.js b/content/assets/javascripts/table-display-block.js
index 9a9c0ba1..450dab6f 100644
--- a/content/assets/javascripts/table-display-block.js
+++ b/content/assets/javascripts/table-display-block.js
@@ -1,2 +1,6 @@
+---
+version: 1
+---
+
var tableBlock = document.querySelector('table');
tableBlock.classList.add('display-block');
diff --git a/content/assets/stylesheets/_variables.scss b/content/assets/stylesheets/_variables.scss
index 357865a6..8e0fffaa 100644
--- a/content/assets/stylesheets/_variables.scss
+++ b/content/assets/stylesheets/_variables.scss
@@ -10,10 +10,108 @@ $mono-font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "
$sans-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
$body-font-size: 15px;
+// GitLab colors
+// Tanuki
+$color-tanuki-dark: rgb(226, 67, 41);
+$color-tanuki-medium: rgb(252, 109, 38);
+$color-tanuki-light: rgb(252, 163, 38);
+$color-btn-tanuki: rgba(252, 163, 38, .1);
+
+//// GitLab Design System's (GDS) colors ////
+// https://design.gitlab.com/#/foundations/colors
+
+// Neutral palette
+$gds-white: #fff;
+$gds-gray-50: #fafafa;
+$gds-gray-100: #f2f2f2;
+$gds-gray-200: #dfdfdf;
+$gds-gray-300: #ccc;
+$gds-gray-400: #bababa;
+$gds-gray-500: #a7a7a7;
+$gds-gray-600: #919191;
+$gds-gray-700: #707070;
+$gds-gray-800: #4f4f4f;
+$gds-gray-900: #2e2e2e;
+$gds-gray-950: #1f1f1f;
+$gds-black: #000;
+
+// Transparency
+$gds-t-gray-a2: rgba($gds-black, .02);
+$gds-t-gray-a4: rgba($gds-black, .04);
+$gds-t-gray-a6: rgba($gds-black, .06);
+$gds-t-gray-a8: rgba($gds-black, .08);
+
+// Blue palette
+$gds-blue-100: #e4f0fb;
+$gds-blue-200: #b8d6f4;
+$gds-blue-300: #73afea;
+$gds-blue-400: #418cd8;
+$gds-blue-500: #1f78d1;
+$gds-blue-600: #1b69b6;
+$gds-blue-700: #17599c;
+$gds-blue-800: #134a81;
+//// end of GitLab Design System's colors ////
+
+//// Colors conforming with GDS ////
+// Add here all the variables that already conform with GDS
+
+// Base colors
+$body-color: $gds-gray-950; //font color
+$body-background-color: rgba($gds-gray-50, .3); //body background
+$main-background-color: $gds-white; // content background
+
// Link colors
-$link-color: rgb(32, 137, 196);
-$link-color-hover: rgb(79, 172, 225);
-$link-code-color: rgb(55, 119, 176);
+$link-color: $gds-blue-600;
+$link-color-hover: $gds-blue-800;
+$link-code-color: $gds-blue-600;
+$link-color-bg-active: rgba($gds-gray-900, .06);
+$link-color-nav: $gds-gray-800;
+$link-color-nav-hover: $gds-gray-900;
+
+// Global nav
+$global-nav-link-level0: $link-color-nav;
+$global-nav-link-level1: $link-color-nav;
+$global-nav-link-level2: $gds-gray-700;
+$global-nav-link-shadow: $gds-gray-200;
+
+// Table of contents
+$toc-bg-color: $body-background-color;
+$toc-border: $gds-gray-600;
+$toc-link-color: $global-nav-link-level2;
+
+// Help and feedback section
+$feedback-bg: rgba($gds-gray-50, .4);
+$inactive-tabs: rgba($gds-gray-100, .6);
+$buttons-bg: $body-background-color;
+$tabs-border: $gds-gray-200;
+
+// Versions menu
+$versions-link-color: $global-nav-link-level1;
+$versions-link-color-hover: $link-color-nav-hover;
+$versions-link-color-bg-hover: rgba($gds-gray-200, .6);
+$versions-active-bg-color: $versions-link-color-bg-hover;
+
+/// Elements
+$blockquote-border-color: $gds-blue-200;
+$blockquote-background-color: rgba($gds-blue-100, .3);
+$h1-border-bottom: $gds-gray-700;
+$h-border-bottom: $gds-gray-300;
+$divider-color: $gds-gray-200;
+$border-color: $gds-gray-200;
+$border-color-light: $gds-gray-50;
+$table-border-color: $border-color;
+$thead-border-color: $gds-gray-200;
+$thead-background-color: $gds-gray-100;
+
+// Buttons
+$button-default-bg-hover: $gds-gray-100;
+//// end of colors conforming with GitLab Design System ////
+
+// Badges
+$badge-gitlab: $color-tanuki-medium;
+$badge-gitlab-com: $color-tanuki-light;
+$badge-gitlab-transparent: rgba(252, 109, 38, .1);
+$badge-gitlab-com-transparent: rgba(252, 163, 38, .1);
// Inline code colors
$code-color: rgb(95, 131, 65);
@@ -33,81 +131,35 @@ $subtopic-color: rgba(0, 0, 0, .6);
$subtopic-border-color: rgb(79, 172, 225);
// Other colors
-$toc-bg-color: rgba(244, 247, 248, .7);
-$toc-border: rgb(229, 229, 229);
-$border-color: #e5e5e5;
-$border-color-light: #f0f0f0;
-$table-border-color: $border-color;
-$thead-border-color: rgba(170, 170, 170, .5);
-$thead-background-color: rgba(96, 125, 139, .16);
$hr-border-color: $border-color;
-$blockquote-border-color: rgb(0, 188, 242);
-$blockquote-background-color: rgb(239, 246, 251);
$pre-background-color: rgba(238, 238, 238, .35);
-$body-color: rgba(0, 0, 0, .85);
-$body-background-color: rgb(249, 249, 249);
-$main-background-color: rgb(255, 255, 255);
$search-border: rgba(0, 0, 0, .25);
$search-border-dark: rgba(0, 0, 0, .50);
-$h-border-bottom: rgba(125, 134, 140, .2);
-$h1-border-bottom: $code-color;
$main-box-shadow: rgba(0, 0, 0, .1);
$secondary-box-shadow: rgba(0, 0, 0, .1);
$white: #fff;
$black: #333;
-// tanuki
-$color-tanuki-dark: rgb(226, 67, 41);
-$color-tanuki-medium: rgb(252, 109, 38);
-$color-tanuki-light: rgb(252, 163, 38);
-$color-btn-tanuki: rgba(252, 163, 38, .1);
-
-// badges
-$badge-gitlab: $color-tanuki-medium;
-$badge-gitlab-com: $color-tanuki-light;
-$badge-gitlab-transparent: rgba(252, 109, 38, .1);
-$badge-gitlab-com-transparent: rgba(252, 163, 38, .1);
-
-//help and feedback section
-$feedback-bg: #f3f3f3;
-$inactive-tabs: #e8e8e8;
-$buttons-bg: #f9f9f9; //== body-bg
-
-// versions menu
-$versions-link-color: #707070;
-$versions-link-color-hover: #3a3a3a;
-$versions-active-bg-color: rgba(0, 0, 0, .04);
-
-// Footer variables
+// Colors
$color-white: #fff;
$color-white-alt: #d9ccff;
$color-transparent: rgba(0, 0, 0, 0);
-
$color-dark: #000;
-
$color-gray: #777;
$color-gray-medium: #ddd;
$color-gray-light: #aaa;
$color-gray-extra-light: #e7e7e7;
$color-light-gray: rgb(117, 117, 117);
-
$color-green: #18be97;
-
$color-red: #f00;
-
$color-primary: #548;
$color-primary-alt: #6b4fbb;
$color-secondary: #e14329;
$color-secondary-alt: #fba225;
$color-subfooter-bg: rgb(85, 68, 136);
-
$color-primary-medium: #503991;
-$divider-color: #d3d3d3;
-
-$border-color: #dfdfdf;
-
$header-text-light-color: #a69ebd;
$team-content-color: #999;
diff --git a/content/assets/stylesheets/comments.scss b/content/assets/stylesheets/comments.scss
index 39d8e4f7..e544f8cb 100644
--- a/content/assets/stylesheets/comments.scss
+++ b/content/assets/stylesheets/comments.scss
@@ -1,21 +1,23 @@
---
-version: 3
+version: 4
---
@import "variables";
.comments {
- margin-top: 15px;
- padding-top: 10px;
+ margin: 15px -10px 0;
+ padding: 10px 10px 0;
border-top-style: solid;
border-top-color: $border-color;
border-top-width: 3px;
+ border-bottom-style: solid;
+ border-bottom-color: $border-color;
+ border-bottom-width: 3px;
background-color: $feedback-bg;
@media all and (min-width: $mobile-width) {
margin-left: -40px;
margin-right: -40px;
- margin-bottom: -10px;
padding-left: 40px;
padding-right: 40px;
}
@@ -117,12 +119,19 @@ version: 3
}
}
+// Fixes padding in this row when the Disqus row isn't shown
+// scss-lint:disable IdSelector
+#doc-issue-row {
+ padding-bottom: 20px;
+}
+// scss-lint:enable IdSelector
+
// scss-lint:disable ImportantRule
.nav-tabs {
> li {
> a {
color: $body-color;
- border: solid 1px $border-color-light;
+ border: solid 1px $tabs-border;
background-color: $inactive-tabs;
&:hover {
diff --git a/content/assets/stylesheets/stylesheet.scss b/content/assets/stylesheets/stylesheet.scss
index 2f089d88..b60e3d41 100644
--- a/content/assets/stylesheets/stylesheet.scss
+++ b/content/assets/stylesheets/stylesheet.scss
@@ -1,5 +1,5 @@
---
-version: 54
+version: 57
---
@import "variables";
@@ -15,14 +15,16 @@ body {
line-height: 1.6;
font-family: $sans-font-family;
font-size: $body-font-size;
+ color: $body-color;
}
a, a:visited {
text-decoration: none;
+ color: $link-color;
&:hover {
color: $link-color-hover;
- text-decoration: none;
+ text-decoration: underline;
}
}
@@ -276,29 +278,32 @@ li {
}
.main {
- margin: auto;
+ margin: auto 15%;
padding: 8px 40px;
padding-bottom: 0;
position: relative;
width: auto;
max-width: 900px;
- box-shadow: 0 3px 3px $main-box-shadow;
+ border-left: 1px solid $main-box-shadow;
+ border-right: 1px solid $main-box-shadow;
background: $main-background-color;
+ z-index: 1;
@media (max-width: $mobile-width) {
padding: 5px 10px;
}
+ @media(min-width:1601px) {
+ margin: auto 18%;
+ max-width: 64%;
+ }
+
&:not(.has-toc) {
> .doc-nav {
display: none;
}
}
- a {
- text-decoration: none;
- }
-
.edit-on {
text-align: center;
border-top: 1px solid $hr-border-color;
@@ -378,6 +383,132 @@ li {
}
}
+// Override Bootstraps default button (for GDS colors)
+.btn-default:hover {
+ background-color: $button-default-bg-hover;
+}
+
+//global nav
+.global-nav {
+ height: 100%;
+ width: 15%;
+ position: fixed;
+ z-index: 1;
+ top: 0;
+ left: 0;
+ overflow: scroll;
+ margin-top: 56px;
+ padding-top: 15px;
+ padding-bottom: 5%;
+ padding-left: 3px;
+
+ a {
+ display: block;
+ text-decoration: none;
+
+ &.active {
+ background-color: $link-color-bg-active;
+ font-weight: 600;
+ border-left: 3px solid;
+ color: $link-color-nav;
+
+ &:hover {
+ color: $link-color-nav;
+ }
+ }
+ }
+
+ @media(max-width:1099px) {
+ display: none;
+ }
+
+ @media(min-width:1601px) {
+ width: 18%;
+ }
+}
+
+.global-nav-block {
+ font-weight: 600;
+ padding-left: 10px;
+}
+
+// scss-lint:disable QualifyingElement
+a.global-nav-link, .nav-link {
+ padding-top: 1px;
+ padding-bottom: 1px;
+ text-decoration: none;
+
+ &:hover {
+ background-color: $link-color-bg-active;
+ color: $link-color-nav-hover;
+ box-shadow: 1px 1px 2px $global-nav-link-shadow;
+ }
+}
+// scss-lint:enable QualifyingElement
+
+.global-nav-block-top {
+ font-weight: 600;
+ margin-bottom: 3px;
+ margin-top: 3px;
+
+ a {
+ text-decoration: none;
+ text-shadow: 3px 3px 5px $link-color-bg-active;
+ }
+}
+
+// use these classes to add color and padding-left to the nav links
+.level-0 {
+ padding-left: 10px;
+ color: $global-nav-link-level0;
+
+ &.active {
+ padding-left: 7px; //10 - 3px of border
+ }
+
+ &:visited {
+ color: $global-nav-link-level0;
+ }
+}
+
+.level-1 {
+ padding-left: 20px;
+ color: $global-nav-link-level1;
+
+ &.active {
+ padding-left: 17px; //20 - 3px of border
+ }
+
+ &:visited {
+ color: $global-nav-link-level1;
+ }
+}
+
+.level-2 {
+ padding-left: 36px;
+ color: $global-nav-link-level2;
+ font-size: 14px;
+
+ &.active {
+ padding-left: 33px; //36 - 3px of border
+ }
+
+ &:visited {
+ color: $global-nav-link-level2;
+ }
+}
+
+.global-nav-badges {
+ color: $global-nav-link-level2;
+ opacity: .4;
+ transition: opacity .3s;
+
+ &:hover {
+ opacity: 1;
+ }
+}
+//end of global-nav
+
.last-updated {
color: $color-light-gray;
font-size: 13px;
@@ -551,16 +682,14 @@ li {
&:hover {
color: $versions-link-color-hover;
+ background-color: $versions-link-color-bg-hover;
}
}
&.active a {
background-color: $versions-active-bg-color;
font-weight: 600;
-
- &:hover {
- color: $versions-link-color-hover;
- }
+ color: $link-color-nav;
}
&.divider {
@@ -640,6 +769,7 @@ li {
position: absolute;
top: 15px;
right: 15px;
+ color: $link-color-nav;
}
}
diff --git a/content/assets/stylesheets/toc.scss b/content/assets/stylesheets/toc.scss
index 7b72a36a..09342e16 100644
--- a/content/assets/stylesheets/toc.scss
+++ b/content/assets/stylesheets/toc.scss
@@ -1,5 +1,5 @@
---
-version: 4
+version: 6
---
@import "variables";
@@ -12,12 +12,12 @@ version: 4
.doc-nav {
h4 {
padding-bottom: 5px;
+ font-size: 16px;
}
> ul {
position: relative;
- background: $body-background-color;
- padding: 20px;
+ padding: 16px 8px;
margin-top: 60px;
li {
@@ -30,15 +30,72 @@ version: 4
> a {
font-size: 14px;
+ color: $toc-link-color;
+
+ &:hover {
+ color: $link-color-nav-hover;
+ text-decoration: underline;
+ }
}
}
}
}
+.markdown-toc {
+ padding-left: 16px;
+}
+
// not wide enough to show quick nav and toc
@media(max-width:1099px) {
- .doc-nav > ul {
- margin: 0;
+ .doc-nav {
+ position: relative;
+ min-height: 34px;
+
+ // ToC toggle button
+ .toc-collapse {
+ font-size: 13px;
+ display: block;
+ padding: 5px 5px 5px 0;
+ position: absolute;
+ z-index: 1;
+ right: 0;
+ color: $link-color-nav;
+
+ &:hover {
+ color: $link-color-nav-hover;
+ }
+
+ &::before {
+ font-family: FontAwesome;
+ content: "\f147";
+ padding-right: 5px;
+ }
+
+ &::after {
+ content: "";
+ font-style: italic;
+ }
+
+ &.collapsed {
+ left: 0;
+ right: 0;
+ text-align: right;
+ background-color: $body-background-color;
+
+ &::before {
+ content: "\f196";
+ }
+
+ &::after {
+ content: "On this page";
+ }
+ }
+ }
+ // ToC toggle button
+
+ > ul {
+ margin: 0;
+ }
}
.main.class {
@@ -58,16 +115,24 @@ version: 4
}
.main.class {
- padding-top: 50px;
+ padding-top: 55px;
}
.doc-nav {
position: fixed;
top: 0;
- right: 0;
+ right: 8px;
padding-top: 55px;
- overflow-y: scroll;
- height: 100vh;
+ overflow: scroll;
+ height: 100%;
+
+ &.toc-no-breadcrumbs {
+ padding-top: 6px;
+ }
+
+ .toc-collapse {
+ display: none; // ToC toggle button => don't display on big screens
+ }
}
.doc-nav ul ul {
@@ -76,13 +141,13 @@ version: 4
}
@media(min-width:1100px) and (max-width:1600px) {
- $doc-nav-desired-width: 30vw;
+ $doc-nav-desired-width: 20vw;
// Get around the scroll bar
- $doc-nav-width: calc(#{$doc-nav-desired-width} - 20px);
+ $doc-nav-width: $doc-nav-desired-width;
.main.class.has-toc {
- width: 70vw;
- max-width: 70vw;
+ width: 64vw;
+ max-width: 64vw;
float: left;
}
@@ -93,14 +158,14 @@ version: 4
// wide enough to show quick nav and toc
@media(min-width:1601px) {
- $doc-nav-desired-width: 25vw;
+ $doc-nav-desired-width: 0;
// Get around the scroll bar
- $doc-nav-width: calc(#{$doc-nav-desired-width} - 20px);
+ $doc-nav-width: 21%;
.main.class.has-toc {
- width: 50vw;
- max-width: 50vw;
- margin-left: $doc-nav-desired-width;
+ width: 60vw;
+ max-width: 60vw;
+ margin: auto 18%;
}
.doc-nav {
diff --git a/dockerfiles/Dockerfile.archives b/dockerfiles/Dockerfile.archives
index f9002c4b..0b861dd7 100644
--- a/dockerfiles/Dockerfile.archives
+++ b/dockerfiles/Dockerfile.archives
@@ -7,6 +7,7 @@ ENV TARGET=/usr/share/nginx/html
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
# Get all the archive static HTML and put it into place
+COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.6 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.5 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.4 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:11.3 ${TARGET} ${TARGET}
diff --git a/dockerfiles/Dockerfile.gitlab-docs-lint b/dockerfiles/Dockerfile.gitlab-docs-lint
new file mode 100644
index 00000000..a73e2dd0
--- /dev/null
+++ b/dockerfiles/Dockerfile.gitlab-docs-lint
@@ -0,0 +1,20 @@
+FROM ruby:2.5.3-alpine3.8
+MAINTAINER GitLab Documentation Team
+
+WORKDIR /tmp
+
+RUN apk update && apk upgrade && apk add --no-cache \
+ build-base \
+ bash \
+ grep \
+ yarn
+
+RUN yarn global add markdownlint-cli && yarn cache clean
+
+RUN wget https://gitlab.com/gitlab-com/gitlab-docs/-/archive/$CI_COMMIT_REF_NAME/gitlab-docs-$CI_COMMIT_REF_NAME.tar.bz2 \
+ && tar xvjf gitlab-docs-$CI_COMMIT_REF_NAME.tar.bz2 \
+ && mv gitlab-docs-$CI_COMMIT_REF_NAME gitlab-docs \
+ && rm gitlab-docs-$CI_COMMIT_REF_NAME.tar.bz2
+
+RUN cd gitlab-docs \
+ && bundle install --jobs 4
diff --git a/dockerfiles/README.md b/dockerfiles/README.md
index 4b84aa27..c9fff2b1 100644
--- a/dockerfiles/README.md
+++ b/dockerfiles/README.md
@@ -108,7 +108,7 @@ the versions to reflect the new changes:
Create a merge request with the changes and check if the links in the `/archives`
page work as expected. If not, the `latest` image is possibly not yet updated.
-### 4. Add the new offline version in the redirect loop
+### 4. Add the new offline version in the 404 page redirect script
Since we're deprecating the oldest version each month, we need to redirect
those URLs in order not to create [404 entries](https://gitlab.com/gitlab-com/gitlab-docs/issues/221).
diff --git a/layouts/404.html b/layouts/404.html
index 5ff4829b..2fa5034c 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -14,7 +14,7 @@
<%= render '/footer.*' %>
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script type="application/javascript" src="/assets/javascripts/badges.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
<!-- Algolia docsearch https://community.algolia.com/docsearch/ -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script type="text/javascript">
@@ -34,7 +34,7 @@
}
});
</script>
- <script type="application/javascript" src="/assets/javascripts/404.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/404.*'].path %>"></script>
<%= render '/analytics.*' %>
<%= render '/https_redirect.*' %>
</body>
diff --git a/layouts/archives.html b/layouts/archives.html
index 260dcb13..af7468ef 100644
--- a/layouts/archives.html
+++ b/layouts/archives.html
@@ -29,8 +29,8 @@
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
- <script type="application/javascript" src="/assets/javascripts/clipboardjs.js"></script>
- <script type="application/javascript" src="/assets/javascripts/badges.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/clipboardjs.*'].path %>"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
<%= render '/footer.*' %>
<%= render '/docsearch.*' %>
<%= render '/analytics.*' %>
diff --git a/layouts/default.html b/layouts/default.html
index af48c0d7..3b1119f8 100644
--- a/layouts/default.html
+++ b/layouts/default.html
@@ -8,6 +8,11 @@
<%= render '/gtm.*' %>
<%= render '/header.*' %>
<div class="wrapper">
+ <aside id="global-nav" class="global-nav">
+ <% if ENV['CI_PROJECT_NAME'] == 'gitlab-docs' or ENV['CI_PROJECT_NAME'].nil? %>
+ <%= render '/global_nav.*' %>
+ <% end %>
+ </aside>
<div class="main class js-main-wrapper">
<% if @config[:breadcrumbs] %>
<% ancestor_array = ancestor_path_array(@item) unless ancestor_path_array(@item).empty? %>
@@ -18,10 +23,15 @@
<% end %>
<li class="breadcrumb"><%= @item.key?(:title) ? "#{@item[:title]}" : "Current page" %></li>
</ul>
+ <div id="doc-nav" class="doc-nav">
+ <a class="toc-collapse" data-toggle="collapse" href="#markdown-toc" aria-expanded="true" aria-controls="markdown-toc"></a>
+ </div>
+ <% else %>
+ <div id="doc-nav" class="doc-nav toc-no-breadcrumbs">
+ <a class="toc-collapse" role="button" data-toggle="collapse" href="#markdown-toc" aria-expanded="true" aria-controls="markdown-toc"></a>
+ </div>
<% end %>
<% end %>
- <div id="doc-nav" class="doc-nav">
- </div>
<% if @item[:title] %>
<h1 class="article-title" itemprop="name">
<%= @item[:title] %><%= @item[:title_badge] %>
@@ -57,8 +67,8 @@
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
- <script type="application/javascript" src="/assets/javascripts/clipboardjs.js"></script>
- <script type="application/javascript" src="/assets/javascripts/badges.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/clipboardjs.*'].path %>"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
<%= render '/docsearch.*' %>
<%= render '/https_redirect.*' %>
<% if ENV['NANOC_ENV'] == 'production' %>
@@ -66,8 +76,9 @@
<%= render '/analytics.*' %>
<% end %>
<% if @item[:table_display_block] %>
- <script type="application/javascript" src="/assets/javascripts/table-display-block.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/table-display-block.*'].path %>"></script>
<% end %>
<%= render '/footer.*' %>
+ <script src="<%= @items['/assets/javascripts/docs.*'].path %>"></script>
</body>
</html>
diff --git a/layouts/global_nav.html b/layouts/global_nav.html
new file mode 100644
index 00000000..7768cbce
--- /dev/null
+++ b/layouts/global_nav.html
@@ -0,0 +1,79 @@
+<% dir = @item.identifier.to_s[%r{(?<=/)[^/]+}] %>
+<nav class="global-nav-content">
+ <!-- nav sections -->
+ <% @items['/_data/global-nav.yaml'][:sections].each do |sec| %>
+ <div class="global-nav-section">
+ <span class="global-nav-block-top nav-link">
+ <% if dir != 'ce' %>
+ <a class="global-nav-link level-0 <% if @item.path == "/#{dir}/#{sec[:section_url]}" %>active<% end %>" href="/ee/<%= sec[:section_url] %>">
+ <%= sec[:section_title] %>
+ </a>
+ <% else %>
+ <a class="global-nav-link level-0 <% if @item.path == "/#{dir}/#{sec[:section_url]}" %>active<% end %>" href="/<%= dir %>/<%= sec[:section_url] %>">
+ <%= sec[:section_title] %>
+ </a>
+ <% end %><!-- end of if dir -->
+ </span>
+
+ <!-- nav categories -->
+ <% if sec[:section_categories] %>
+ <% sec[:section_categories].each do |cat| %>
+ <span class="global-nav-cat nav-link">
+ <% if cat[:external_url] %>
+ <a class="global-nav-link level-1" href="<%= cat[:category_url] %>" target="_blank">
+ <%= cat[:category_title] %>
+ </a>
+ <% else %>
+ <% if dir != 'ce' %>
+ <a class="global-nav-link level-1 <% if @item.path == "/#{dir}/#{cat[:category_url]}" %>active<% end %>" href="/ee/<%= cat[:category_url] %>">
+ <%= cat[:category_title] %>
+ </a>
+ <% else %>
+ <% if dir == 'ce' && cat[:ee_only] %>
+ <a class="global-nav-link level-1 <% if @item.path == "/#{dir}/#{cat[:category_url]}" %>active<% end %>" href="/ee/<%= cat[:category_url] %>">
+ <%= cat[:category_title] %>
+ <span class="badges-drop global-nav-badges" data-toggle="tooltip" data-placement="auto" title="Not available in GitLab free tiers"><i class="fa fa-info-circle" aria-hidden="true"></i></span>
+ </a>
+ <% else %>
+ <a class="global-nav-link level-1 <% if @item.path == "/#{dir}/#{cat[:category_url]}" %>active<% end %>" href="/<%= dir %>/<%= cat[:category_url] %>">
+ <%= cat[:category_title] %>
+ </a>
+ <% end %><!-- end of dir == 'ce' && cat[:ee_only] -->
+ <% end %><!-- end of if dir != 'ce' -->
+ <% end %><!-- end of if cat[:external_url] -->
+ </span>
+
+ <!-- nav docs -->
+ <% if cat[:docs] %>
+ <% cat[:docs].each do |doc| %>
+ <span class="nav-link">
+ <% if doc[:external_url] %>
+ <a class="global-nav-link level-2" href="<%= doc[:doc_url] %>" target="_blank">
+ <%= doc[:doc_title] %>
+ </a>
+ <% else%>
+ <% if dir != 'ce' %>
+ <a class="global-nav-link level-2 <% if @item.path == "/#{dir}/#{doc[:doc_url]}" %>active<% end %>" href="/ee/<%= doc[:doc_url] %>">
+ <%= doc[:doc_title] %>
+ </a>
+ <% else %>
+ <% if dir == 'ce' && doc[:ee_only] %>
+ <a class="global-nav-link level-2 <% if @item.path == "/#{dir}/#{doc[:doc_url]}" %>active<% end %>" href="/ee/<%= doc[:doc_url] %>">
+ <%= doc[:doc_title] %>
+ <span class="badges-drop global-nav-badges" data-toggle="tooltip" data-placement="auto" title="Not available in GitLab free tiers"><i class="fa fa-info-circle" aria-hidden="true"></i></span>
+ </a>
+ <% else %>
+ <a class="global-nav-link level-2 <% if @item.path == "/#{dir}/#{doc[:doc_url]}" %>active<% end %>" href="/<%= dir %>/<%= doc[:doc_url] %>">
+ <%= doc[:doc_title] %>
+ </a>
+ <% end %><!-- end of dir == 'ce' && cat[:ee_only] -->
+ <% end %><!-- end of if dir != 'ce' -->
+ <% end %><!-- end of if doc[:external_url] -->
+ </span>
+ <% end %><!-- end of cat[:docs] -->
+ <% end %><!-- end of if cat[:docs].nil? -->
+ <% end %><!-- end of sec[:section_categories] -->
+ <% end %><!-- end of if sec[:section_categories].nil? -->
+ </div><!-- end of div class="global-nav-section" -->
+ <% end %><!-- end of @items['/_data/global-nav.yaml'] -->
+</nav>
diff --git a/layouts/head.html b/layouts/head.html
index e99be97c..5ff96a8e 100644
--- a/layouts/head.html
+++ b/layouts/head.html
@@ -32,14 +32,16 @@
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WZCXKT5');</script>
<!-- End Google Tag Manager -->
+
+ <!-- add cookie consent -->
+ <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="36a06ac5-ddb4-4f91-8337-067ad19ad8d5" type="text/javascript" async></script>
+
+ <!-- Google webmasters verification -->
+ <meta name="google-site-verification" content="6eFQOFLxYAer08ROqc3I-SAi44F9NmvH7PrUUBR3oCI" />
<% end %>
+
<script async src="<%= @items['/assets/javascripts/classlist-polyfill.*'].path %>"></script>
-<script async src="<%= @items['/assets/javascripts/docs.*'].path %>"></script>
-<!-- add cookie consent -->
-<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="36a06ac5-ddb4-4f91-8337-067ad19ad8d5" type="text/javascript" async></script>
<!-- you don't need to keep this, but it's cool for stats! -->
<meta name="generator" content="Nanoc <%= Nanoc::VERSION %>">
<!-- Algolia Searching from the URL bar https://www.algolia.com/doc/tutorials/search-ui/ux-patterns/search-from-the-url-bar/ -->
<link href='/opensearch.xml' rel='search' title='Search through GitLab Docs' type='application/opensearchdescription+xml'>
-<!-- Google webmasters verification -->
-<meta name="google-site-verification" content="6eFQOFLxYAer08ROqc3I-SAi44F9NmvH7PrUUBR3oCI" />
diff --git a/layouts/instantsearch.html b/layouts/instantsearch.html
index 7203506e..26c91246 100644
--- a/layouts/instantsearch.html
+++ b/layouts/instantsearch.html
@@ -17,9 +17,9 @@
<div class="clear"></div>
</div>
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
- <script type="application/javascript" src="/assets/javascripts/instantsearch.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/instantsearch.*'].path %>"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script type="application/javascript" src="/assets/javascripts/badges.js"></script>
+ <script type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
<%= render '/footer.*' %>
<%= render '/analytics.*' %>
<%= render '/https_redirect.*' %>
diff --git a/nanoc.yaml b/nanoc.yaml
index 2fb2294a..7465743f 100644
--- a/nanoc.yaml
+++ b/nanoc.yaml
@@ -96,10 +96,16 @@ checks:
# A list of patterns, specified as regular expressions, to exclude from the check.
# If an external link matches this pattern, the validity check will be skipped.
exclude:
- - 'http:\/\/127\.0\.0\.1:3000.*'
- - 'http:\/\/www\.amazon\.com\/.*'
- - 'http:\/\/www\.amazon\.co\.uk\/.*'
- - 'http:\/\/192\.168\.59\.103'
+ # Valid links incorrectly reported as broken
+ - 'https:\/\/www\.linkedin\.com\/company\/gitlab-com'
+ - 'https:\/\/auth0\.com\/auth\/login'
+ - 'https:\/\/gitlab-org\.gitlab\.io\/gitlab-svgs'
+ - 'https:\/\/dl\.acm\.org\/citation\.cfm\?id=361591'
+ - 'https:\/\/pgp\.mit\.edu\/pks\/lookup\?op=vindex\&search=.*'
+ # Don't check links matching the following patterns
+ - 'https?:\/\/\w*\.example\.com.*'
+ - 'https?:\/\/localhost.*'
+ - 'https?:\/\/127.0.0.1.*'
# A list of file patterns, specified as regular expressions, to exclude from the check.
# If a file matches this pattern, the links from this file will not be checked.