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-based version of website #53

Merged
merged 18 commits into from
Sep 5, 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
32 changes: 32 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Files

on:
pull_request:

jobs:
# check-filenames:
# name: FILENAME check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - run: npm run check:filenames

check-formatting:
name: FILE FORMAT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create NPM cache-hash input file
run: |
mkdir -p tmp
jq '{devDependencies, engines, gitHubActionCacheKey}' package.json > tmp/package-ci.json

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: tmp/package-ci.json

- name: Check file format
run: npm run check:format --ignore-scripts
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@

# npm artifacts
node_modules/

# other
/tmp
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/docsy"]
path = themes/docsy
url = https://github.com/google/docsy.git
10 changes: 10 additions & 0 deletions .htmltest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DirectoryPath: public
CheckDoctype: false # Sadly, this is false only because of `static/google*.html`
IgnoreAltMissing: true # FIXME
IgnoreDirectoryMissingTrailingSlash: true # FIXME
IgnoreDirs: [_print] # FIXME
IgnoreEmptyHref: true # FIXME
IgnoreInternalEmptyHash: true # FIXME
IgnoreInternalURLs: # list of paths
IgnoreURLs: # list of regexs of paths or URLs to be ignored
- ^https://twitter.com/docsydocs$
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Temporary: ignore top-level *.md until docsy branch is merged into main
CONTRIBUTING.md
README.md

/themes
/layouts
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
HTMLTEST_DIR=tmp
HTMLTEST?=htmltest # Specify as make arg if different
HTMLTEST_ARGS?=--skip-external

# Use $(HTMLTEST) in PATH, if available; otherwise, we'll get a copy
ifeq (, $(shell which $(HTMLTEST)))
override HTMLTEST=$(HTMLTEST_DIR)/bin/htmltest
ifeq (, $(shell which $(HTMLTEST)))
GET_LINK_CHECKER_IF_NEEDED=get-link-checker
endif
endif

check-links: $(GET_LINK_CHECKER_IF_NEEDED)
$(HTMLTEST) $(HTMLTEST_ARGS)

clean:
rm -rf $(HTMLTEST_DIR) public/* resources

get-link-checker:
rm -Rf $(HTMLTEST_DIR)/bin
curl https://htmltest.wjdp.uk | bash -s -- -b $(HTMLTEST_DIR)/bin
1 change: 1 addition & 0 deletions 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.
10 changes: 0 additions & 10 deletions assets/js/app.js

This file was deleted.

103 changes: 0 additions & 103 deletions assets/sass/style.sass

This file was deleted.

36 changes: 36 additions & 0 deletions assets/scss/_external_link.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// External-link icon after an external link
//
// To ensure that the external-link icon word-wraps along with the preceding
// word, rather than by itself, we (1) start content with $nbsp, and (2) ensure
// that `display` is 'inline'.
//
// For a discussion concerning this topic, see
// https://stackoverflow.com/questions/16100956/prevent-after-element-from-wrapping-to-next-line.

$nbsp: \00A0;

@mixin external-link-icon() {
@extend .fas;
display: inline;
@include font-size(60%);
opacity: 0.8;
vertical-align: text-top;
content: fa-content($nbsp + $fa-var-external-link-alt);
}

.td-sidebar-nav a[target='_blank']:after,
a.external-link:after {
@include external-link-icon();
}

.td-footer a.external-link:after {
display: none !important;
}

// Can't quite use this yet since (1) breadcrumbs currently use external links,
// (2) we can't currently easily turn this off for footer icons.
//
// a[href^="http://"]:not(.btn):not(.external-link):after,
// a[href^="https://"]:not(.btn):not(.external-link):after {
// @include external-link-icon();
// }
35 changes: 35 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@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-home {
.cncf {
text-align: center;

p {
font-size: 1.2rem;
margin-bottom: 0;
}

img {
width: 20rem;
padding-top: 1rem;
max-width: 80%;
}

a.external-link:after {
display: none;
}
}
}
10 changes: 10 additions & 0 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$in-toto-colors: (
'orange': #ed4b27,
'orange-light': #f47a39,
'blue': #1b2838,
'blue-light': #a3b5c8,
);

$primary: map-get($in-toto-colors, 'blue');
$secondary: map-get($in-toto-colors, 'orange');
$td-enable-google-fonts: false;
Loading