Skip to content

Commit 3994f68

Browse files
author
Andre Moeller
committed
Move doc files into new structure
1 parent daee823 commit 3994f68

35 files changed

+31
-31
lines changed

GNUmakefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
7070
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
7171
endif
7272
(cd $(GOPATH)/src/$(WEBSITE_REPO); \
73-
ln -fs ../../../ext/providers/$(PKG_NAME)/website/$(PKG_NAME).erb content/source/layouts/$(PKG_NAME).erb; \
74-
ln -Fs ../../../../ext/providers/$(PKG_NAME)/website/docs content/source/docs/providers/$(PKG_NAME) \
73+
ln -fs ../../../ext/providers/$(PKG_NAME)/$(PKG_NAME).erb content/source/layouts/$(PKG_NAME).erb; \
74+
ln -Fs ../../../../ext/providers/$(PKG_NAME)/docs content/source/docs/providers/$(PKG_NAME) \
7575
)
7676
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
7777

@@ -81,8 +81,8 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
8181
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
8282
endif
8383
(cd $(GOPATH)/src/$(WEBSITE_REPO); \
84-
ln -fs ../../../ext/providers/$(PKG_NAME)/website/$(PKG_NAME).erb content/source/layouts/$(PKG_NAME).erb; \
85-
ln -Fs ../../../../ext/providers/$(PKG_NAME)/website/docs content/source/docs/providers/$(PKG_NAME) \
84+
ln -fs ../../../ext/providers/$(PKG_NAME)/$(PKG_NAME).erb content/source/layouts/$(PKG_NAME).erb; \
85+
ln -Fs ../../../../ext/providers/$(PKG_NAME)/docs content/source/docs/providers/$(PKG_NAME) \
8686
)
8787
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
8888

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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

gendocs/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
cloudMark = "nexus"
2424
cloudTitle = "Nexus"
2525
cloudMarkShort = "nexus"
26-
docRoot = "../website/docs"
26+
docRoot = "../docs"
2727
)
2828

2929
func main() {
@@ -259,7 +259,7 @@ func genDoc(dtype, fpath, name string, resource *schema.Resource) {
259259
}
260260
data["attributes"] = strings.Join(attributes, "\n")
261261

262-
fname = fmt.Sprintf("%s/%s/%s.html.markdown", docRoot, dtype[0:1], data["resource"])
262+
fname = fmt.Sprintf("%s/%ss/%s.md", docRoot, strings.ReplaceAll(dtype, "_", "-"), data["resource"])
263263
fd, err := os.OpenFile(fname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
264264
if err != nil {
265265
log.Printf("[FAIL!]open file %s failed: %s", fname, err)

website/nexus.erb nexus.erb

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,57 @@
1313
<a href="#">Data Sources</a>
1414
<ul class="nav nav-visible">
1515
<li<%= sidebar_current("data_source_blobstore") %>>
16-
<a href="/docs/providers/nexus/d/data_source_blobstore.html">data_source_blobstore</a>
16+
<a href="/docs/providers/nexus/data-sources/data_source_blobstore.html">data_source_blobstore</a>
1717
</li>
1818
<li<%= sidebar_current("data_source_privileges") %>>
19-
<a href="/docs/providers/nexus/d/data_source_privileges.html">data_source_privileges</a>
19+
<a href="/docs/providers/nexus/data-sources/data_source_privileges.html">data_source_privileges</a>
2020
</li>
2121
<li<%= sidebar_current("data_source_repository") %>>
22-
<a href="/docs/providers/nexus/d/data_source_repository.html">data_source_repository</a>
22+
<a href="/docs/providers/nexus/data-sources/data_source_repository.html">data_source_repository</a>
2323
</li>
2424
<li<%= sidebar_current("data_source_security_ldap") %>>
25-
<a href="/docs/providers/nexus/d/data_source_security_ldap.html">data_source_security_ldap</a>
25+
<a href="/docs/providers/nexus/data-sources/data_source_security_ldap.html">data_source_security_ldap</a>
2626
</li>
2727
<li<%= sidebar_current("data_source_security_realms") %>>
28-
<a href="/docs/providers/nexus/d/data_source_security_realms.html">data_source_security_realms</a>
28+
<a href="/docs/providers/nexus/data-sources/data_source_security_realms.html">data_source_security_realms</a>
2929
</li>
3030
<li<%= sidebar_current("data_source_user") %>>
31-
<a href="/docs/providers/nexus/d/data_source_user.html">data_source_user</a>
31+
<a href="/docs/providers/nexus/data-sources/data_source_user.html">data_source_user</a>
3232
</li>
3333
</ul>
3434
</li>
3535
<li<%= sidebar_current("docs-nexus-resource") %>>
3636
<a href="#">Resources</a>
3737
<ul class="nav nav-visible">
3838
<li<%= sidebar_current("resource_blobstore") %>>
39-
<a href="/docs/providers/nexus/r/resource_blobstore.html">resource_blobstore</a>
39+
<a href="/docs/providers/nexus/resources/resource_blobstore.html">resource_blobstore</a>
4040
</li>
4141
<li<%= sidebar_current("resource_content_selector") %>>
42-
<a href="/docs/providers/nexus/r/resource_content_selector.html">resource_content_selector</a>
42+
<a href="/docs/providers/nexus/resources/resource_content_selector.html">resource_content_selector</a>
4343
</li>
4444
<li<%= sidebar_current("resource_privilege") %>>
45-
<a href="/docs/providers/nexus/r/resource_privilege.html">resource_privilege</a>
45+
<a href="/docs/providers/nexus/resources/resource_privilege.html">resource_privilege</a>
4646
</li>
4747
<li<%= sidebar_current("resource_repository") %>>
48-
<a href="/docs/providers/nexus/r/resource_repository.html">resource_repository</a>
48+
<a href="/docs/providers/nexus/resources/resource_repository.html">resource_repository</a>
4949
</li>
5050
<li<%= sidebar_current("resource_role") %>>
51-
<a href="/docs/providers/nexus/r/resource_role.html">resource_role</a>
51+
<a href="/docs/providers/nexus/resources/resource_role.html">resource_role</a>
5252
</li>
5353
<li<%= sidebar_current("resource_script") %>>
54-
<a href="/docs/providers/nexus/r/resource_script.html">resource_script</a>
54+
<a href="/docs/providers/nexus/resources/resource_script.html">resource_script</a>
5555
</li>
5656
<li<%= sidebar_current("resource_security_ldap") %>>
57-
<a href="/docs/providers/nexus/r/resource_security_ldap.html">resource_security_ldap</a>
57+
<a href="/docs/providers/nexus/resources/resource_security_ldap.html">resource_security_ldap</a>
5858
</li>
5959
<li<%= sidebar_current("resource_security_ldap_order") %>>
60-
<a href="/docs/providers/nexus/r/resource_security_ldap_order.html">resource_security_ldap_order</a>
60+
<a href="/docs/providers/nexus/resources/resource_security_ldap_order.html">resource_security_ldap_order</a>
6161
</li>
6262
<li<%= sidebar_current("resource_security_realms") %>>
63-
<a href="/docs/providers/nexus/r/resource_security_realms.html">resource_security_realms</a>
63+
<a href="/docs/providers/nexus/resources/resource_security_realms.html">resource_security_realms</a>
6464
</li>
6565
<li<%= sidebar_current("resource_user") %>>
66-
<a href="/docs/providers/nexus/r/resource_user.html">resource_user</a>
66+
<a href="/docs/providers/nexus/resources/resource_user.html">resource_user</a>
6767
</li>
6868
</ul>
6969
</li>

scripts/generate_website_content.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!/bin/bash
99

10-
cat > website/nexus.erb << EOI
10+
cat > nexus.erb << EOI
1111
<% wrap_layout :inner do %>
1212
<% content_for :sidebar do %>
1313
<div class="docs-sidebar hidden-print affix-top" role="complementary">
@@ -33,11 +33,11 @@ do
3333

3434
if [[ "$res" =~ "resource" ]]
3535
then
36-
typeShort="r"
36+
typeUrl="resources"
3737
typeLong="resource"
3838
if [[ "${writingDataSources}" == true ]]
3939
then
40-
cat >> website/nexus.erb << EOI
40+
cat >> nexus.erb << EOI
4141
</ul>
4242
</li>
4343
<li<%= sidebar_current("docs-nexus-resource") %>>
@@ -47,15 +47,15 @@ EOI
4747
writingDataSources=false
4848
fi
4949
else
50-
typeShort="d"
50+
typeUrl="data-sources"
5151
typeLong="data"
5252
fi
5353

5454
echo $res
5555

56-
if [[ ! -f website/docs/$typeShort/$res.html.markdown ]]
56+
if [[ ! -f docs/$typeUrl/$res.md ]]
5757
then
58-
cat > website/docs/$typeShort/${res}.html.markdown << EOI
58+
cat > docs/$typeUrl/${res}.md << EOI
5959
---
6060
layout: "nexus"
6161
page_title: "Nexus: $res"
@@ -83,14 +83,14 @@ data "scaffolding_data_source" "example" {
8383
EOI
8484
fi
8585

86-
cat >> website/nexus.erb << EOI
86+
cat >> nexus.erb << EOI
8787
<li<%= sidebar_current("$res") %>>
88-
<a href="/docs/providers/nexus/$typeShort/${res}.html">$res</a>
88+
<a href="/docs/providers/nexus/$typeUrl/${res}.html">$res</a>
8989
</li>
9090
EOI
9191
done
9292

93-
cat >> website/nexus.erb << EOI
93+
cat >> nexus.erb << EOI
9494
</ul>
9595
</li>
9696
</ul>

0 commit comments

Comments
 (0)