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

feat: Add initial docs site setup #37

Merged
merged 6 commits into from
Mar 20, 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
80 changes: 80 additions & 0 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.123.8
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
working-directory: ./site
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
working-directory: ./site
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./site/public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
4 changes: 4 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/public
resources/
node_modules/
.hugo_build.lock
1 change: 1 addition & 0 deletions site/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
4 changes: 4 additions & 0 deletions site/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM floryn90/hugo:ext-alpine

RUN apk add git && \
git config --global --add safe.directory /src
254 changes: 254 additions & 0 deletions site/assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
/* etcd-docsy full file override: we're not tracking changes to the docsy file of the same name. */

.td-home {
h1 {
// @extend .display-1;
margin-bottom: 2.5rem;
text-align: center;
}

h2 {
// @extend .display-2;
margin-bottom: 1.5rem;
text-align: center;
}

h3 {
//@extend .display-3;
}

h4 {
// @extend .display-4;
margin-bottom: 1rem;
}

.home--top-section {
text-align: center;
}

.cncf-logo {
width: 20rem;
max-width: 80%;
}

.site-logo {
max-height: 8rem;
max-width: 65%;
}
}

// Components and objects

.c-features {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;

h3 {
color: $etcd-dark-blue;
}
}

.o-features__feature {
display: inline-flex;
flex-direction: column;

margin-bottom: 1.5rem;
padding-left: 1rem;
padding-right: 1rem;

h3 {
margin-bottom: 1.5rem;
}
}

.o-feature__icon {
width: 100%;
margin-left: auto;
margin-right: auto;
margin-top: 1rem;
max-width: 15rem;
max-height: 10rem;
}

.o-icon {
margin-right: 0.25rem;
}

.used-by-logo {
max-height: 4rem;
max-width: 100%;
}

.c-used-by__users {
display: flex;
flex-direction: column;
flex-wrap: wrap;
align-items: center;
margin-bottom: -3rem;
}

.c-used-by__user {
margin-left: auto;
margin-right: auto;
padding-left: 1.5rem;
padding-right: 1.5rem;
padding-bottom: 3rem;
}

@include media-breakpoint-up(sm) {
.c-features {
padding-right: 3rem;
padding-left: 3rem;
}
}

@include media-breakpoint-up(md) {
.c-features {
flex-direction: row;
}

.c-used-by__users {
flex-direction: row;
justify-content: between;
}

.c-used-by__user {
padding-bottom: 1.5rem;
}
}

// Bootstrap and Docsy overrides

.alert > p:last-child {
margin-bottom: 0;
}

// Utilities

.bg-gray-100 {
background-color: $gray-100;
}

// Fixes https://github.com/etcd-io/website/issues/266: the docsy partial
// shouldn't be hard coding styles by using classes like "text-uppercase". This
// overrides the docsy styling.
.navbar-brand > .text-uppercase {
text-transform: initial !important;
}


// Layout
.l-container--padded {
padding-top: 2rem;
padding-bottom: 2rem;
}


// DOCS

.td-toc {
padding-top: 1rem;
}

// Extend the sidebar to the end of the visible page.
.td-sidebar-toc {
height: initial;
padding-top: 4.75rem;
}

.td-sidebar-nav__section {
.ul-1 ul { padding-left: 1rem; }
.ul-2 { padding-left: 0 !important; }
}

// Custom in-page toc. Apply this class as a modifier on top of the Docsy-provided .td-toc
.td-toc--inline {
padding-top: 0;
padding-bottom: 1rem;
border-left: none;
position: static;
height: auto;

& + .td-content {
margin-top: 1.5rem;
}

// Workaround to prevent the first three entries from being hidden
& #td-content__toc.collapse:not(.show) {
display: block;
overflow: hidden;
min-height: 5.5rem;
height: 5.5rem;
}

& #td-content__toc.collapsing {
height: 5rem;
}

& #td-content__toc.collapse:not(.show) + #td-content__toc-link-expanded::before,
& #toc-contents.collapse:not(.show) + #td-content__toc-link-expanded::before {
content: "";
}

& #td-content__toc.collapse.show + #td-content__toc-link-expanded::before,
& #toc-contents + #td-content__toc-link-expanded::before {
content: "\2303";
}
}

#td-content__toc-link span i.fa-chevron-right {
transition: transform 250ms ease-in-out;
}

#td-content__toc-link[aria-expanded="true"] span i.fa-chevron-right {
transform: rotate(-90deg);
}

#td-content__toc-link-expanded {
background-color: $gray-200;
}

// add icon to signify that a link is external
// from https://fontawesome.com/v5.15/icons/external-link-alt?style=solid

.td-content a[href^="http://"]:after,
.td-content a[href^="https://"]:after {
@extend .fas;
font-size: 50%;
margin-left: 1px;
opacity: 0.8;
vertical-align: text-top;
content: fa-content($fa-var-external-link-alt);
}

.card-title {
.fab::before, .fas::before { margin-right: .5rem; }
}

// ************************************
// Version menu
// ************************************

.cncf-vers-menu--item {
&:hover {
background: $primary;
color: white;
}
}

.cncf-vers-menu--item__not-found {
color: $gray-600;
&:hover {
background: lighten($primary, 60%);
color: $gray-900;
}
&:after {
@extend .fas;
font-size: .8rem;
padding-left: 6px;
content: fa-content($fa-var-home);
color: lighten($primary, 15%);
}
}
16 changes: 16 additions & 0 deletions site/assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Add styles or override variables from the theme here.
*/

/* etcd-docsy full file override: we're not tracking changes to the docsy base file. */

$etcd-blue: #419eda;
$etcd-light-blue: lighten($etcd-blue, 10%);
$etcd-dark-blue: darken($etcd-blue, 20%);

$primary: $etcd-dark-blue;
$secondary: $etcd-light-blue;
$_yellow: #ffc107;
$warning: $_yellow; // Use Bootstrap default
Loading