Skip to content

Commit 3fc7e7a

Browse files
Merge pull request #692 from raphael-istari/main
Clean from past ownership reference and misc updates
2 parents e613bd9 + 8d11cd8 commit 3fc7e7a

File tree

409 files changed

+17092
-2797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

409 files changed

+17092
-2797
lines changed

README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
To read the official Dgraph documentation that is published from this repository,
44
please see https://dgraph.io/docs/.
55

6+
7+
68
## Contribution guidelines
79

810
As a contributor to Dgraph documentation, we ask that you do the following:
@@ -48,11 +50,12 @@ We use [Hugo](https://gohugo.io/) for our documentation. You can use Hugo to loc
4850

4951
1. Download and install hugo version v0.91 from [here](https://github.com/gohugoio/hugo/releases/tag/v0.91.0).
5052

51-
2. Run the command below to get the theme.
52-
```bash
53-
pushd themes && git clone https://github.com/dgraph-io/hugo-docs && popd
54-
```
55-
3. Run `./scripts/local.sh` and visit [http://localhost:1313](http://localhost:1313) to see the documentation site running on your local machine.
53+
On mac you may have to remove the quarantine attribute to be able to execute hugo
54+
'''
55+
sudo xattr -d com.apple.quarantine path/to/hugo
56+
'''
57+
58+
2. Run `./scripts/local.sh` and visit [http://localhost:1313](http://localhost:1313) to see the documentation site running on your local machine.
5659

5760
(Optional) To run queries _within_ the documentation using a different Dgraph instance, set the `DGRAPH_ENDPOINT` environment variable before starting the local web server:
5861

@@ -105,5 +108,42 @@ Pass custom Go-GRPC example to the runnable by passing a `customExampleGoGRPC` t
105108

106109
**Note:** Runnable doesn't support passing a multiline string as an argument to a shortcode. Therefore, you have to create the whole custom example in a single line string by replacing newlines with `\n`.
107110

108-
## History
109-
add Hypermode banner by updating the hugo-docs repository with topbat template.
111+
## Hints
112+
## Adding New Tabs and Sidebar Menus
113+
114+
To add a new tab and configure its sidebar menu:
115+
116+
### 1. Add Tab to Navigation
117+
Edit `themes/hugo-docs/layouts/partials/topbar.html` and add your tab to the `$tabs` slice:
118+
119+
```go
120+
{{ $tabs := slice
121+
(dict "type" "docs" "url" "/dgraph-overview/" "label" "Docs")
122+
(dict "type" "graphql" "url" "/graphql/" "label" "GraphQL")
123+
(dict "type" "learn" "url" "/learn/" "label" "Tutorials")
124+
(dict "type" "ratel" "url" "/ratel/overview/" "label" "Ratel UI")
125+
(dict "type" "yourtype" "url" "/your-section/" "label" "Your Tab")
126+
}}
127+
```
128+
129+
### 2. Set Page Type and Menu
130+
For each page in your section, add to the frontmatter:
131+
132+
```yaml
133+
+++
134+
title = "Your Page Title"
135+
type = "yourtype" # Must match the type in the tab definition
136+
[menu.yourtype] # Must match the type
137+
parent = "your-section"
138+
weight = 1
139+
+++
140+
```
141+
142+
### 3. Update Sidebar
143+
Edit `themes/hugo-docs/layouts/partials/sidebar.html` and add:
144+
145+
```go
146+
{{ if eq $menuType "yourtype" }}
147+
{{ $menu = .Site.Menus.yourtype }}
148+
{{ end }}
149+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)