Skip to content

Commit

Permalink
Add Header Banner Links and FAQ Anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Feb 29, 2024
1 parent d094d8a commit b6870cb
Show file tree
Hide file tree
Showing 91 changed files with 443 additions and 5,140 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/.env
**.log

/docs/ble/_sources/
/docs/ble/.doctrees/
/docs/ble/.buildinfo
/docs/ble/objects.inv

/test.html
/link_results
.vscode
Expand Down
13 changes: 11 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ collections:
tutorials:
output: true
sort_by: lesson
demos:
output: true

# Defaults
defaults:
Expand All @@ -176,6 +174,17 @@ defaults:
read_time: true
toc: true
toc_sticky: true
- scope:
path: ble
values:
layout: spec
canonical_url: https://gopro.github.io/OpenGoPro/ble # Minimal mistakes is overwriting this to bad value in seo.html
- scope:
path: http
values:
layout: spec
canonical_url: https://gopro.github.io/OpenGoPro/http # Minimal mistakes is overwriting this to bad value in seo.html


jekyll-spaceship:
# default enabled processors
Expand Down
12 changes: 12 additions & 0 deletions docs/_includes/head/custom.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
<script>
// Add anchors on DOMContentLoaded
document.addEventListener('DOMContentLoaded', function (event) {
var manualAnchors = new AnchorJS();
manualAnchors.options = {
titleText: 'Permalink',
placement: 'left'
};
manualAnchors.add('.anchored');
});
</script>
<link
rel="apple-touch-icon"
sizes="180x180"
Expand Down
22 changes: 22 additions & 0 deletions docs/_includes/head_spec.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<meta charset="utf-8">

{% include seo.html %}

<!-- https://t.co/dKP3o1e -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- TODO This is probably where our masthead highlighting is going wrong -->
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>

<!-- For all browsers -->
<link rel="stylesheet" href="{{ '/assets/css/main_spec.css' | relative_url }}">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css"></noscript>

{% if site.head_scripts %}
{% for script in site.head_scripts %}
<script src="{{ script | relative_url }}"></script>
{% endfor %}
{% endif %}
25 changes: 25 additions & 0 deletions docs/_includes/masthead_spec.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% capture logo_path %}{{ site.logo }}{% endcapture %}

<div class="masthead">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
{% unless logo_path == empty %}
<a class="site-logo" href="{{ '/' | relative_url }}"><img src="{{ logo_path | relative_url }}" alt="{{ site.masthead_title | default: site.title }}"></a>
{% endunless %}
<a class="site-title" href="{{ '/' | relative_url }}">
{{ site.masthead_title | default: site.title }}
{% if site.subtitle %}<span class="site-subtitle">{{ site.subtitle }}</span>{% endif %}
</a>
<ul class="visible-links">
{%- for link in site.data.navigation.main -%}
<li class="masthead__menu-item">
<a href="{{ link.url | relative_url }}"{% if link.description %} title="{{ link.description }}"{% endif %}>{{ link.title }}</a>
</li>
{%- endfor -%}
</ul>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
64 changes: 0 additions & 64 deletions docs/_layouts/demo.html

This file was deleted.

92 changes: 0 additions & 92 deletions docs/_layouts/protobuf_markdown.tmpl

This file was deleted.

14 changes: 14 additions & 0 deletions docs/_layouts/spec.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
---

<!doctype html>
<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
<head>
{% include head_spec.html %}
{% include head/custom.html %}
</head>
<body>
{% include_cached masthead_spec.html %}
{{ content }}
</body>
</html>
2 changes: 1 addition & 1 deletion docs/_plugins/accordion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def render(context)
content = converter.convert(render_block(context))
# Place results into html
output = <<~EOS
<div class="accordion-container">
<div class="accordion-container anchored">
<button class="accordion">#{title}<i class="fa fa-chevron-down"></i></button>
<div class="panel">#{content}</div>
</div>
Expand Down
82 changes: 82 additions & 0 deletions docs/_sass/minimal-mistakes/_base_spec.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* ==========================================================================
BASE ELEMENTS
========================================================================== */

html {
/* sticky footer fix */
position: relative;
min-height: 100%;
}

.masthead__menu-item a {
color: rgb(255, 255, 255) !important;
}

body {
margin: 0;
padding: $masthead-height 0 0;
color: $text-color;
font-family: $global-font-family;
line-height: 1.5;

&.overflow--hidden {
/* when primary navigation is visible, the content in the background won't scroll */
overflow: hidden;
}
}

/* reduce orphans and widows when printing */

p,
pre,
blockquote,
ul,
ol,
dl,
figure,
table,
fieldset {
orphans: 3;
widows: 3;
}

pre {
overflow-x: auto; /* add scrollbars to wide code blocks*/
}


/* Fix IE9 SVG bug */

svg:not(:root) {
overflow: hidden;
}

/*
Global animation transition
========================================================================== */

b,
i,
strong,
em,
blockquote,
p,
q,
span,
figure,
img,
h1,
h2,
header,
input,
a,
tr,
td,
form button,
input[type="submit"],
.btn,
.highlight,
.archive__item-teaser {
-webkit-transition: $global-transition;
transition: $global-transition;
}
5 changes: 5 additions & 0 deletions docs/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,8 @@ img.mermaid {
.panel p {
margin: 0 0 0.2em !important;
}

/* https://www.bryanbraun.com/anchorjs/#pages-with-a-sticky-navbar */
:target {
scroll-margin-top: 4em;
}
Loading

0 comments on commit b6870cb

Please sign in to comment.