generated from cncf/hugo-netlify-starter
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a46a753
Showing
45 changed files
with
1,232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.{html,js,json,md,sass,yaml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Hugo-generated assets | ||
public/ | ||
resources/ | ||
|
||
# npm assets | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
yarn: | ||
yarn | ||
|
||
serve: yarn | ||
hugo server \ | ||
--buildDrafts \ | ||
--buildFuture \ | ||
--disableFastRender | ||
|
||
production-build: | ||
hugo \ | ||
--minify | ||
|
||
preview-build: | ||
hugo \ | ||
--baseURL $(DEPLOY_PRIME_URL) \ | ||
--buildDrafts \ | ||
--buildFuture \ | ||
--minify | ||
|
||
open: | ||
open https://cncf-hugo-starter.netlify.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# CNCF Hugo Starter | ||
|
||
This repository contains a boilerplate static site generator setup for creating CNCF documentation projects. We strongly recommend using this setup (it helps us help you and your project!), but none of the technologies in the stack are strictly required. | ||
|
||
The starter uses the following: | ||
* **[Hugo](https://gohugo.io/)** as a static site generator | ||
* **[Bulma](https://bulma.io/)** as a CSS framework | ||
* **[Netlify](https://www.netlify.com/)** for building, hosting, and DNS management | ||
|
||
## Running locally | ||
|
||
Make sure you have [npm](https://www.npmjs.com/) and [yarn](https://yarnpkg.com/) installed. Clone this repository and run the following two commands in its directory: | ||
|
||
```shell | ||
# Install npm assets (just Bulma for Sass/CSS) | ||
yarn | ||
|
||
# Run the server locally | ||
make serve | ||
``` | ||
|
||
## Running on Netlify | ||
|
||
Netlify is a CI/CD build tool and hosting solution for (among other things) static sites. We **strongly** recommend using Netlify unless you have a good reason not to. | ||
|
||
This repository comes with a pre-configured [`netlify.toml`](https://github.com/cncf/hugo-netlify-starter/blob/master/netlify.toml) file. To build to Netlify: | ||
|
||
1. Go to [netlify.com](https://netlify.com) and sign up. We recommend signing up using a GitHub account. | ||
2. Click **New Site from Git**, and give Netlify access to your GitHub account. | ||
> **Note:** For projects with lots of contributors, it can be handy to create a general/bot account instead of granting access with a personal account. | ||
3. Install Netlify with access to your documentation site repository. | ||
4. Leave all other settings as default and click **Deploy Site**. | ||
|
||
# What's included | ||
|
||
This repository has two layouts with minimal styling, all stored under `/layouts/_default`: | ||
|
||
* A **homepage** template, a basic homepage which uses the following: | ||
* The `index.html` file and partials in the `/partials/home` directory | ||
* Some helpers in the `/assets/sass/helpers.sass` file | ||
* A **docs** template, a basic content page with submenu which uses the following: | ||
* The `single.html` file and partials in the `/partials/docs` directory | ||
* Classes in the `/assets/sass/helpers.sass` and `/assets/sass/_docs.sass` files | ||
|
||
Both use default components and styling from the Bulma CSS framework. No menus are structured, because menu structure is highly dependant on the nature of the project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const navbarBurger = () => { | ||
const burger = $(".navbar-burger"), | ||
menu = $(".navbar-menu"); | ||
|
||
burger.click(() => { | ||
|
||
|
||
[burger, menu].forEach((el) => el.toggleClass('is-active')); | ||
}); | ||
} | ||
|
||
$(() => { | ||
console.log("Welcome to the CNCF's Hugo + Netlify starter"); | ||
|
||
navbarBurger(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* Header & Hero */ | ||
|
||
.single-hero .hero-body | ||
padding: 1.5rem | ||
code | ||
border-radius: 2px | ||
padding: 0.1rem 0.2rem 0.1rem 0.2rem | ||
|
||
.docs-title | ||
//background: linear-gradient(99.62deg, $cncf-blue-6 3.15%, $cncf-violet-10 88.41%) | ||
background-color: $cncf-violet-9 | ||
h1, p | ||
color: #ffffff | ||
|
||
.title | ||
@extend .title | ||
font-weight: 200 | ||
font-size: 3.815rem | ||
margin-top: 1rem | ||
margin-bottom: 1.5rem | ||
|
||
.subtitle | ||
font-weight: 200 | ||
|
||
.breadcrumb ul li | ||
display: inline | ||
|
||
/* Nav */ | ||
nav | ||
ul | ||
@extend .menu-list | ||
ul ul li | ||
border-left: 1px solid $cncf-blue-1 | ||
.menu-list ul, ul li ul | ||
margin: 0 | ||
|
||
/* Body */ | ||
.hashlink | ||
@extend .icon | ||
font-size: 1rem | ||
height: 1rem | ||
width: 1rem | ||
|
||
.headline-hash | ||
display: none | ||
|
||
@for $i from 1 through 6 | ||
h#{$i} | ||
&:hover > .headline-hash | ||
display: inline | ||
|
||
.content | ||
table | ||
background-color: $white | ||
thead th | ||
border-bottom: 1px solid $cncf-blue-5 | ||
background-color: $cncf-blue-5 | ||
font-size: $size-7 | ||
font-weight: 600 | ||
letter-spacing: 0.02rem | ||
text-transform: uppercase | ||
td | ||
border-bottom: 1px solid $cncf-blue-2 | ||
background-color: $cncf-blue-2 | ||
|
||
code | ||
background-color: $white-ter | ||
color: $cncf-violet-5 | ||
padding: 0.1rem 0.35rem 0.1rem 0.3rem | ||
border-radius: 2px | ||
pre | ||
background-color: transparent | ||
|
||
.docs-section-nav | ||
border-left: 1px solid #ebebeb | ||
hr | ||
height: 1px | ||
color: #ebebeb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
// This file is a "fork" of https://github.com/jgthms/bulma/blob/master/sass/elements/content.sass | ||
$content-heading-color: $text-strong !default | ||
$content-heading-weight: $weight-semibold !default | ||
$content-heading-line-height: 1.125 !default | ||
|
||
$content-blockquote-background-color: $background !default | ||
$content-blockquote-border-left: 5px solid $border !default | ||
$content-blockquote-padding: 1.25em 1.5em !default | ||
|
||
$content-pre-padding: 1.25em 1.5em !default | ||
|
||
$content-table-cell-border: 1px solid $border !default | ||
$content-table-cell-border-width: 0 0 1px !default | ||
$content-table-cell-padding: 0.5em 0.75em !default | ||
$content-table-cell-heading-color: $text-strong !default | ||
$content-table-head-cell-border-width: 0 0 2px !default | ||
$content-table-head-cell-color: $text-strong !default | ||
$content-table-foot-cell-border-width: 2px 0 0 !default | ||
$content-table-foot-cell-color: $text-strong !default | ||
|
||
.content | ||
@extend %block | ||
// Inline | ||
li + li | ||
margin-top: 0.25em | ||
// Block | ||
p, | ||
dl, | ||
ol, | ||
ul, | ||
blockquote, | ||
pre, | ||
table | ||
&:not(:last-child) | ||
margin-bottom: 1em | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 | ||
color: $content-heading-color | ||
font-weight: $content-heading-weight | ||
line-height: $content-heading-line-height | ||
h1 | ||
font-size: 2em | ||
margin-bottom: 0.5em | ||
&:not(:first-child) | ||
margin-top: 1em | ||
h2 | ||
font-size: 1.75em | ||
margin-bottom: 0.5714em | ||
&:not(:first-child) | ||
margin-top: 1.1428em | ||
h3 | ||
font-size: 1.5em | ||
margin-bottom: 0.6666em | ||
&:not(:first-child) | ||
margin-top: 1.3333em | ||
h4 | ||
font-size: 1.25em | ||
margin-bottom: 0.8em | ||
h5 | ||
font-size: 1.125em | ||
margin-bottom: 0.8888em | ||
h6 | ||
font-size: 1em | ||
margin-bottom: 1em | ||
blockquote | ||
background-color: $content-blockquote-background-color | ||
border-left: $content-blockquote-border-left | ||
padding: $content-blockquote-padding | ||
ol | ||
list-style-position: outside | ||
margin-left: 2em | ||
margin-top: 1em | ||
&:not([type]) | ||
list-style-type: decimal | ||
&.is-lower-alpha | ||
list-style-type: lower-alpha | ||
&.is-lower-roman | ||
list-style-type: lower-roman | ||
&.is-upper-alpha | ||
list-style-type: upper-alpha | ||
&.is-upper-roman | ||
list-style-type: upper-roman | ||
ul | ||
list-style: disc outside | ||
margin-left: 2em | ||
margin-top: 1em | ||
ul | ||
list-style-type: circle | ||
margin-top: 0.5em | ||
ul | ||
list-style-type: square | ||
dd | ||
margin-left: 2em | ||
figure | ||
margin-left: 2em | ||
margin-right: 2em | ||
text-align: center | ||
&:not(:first-child) | ||
margin-top: 2em | ||
&:not(:last-child) | ||
margin-bottom: 2em | ||
img | ||
display: inline-block | ||
figcaption | ||
font-style: italic | ||
pre | ||
+overflow-touch | ||
overflow-x: auto | ||
padding: $content-pre-padding | ||
white-space: pre | ||
word-wrap: normal | ||
sup, | ||
sub | ||
font-size: 75% | ||
table | ||
width: 100% | ||
td, | ||
th | ||
border: $content-table-cell-border | ||
border-width: $content-table-cell-border-width | ||
padding: $content-table-cell-padding | ||
vertical-align: top | ||
th | ||
color: $content-table-cell-heading-color | ||
&:not([align]) | ||
text-align: left | ||
thead | ||
td, | ||
th | ||
border-width: $content-table-head-cell-border-width | ||
color: $content-table-head-cell-color | ||
tfoot | ||
td, | ||
th | ||
border-width: $content-table-foot-cell-border-width | ||
color: $content-table-foot-cell-color | ||
tbody | ||
tr | ||
&:last-child | ||
td, | ||
th | ||
border-bottom-width: 0 | ||
.tabs | ||
li + li | ||
margin-top: 0 | ||
// Sizes | ||
&.is-small | ||
font-size: $size-small | ||
&.is-medium | ||
font-size: $size-medium | ||
&.is-large | ||
font-size: $size-large |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This guarantees that the footer stays stuck to the bottom of the page | ||
.is-page | ||
display: flex | ||
flex-direction: column | ||
min-height: 100vh | ||
|
||
.is-main | ||
flex: 1 | ||
@extend .has-bottom-margin | ||
|
||
.has-bottom-border | ||
border-bottom: 1px solid #ebebeb | ||
|
||
.has-bottom-margin | ||
margin-bottom: 3rem | ||
|
||
.has-bottom-margin-sm | ||
margin-bottom: 1.5rem | ||
|
||
.has-top-margin | ||
margin-top: 3rem | ||
|
||
.page-meta | ||
.breadcrumb, .github-edit | ||
display: inline | ||
color: $cncf-blue-3 | ||
a | ||
color: $white | ||
&:hover | ||
color: $cncf-blue-4 | ||
button | ||
background-color: $white | ||
border: 0px | ||
a | ||
color: $cncf-blue-7 | ||
&:hover | ||
color: $cncf-blue-9 |
Oops, something went wrong.