Skip to content

Commit

Permalink
docs: add landing page and about page
Browse files Browse the repository at this point in the history
This patch includes an override of a partial that supports hiding the title
to create a nicer-looking landing page. Otherwise, mkdocs-material always
renders an <h1> if we specify a custom <p> for a tagline graphic.

Signed-off-by: Timo Beckers <timo@isovalent.com>
  • Loading branch information
ti-mo committed Oct 3, 2023
1 parent bc1fbf0 commit fe03e6e
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/ebpf/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The project was initially created in 2017 as
[`newtools/ebpf`](https://github.com/newtools/ebpf) by a group of passionate
developers wanting to bring the power eBPF to Go applications. It quickly gained
traction within the Go community, especially for projects that couldn't or
wouldn't build upon the CGo-based BCC bindings at the time (`gobpf`).

Since its inception, {{ proj }} has seen remarkable growth and widespread
adoption. It has become a fundamental building block for numerous open-source
projects. Major industry players and forward-thinking startups have integrated
the library into their technology stacks to combine the power and flexibility of
eBPF with the iteration speed, runtime safety and ease of deployment provided by
the Go language.

{{ proj }} maintains a strong commitment to collaborating with the upstream
Linux project, which ensures that it stays aligned with the latest advancements
in the eBPF ecosystem and remains compatible with the evolving Linux kernel and
its co-located BPF library, `libbpf`.

Thank you for being a part of our :ebee-color: eBPF journey!
43 changes: 43 additions & 0 deletions docs/ebpf/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
hide:
# Allow specifying our own tagline. Relies on custom overrides/content.html.
- title
---

<p align="center" class="tagline">The eBPF Library for Go</p>

![Honeygopher](ebpf-go.png){ align=right width="180" }

[![PkgGoDev](https://pkg.go.dev/badge/github.com/cilium/ebpf)](https://pkg.go.dev/github.com/cilium/ebpf)

:ebpf-go: {{ proj }} is a Go library for working with :ebee-color: eBPF. It does
not depend on C, libbpf, or any other Go libraries other than the standard
library, making it an excellent choice for writing self-contained, portable
tools that run on a variety of architectures.

This documentation aims to provide a central resource for learning how to build
Go applications that use eBPF.

## Installing

To add {{ proj }} as a dependency to an existing Go module, run this from within
the module's directory:

```
go get github.com/cilium/ebpf
```

## Target Audience

This documentation assumes familiarity with the basic concepts and terminology
of eBPF, as well as a basic understanding of the Go toolchain and how to write
idiomatic Go code.

For a high-level understanding of what eBPF is and how it works, please see [the
eBPF introduction at :ebee-color: ebpf.io](https://ebpf.io/what-is-ebpf).

## Examples

Discover [projects using {{ proj }} here](users.md). The repository contains an
[examples/ directory](https://github.com/cilium/ebpf/tree/main/examples) with
minimal demo applications that can be tested on any supported Linux machine.
12 changes: 12 additions & 0 deletions docs/ebpf/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/* Tagline on landing page. */
.tagline {
font-size: 3em;
font-weight: 900;
letter-spacing: -0.5px;
line-height: 1;
background: linear-gradient(120deg, #4051B5, 35%, #6AD6E4);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

/* :progress-wrench:
Custom 'incomplete' admonition for sections that need work or maintenance.
Create blocks using '!!! incomplete'.
Expand Down
20 changes: 20 additions & 0 deletions docs/overrides/partials/content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{#-
This file is forked from the upstream content.html to support hiding the title.
-#}
{% if "material/tags" in config.plugins and tags %}
{% include "partials/tags.html" %}
{% endif %}
{% include "partials/actions.html" %}
{% if "\x3ch1" not in page.content and
"title" not in page.meta.hide %}
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}
{{ page.content }}
{% if page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}
{% include "partials/source-file.html" %}
{% endif %}
{% include "partials/feedback.html" %}
{% include "partials/comments.html" %}

0 comments on commit fe03e6e

Please sign in to comment.