Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docsy] Improve styles, change hero image, and more #67

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion assets/icons/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions assets/scss/_csp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
}
}

// Homepage: it will need to be updated when the hero image is changed.
// Homepage: URLs below will need to be updated when the hero image changes.

#td-cover-block-0 {
background-image: url(/featured-background_hu5459c0360c2b0cb7a147d2df0eb350ca_6445823_960x540_fill_q75_catmullrom_top.jpg);
background-image: url(/featured-background_hu16056391159218873026.jpg);
}

@media only screen and (min-width: 1200px) {
#td-cover-block-0 {
background-image: url(/featured-background_hu5459c0360c2b0cb7a147d2df0eb350ca_6445823_1920x1080_fill_q75_catmullrom_top.jpg);
background-image: url(/featured-background_hu18408291696259244493.jpg);
}
}
1 change: 1 addition & 0 deletions assets/scss/_external_link.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copied from https://github.com/open-telemetry/opentelemetry.io/blob/ddd8d43fff700effbe0047473071f9bab66ddb07/assets/scss/_external_link.scss
// External-link icon after an external link
//
// To ensure that the external-link icon word-wraps along with the preceding
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/_news.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.is-2 {
flex: 0 0 16.67%; /* Equivalent to 2 out of 12 columns */
font-weight: bold;
color: #555;
color: var(--bs-tertiary-color);
}

.in-toto-column-content {
Expand Down
17 changes: 5 additions & 12 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
@import 'external_link';
@import 'td/code-dark';
@import 'csp';
@import 'news';
@import 'external_link';
@import 'td/code-dark';

.td-navbar {
background-color: $primary !important;
opacity: 1;
}

.td-navbar .navbar-brand {
svg {
height: 3rem;
margin-left: 5rem;
}
.td-navbar .navbar-brand svg {
height: 38px;
}

.td-home {
Expand All @@ -38,6 +30,7 @@

a {
color: white;

&.external-link:after {
display: none;
}
Expand Down
2 changes: 0 additions & 2 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ $in-toto-colors: (
'blue-light': #a3b5c8,
);

$primary: map-get($in-toto-colors, 'blue');
$secondary: map-get($in-toto-colors, 'orange');
$td-enable-google-fonts: false;
Binary file modified content/en/featured-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
baseURL: https://in-toto.io
title: in-toto

disableAliases: true # We do redirects via Netlify's _redirects file
disableKinds: [taxonomy]
theme: [docsy]
enableGitInfo: true
enableRobotsTXT: true

theme: [docsy]
#
# Outputs and Netlify _redirects file support
#

disableAliases: true # We do redirects via Netlify's _redirects file

outputs:
home: [HTML]
Expand Down
37 changes: 37 additions & 0 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{/* Source: https://github.com/open-telemetry/opentelemetry.io/blob/ddd8d43fff700effbe0047473071f9bab66ddb07/layouts/_default/_markup/render-link.html */ -}}

{{ $url := .Destination -}}

{{/* General link-render processing */ -}}

{{ $isExternal := hasPrefix $url "http" -}}
{{ if $isExternal -}}
{{ if findRE "^https://opentelemetry.io/\\w" $url -}}
{{ warnf "%s: use a local path, not an external URL, for the following reference to a site local page: %s"
.Page.File.Path $url -}}
{{ else if or
(findRE "^https://github.com/open-telemetry/opentelemetry-specification/(blob|tree)/main/specification/\\w" $url)
(findRE "^https://github.com/open-telemetry/opentelemetry-proto/(blob|tree)/main/docs/specification" $url)
(findRE "^https://github.com/open-telemetry/semantic-conventions/(blob|tree)/main/docs" $url)
-}}
{{ warnf "%s: use a local path, not an external URL, for the following reference to a local specification page: %s"
.Page.File.Path $url -}}
{{ end -}}
{{ end -}}

{{/* Until Hugo supports hook params (https://github.com/gohugoio/hugo/issues/6670), we'll inspect .Text. */ -}}

<a href="{{ $url | safeURL }}"
{{- with .Title}} title="{{ . }}"{{ end -}}
{{- if $isExternal }} target="_blank" rel="noopener"
{{- $noExternalIcon := in .Text "hk-no-external-icon" -}}
{{ if not $noExternalIcon }} class="external-link"{{ end -}}
{{ end -}}
>
{{- .Text | safeHTML -}}
</a>

{{- /*
cSpell:ignore warnf
This comment ensures that all trailing whitespace is trimmed.
*/ -}}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ command = "npm run build:production"
[headers.values]
X-Content-Type-Options = "nosniff"
X-Frame-Options = "DENY"
Content-Security-Policy = "default-src 'self' code.jquery.com fonts.googleapis.com fonts.gstatic.com use.fontawesome.com"
Content-Security-Policy = "default-src 'self' code.jquery.com fonts.googleapis.com fonts.gstatic.com cse.google.com www.google.com use.fontawesome.com app.netlify.com netlify-cdp-loader.netlify.app youtube.com; frame-src youtube.com www.youtube.com"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"_hugo": "hugo --cleanDestinationDir",
"_ls-bad-filenames": "find assets content -name '*_*' ! -name '[_.]*'",
"_prepare:docsy": "cd themes/docsy && npm install",
"_serve": "npm run _hugo-dev -- --minify serve",
"_serve": "npm run _hugo-dev -- serve --minify --disableFastRender --renderToMemory",
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-http://localhost}\"",
"build:production": "npm run _hugo -- --minify",
"build": "npm run _build --",
Expand Down
4 changes: 2 additions & 2 deletions static/img/in-toto-horizontal-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.