Skip to content

Commit 740efe9

Browse files
committed
feat: doc/build, doc/install
Problem: Currently, BUILD.md and INSTALL.md are only available on github. Solution: Copy them to `content/doc2/` and let Hugo render them.
1 parent 8d55838 commit 740efe9

File tree

6 files changed

+46
-96
lines changed

6 files changed

+46
-96
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ This repository contains the source for the neovim.io website.
88

99
Just fork this repository and send us a pull request! :-)
1010

11-
To embed raw html:
12-
13-
{{< rawhtml >}}
14-
<lol>
15-
{{< /rawhtml >}}
16-
1711
## Setup
1812

1913
This site is statically generated using Hugo. It takes one minute to get setup,
@@ -33,8 +27,11 @@ just do the following:
3327

3428
Notes:
3529

36-
- www.neovim.io/doc is served by https://github.com/neovim/doc (which previously
37-
crawled neovim.io/doc2 generated from this repository).
30+
- Updating `content/doc2/` currently requires a human to run: `./sync_docs.sh`
31+
- Files in `content/doc2/` are synced to https://github.com/neovim/doc/ by
32+
[this CI job](https://github.com/neovim/doc/blob/4ab2e06af98dadbd35c4282c1b18304d87f8eb59/ci/doc-index.sh#L10-L13).
33+
- This is because `neovim.io/doc/` is served by https://github.com/neovim/doc/
34+
(where the user documentation HTML is published).
3835
- Site search (for `:help` docs) is served by [Algolia Docsearch](https://docsearch.algolia.com/).
3936
- The javascript and UI container were setup in [this commit](https://github.com/neovim/neovim.github.io/commit/ce9aef12eb1c98135965e3a9c5c792bf9e506a76).
4037
- The docs pages don't use the layout so they also need to [manually include](https://github.com/neovim/neovim/pull/23839) the javascript and define a UI container.

content/community.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

content/doc2/index.html renamed to content/doc2/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Documentation
33
active: Documentation
4-
type: default
4+
layout: single
55
---
66

77
<section class="front-section">

content/screenshots.html

Lines changed: 0 additions & 58 deletions
This file was deleted.

static/doc2/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

sync_docs.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# This script syncs files from Neovim core, to content/doc2/:
4+
# - BUILD.md
5+
# - INSTALL.md
6+
#
7+
# After Hugo publishes the rendered HTML from content/doc2/, the files are
8+
# later copied from doc2/ to doc/ by this CI task:
9+
# https://github.com/neovim/doc/blob/main/ci/doc-index.sh
10+
11+
set -eu
12+
13+
# Add Hugo markdown header.
14+
add_frontmatter() {
15+
local file="$1"
16+
local title="$2"
17+
18+
cat > "$file.tmp" <<EOF
19+
---
20+
title: $title
21+
type: page
22+
---
23+
24+
EOF
25+
cat "$file" >> "$file.tmp"
26+
mv "$file.tmp" "$file"
27+
}
28+
29+
curl -Lo content/doc2/build.md https://raw.githubusercontent.com/neovim/neovim/refs/heads/master/BUILD.md
30+
add_frontmatter content/doc2/build.md "Build"
31+
# Replace INSTALL.md hyperlinks with "./install".
32+
sed -i '' 's/INSTALL\.md/\.\.\/install/g' content/doc2/build.md
33+
34+
curl -Lo content/doc2/install.md https://raw.githubusercontent.com/neovim/neovim/refs/heads/master/INSTALL.md
35+
add_frontmatter content/doc2/install.md "Install"
36+
# Replace BUILD.md hyperlinks with "./build".
37+
sed -i '' 's/BUILD\.md/\.\.\/build/g' content/doc2/install.md
38+
39+
git add content/doc2/
40+
git commit -m 'update content/doc2/ files from neovim/neovim repo'

0 commit comments

Comments
 (0)