Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 7eeca14

Browse files
authored
Merge pull request #65 from stellar/nav-restructure
General site reorganization
2 parents 20bfacb + 4d82a7c commit 7eeca14

Some content is hidden

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

42 files changed

+587
-146
lines changed

gulp/enhance.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ function addRepoInfo(f, p) {
2727
let parts = p.split(path.sep);
2828

2929
switch(parts[0]) {
30-
case "learn":
30+
case "guides":
3131
case "reference":
32+
case "software":
3233
case "tools":
3334
case "beyond-code":
3435
f.repo = "docs";
@@ -75,13 +76,14 @@ function addFullTitle(f, p) {
7576

7677
function addSection(f, p) {
7778
if (path.extname(p) !== ".md") return;
79+
if (f.section) return;
7880

7981
let parts = p.split(path.sep);
8082
switch(parts[0]) {
81-
case "learn":
83+
case "guides":
8284
case "reference":
85+
case "software":
8386
case "tools":
84-
case "beyond-code":
8587
f.section = parts[0];
8688
break;
8789
default:

gulp/handlebars.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ module.exports.helpers = {
3535
},
3636

3737
sidebarSubMenu(title, options) {
38+
let c = options.hash.collapsible == true;
39+
const listTag = options.hash.numbered ? 'ol' : 'ul';
40+
3841
return `
39-
<li class="pageNavList__subList collapsibleListSet js-collapsibleListSet">
40-
<span class="pageNavList__title collapsibleListSet__label js-collapsibleListSet__label">${title}</span>
41-
<ul class="collapsibleListSet__list js-collapsibleListSet__list is-collapsed">
42+
<li class="pageNavList__subList${(c) ? ' collapsibleListSet js-collapsibleListSet' : ''}">
43+
<span class="pageNavList__title${(c) ? ' collapsibleListSet__label js-collapsibleListSet__label' : ''}">${title}</span>
44+
<${listTag} class="collapsibleListSet__list${(c) ? ' js-collapsibleListSet__list is-collapsed' : ''}">
4245
${options.fn(this)}
43-
</ul>
46+
</${listTag}>
4447
</li>
4548
`;
4649
},

gulpfile.babel.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import gulp from 'gulp';
22
import path from 'path';
33
import Metalsmith from 'metalsmith';
44
import _ from 'lodash';
5+
import markdownItAnchor from 'markdown-it-anchor';
6+
import markdownItFootnote from 'markdown-it-footnote';
57
import util from 'util';
68
import fs from 'fs';
79
import hbars from './gulp/handlebars';
@@ -21,10 +23,10 @@ gulp.task("default", ["build"]);
2123

2224
gulp.task('src:symlink-repos', ['git:clone'], () => {
2325
// symlink the landing pages/custom content from the docs repo for each section
24-
safeSymlink("../repos/docs/learn", "src/learn")
26+
safeSymlink("../repos/docs/guides", "src/guides")
2527
safeSymlink("../repos/docs/reference", "src/reference")
28+
safeSymlink("../repos/docs/software", "src/software")
2629
safeSymlink("../repos/docs/tools", "src/tools")
27-
safeSymlink("../repos/docs/beyond-code", "src/beyond-code")
2830

2931
// link up other repo's docs folder into the src structure
3032
return gulp.src("./repos/*/docs/")
@@ -39,6 +41,8 @@ gulp.task('js:copy-vendor', function() {
3941
'./bower_components/codemirror/addon/runmode/runmode.js',
4042
'./bower_components/codemirror/mode/javascript/javascript.js',
4143
'./bower_components/codemirror/mode/shell/shell.js',
44+
'./bower_components/codemirror/mode/clike/clike.js',
45+
'./bower_components/codemirror/mode/go/go.js',
4246
'./bower_components/stellar-sdk/stellar-sdk.min.js',
4347
])
4448
.pipe($g.concat('vendor.js'))
@@ -72,10 +76,10 @@ gulp.task('build', ['src:symlink-repos', "js:copy-vendor"], done => {
7276
files: [
7377
"js/vendor.js",
7478
"js/syntaxHighlight.js",
79+
"js/codeExamples.js",
7580
"js/endpointRef.js",
7681
"js/friendbot4.js",
7782
"js/collapsibleListSet.js",
78-
"js/headingAnchorShortcut.js",
7983
"js/linkCheck.js",
8084
],
8185
output: "js/app.js",
@@ -87,7 +91,16 @@ gulp.task('build', ['src:symlink-repos', "js:copy-vendor"], done => {
8791
]
8892
}))
8993
.use(renameReadme)
90-
.use($m.markdown())
94+
.use($m.markdownit({
95+
html: true,
96+
linkify: true,
97+
typographer: true
98+
}).use(markdownItAnchor, {
99+
permalink: true,
100+
permalinkClass: 'anchorShortcut',
101+
permalinkSymbol: '',
102+
permalinkBefore: true
103+
}).use(markdownItFootnote))
91104
.use($m.inPlace(_.extend({}, templateOptions, {
92105
pattern: '*.handlebars'
93106
})))

layouts/learn.handlebars renamed to layouts/guides.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{> header-full-with-sidebar }}
33

44
<div class="S-flex-row">
5-
{{> learn/sidebar }}
5+
{{> guides/sidebar }}
66
{{> contentWrapperStart }}
77
{{> contentWrapperEnd }}
88
</div>

layouts/software.handlebars

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{> head }}
2+
{{> header-full-with-sidebar }}
3+
4+
<div class="S-flex-row">
5+
{{> software/sidebar }}
6+
{{> contentWrapperStart }}
7+
{{> contentWrapperEnd }}
8+
</div>
9+
10+
{{> footer }}
11+
{{> foot }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
"handlebars": "^4.0.2",
1717
"load-metalsmith-plugins": "^0.1.1",
1818
"lodash": "^3.10.1",
19+
"markdown-it-anchor": "^2.5.0",
20+
"markdown-it-footnote": "^2.0.0",
1921
"metalsmith": "git+https://github.com/stellar/metalsmith.git",
2022
"metalsmith-autoprefixer": "^1.1.0",
2123
"metalsmith-concat": "^3.0.3",
2224
"metalsmith-fingerprint": "^1.0.3",
2325
"metalsmith-in-place": "^1.3.1",
2426
"metalsmith-layouts": "^1.4.1",
25-
"metalsmith-markdown": "^0.2.1",
27+
"metalsmith-markdownit": "^0.3.0",
2628
"metalsmith-metadata": "0.0.1",
2729
"metalsmith-sass": "^1.3.0",
2830
"minimatch": "^2.0.10",

partials/footer.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<a class="siteFooter__list__item" href="https://www.stellar.org/"><span class="graphic-backArrow-9"></span>&nbsp;&nbsp;Stellar.org</a>
66
<span class="siteFooter__list__sep">|</span>
77
<a class="siteFooter__list__item" href="{{pathPrefix}}/">Developers</a>
8-
<a class="siteFooter__list__item" href="{{pathPrefix}}/stellar-core/learn/admin.html">Run a node</a>
9-
<a class="siteFooter__list__item" href="https://github.com/stellar/docs/blob/master/other/things-to-build.md">Build an app</a>
8+
<a class="siteFooter__list__item" href="{{pathPrefix}}/stellar-core/software/admin.html">Run a node</a>
9+
<a class="siteFooter__list__item" href="{{pathPrefix}}/guides/things-to-build.html">Build an app</a>
1010
<a class="siteFooter__list__item" href="https://github.com/stellar/">GitHub</a>
1111
<a class="siteFooter__list__item" href="http://slack.stellar.org/">Community chat</a>
1212
</div>

partials/guides/sidebar.handlebars

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div class="siteSidebar pageNavListBounder">
2+
<div class="mainSidebar">
3+
<ul class="pageNavList">
4+
{{#sidebarSubMenu "Get Started" numbered="true" }}
5+
{{>sidebarSubItems glob="guides/get-started/index.html"}}
6+
{{>sidebarSubItems glob="guides/get-started/!(index).html"}}
7+
{{/sidebarSubMenu}}
8+
9+
{{>sidebarSubMenu title="Concepts" glob="guides/concepts/*.html"}}
10+
11+
{{>sidebarSubItems glob="guides/anchor.html"}}
12+
{{>sidebarSubItems glob="guides/exchange.html"}}
13+
{{>sidebarSubItems glob="guides/!(index|contributing|anchor|exchange).html"}}
14+
{{>sidebarSubItems glob="guides/contributing.html"}}
15+
</ul>
16+
</div>
17+
</div>

partials/header-centered.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<div class="so-back">
1+
<div class="so-back header2016Back">
22
<div class="so-chunk">
3-
<div class="header2016">
3+
<div class="header2016 header2016--centered">
44
<div class="header2016__logo">
55
<div class="so-siteHeader">
66
{{> siteLogo }}

partials/learn/sidebar.handlebars

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

partials/mainNavMenu.handlebars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{> mainNavMenu/item href="/learn/" text="Learn" sectionFilter="learn"}}
2-
{{> mainNavMenu/item href="/reference/" text="Reference" sectionFilter="reference"}}
1+
{{> mainNavMenu/item href="/guides/" text="Guides" sectionFilter="guides"}}
2+
{{> mainNavMenu/item href="/reference/" text="API Reference" sectionFilter="reference"}}
3+
{{> mainNavMenu/item href="/software/" text="Software" sectionFilter="software"}}
34
{{> mainNavMenu/item href="/tools/" text="Tools" sectionFilter="tools"}}
4-
{{> mainNavMenu/item href="/beyond-code/" text="Beyond Code" sectionFilter="beyond-code"}}

partials/modules/dev-newsletter.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<span class="mailSignup__title">Get developer updates:</span>
33
<input type="email" value="" name="EMAIL" class="mailSignup__input" style="border-radius: 3px; " placeholder="email address" required="">
44
<div style="position: absolute; left: -5000px;"><input type="text" name="b_c001d97369b7a10d224c23867_c77c979e43" tabindex="-1" value=""></div>
5-
<input type="submit" value="Sign up" name="subscribe" class="s-button mailSignup__submit">
5+
<input type="submit" value="Sign up" name="subscribe" class="s-button mailSignup__submit spu-textUppercase">
66
</form>

partials/modules/friendbot4.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<br>
7070
<span class="js-friendbot4-step4-seed"></span>
7171
</p>
72-
<p class="friendbot4-stepOutro">Explore more of the <a href="{{pathPrefix}}/learn/" target="_blank">Stellar ecosystem</a>.</p>
72+
<p class="friendbot4-stepOutro">Explore more of the <a href="{{pathPrefix}}/guides/" target="_blank">Stellar ecosystem</a>.</p>
7373
</div>
7474
<div class="friendbot4-initialHide js-friendbot4__navWrapper">
7575
<nav class="friendbot4__nav">

partials/reference/sidebar.handlebars

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22
<div class="mainSidebar">
33
<ul class="pageNavList">
44

5-
{{>sidebarSubItems glob="horizon/reference/*.html"}}
5+
{{#sidebarSubMenu "REST API" collapsible=true}}
6+
{{>sidebarSubItems glob="horizon/reference/index.html"}}
7+
{{>sidebarSubItems glob="horizon/reference/!(index).html"}}
8+
{{>sidebarSubMenu title="Tutorials" glob="horizon/reference/tutorials/*.html"}}
9+
{{>sidebarSubMenu title="Endpoints" glob="horizon/reference/endpoints/*.html"}}
10+
{{>sidebarSubMenu title="Resources" glob="horizon/reference/resources/*.html"}}
11+
{{>sidebarSubMenu title="Errors" glob="horizon/reference/errors/*.html"}}
12+
{{/sidebarSubMenu}}
613

7-
{{>sidebarSubMenu title="Resources" glob="horizon/reference/resources/*.html"}}
8-
{{>sidebarSubMenu title="Errors" glob="horizon/reference/errors/*.html"}}
14+
{{#sidebarSubMenu "JavaScript SDK" collapsible=true}}
15+
{{>sidebarSubItems glob="js-stellar-sdk/reference/index.html"}}
16+
{{>sidebarSubItems glob="js-stellar-base/reference/*.html"}}
17+
{{>sidebarSubItems glob="js-stellar-sdk/reference/!(index).html"}}
18+
<li class="pageNavList__item"><a href="https://stellar.github.io/js-stellar-sdk/" target="_blank">API Reference <span class="icon-faSvg icon-faSvg--small icon-faSvg-external-neutral5"></span></a></a></li>
19+
{{/sidebarSubMenu}}
20+
21+
{{! FIXME: these should be info pages rather than raw links to Github }}
22+
{{! e.g. >sidebarSubItems glob="java-stellar-sdk/guides/index.html"}}
23+
<li class="pageNavList__item"><a href="https://github.com/stellar/java-stellar-sdk" target="_blank">Java SDK <span class="icon-faSvg icon-faSvg--small icon-faSvg-external-neutral5"></span></a></a></li>
24+
<li class="pageNavList__item"><a href="https://github.com/stellar/go-stellar-base" target="_blank">Go SDK <span class="icon-faSvg icon-faSvg--small icon-faSvg-external-neutral5"></span></a></a></li>
25+
<li class="pageNavList__item"><a href="https://github.com/stellar/ruby-stellar-sdk" target="_blank">Ruby SDK <span class="icon-faSvg icon-faSvg--small icon-faSvg-external-neutral5"></span></a></a></li>
26+
<li class="pageNavList__item"><a href="https://github.com/StellarCN/py-stellar-base" target="_blank">Python SDK <span class="icon-faSvg icon-faSvg--small icon-faSvg-external-neutral5"></span></a></a></li>
27+
<li class="pageNavList__item"><a href="https://github.com/QuantozTechnology/csharp-stellar-base" target="_blank">C# SDK <span class="icon-faSvg icon-faSvg--small icon-faSvg-external-neutral5"></span></a></a></li>
928

1029
</ul>
1130
</div>

partials/sidebarSubMenu.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{{#sidebarSubMenu title}}
1+
{{#sidebarSubMenu title collapsible=collapsible}}
22
{{>sidebarSubItems glob=glob}}
33
{{/sidebarSubMenu}}

partials/software/sidebar.handlebars

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="siteSidebar pageNavListBounder">
2+
<div class="mainSidebar">
3+
<ul class="pageNavList">
4+
{{#sidebarSubMenu "Stellar Core"}}
5+
{{>sidebarSubItems glob="stellar-core/software/*.html"}}
6+
{{>sidebarSubItems glob="stellar-core/software/*.pdf"}}
7+
{{/sidebarSubMenu}}
8+
9+
<li class="pageNavList__item"><a href="https://github.com/stellar/federation">Federation Server</a></li>
10+
<li class="pageNavList__item"><a href="https://github.com/stellar/bridge-server">Bridge Server</a></li>
11+
<li class="pageNavList__item"><a href="https://github.com/stellar/archivist">Archivist</a></li>
12+
<li class="pageNavList__item"><a href="https://github.com/stellar/horizon">Horizon</a></li>
13+
</ul>
14+
</div>
15+
</div>

partials/tools/sidebar.handlebars

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<div class="siteSidebar pageNavListBounder">
22
<div class="mainSidebar">
33
<ul class="pageNavList">
4-
<li class="pageNavList__item"><a href="https://www.stellar.org/laboratory/">Laboratory</a></li>
5-
<li class="pageNavList__item"><a href="https://www.stellar.org/account-viewer/">Account Viewer</a></li>
4+
{{#sidebarSubMenu "Tools" collapsible=false}}
5+
<li class="pageNavList__item"><a href="https://www.stellar.org/laboratory/">Laboratory</a></li>
6+
{{/sidebarSubMenu}}
7+
{{#sidebarSubMenu "Sample Code" collapsible=false}}
8+
<li class="pageNavList__item"><a href="https://github.com/stellar/account-viewer">Account Viewer</a></li>
9+
<li class="pageNavList__item"><a href="https://github.com/stellar/stellar-sms-client">SMS Client</a></li>
10+
{{/sidebarSubMenu}}
611
</ul>
712
</div>
813
</div>

src/guides

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../repos/docs/guides

src/images/previews/landing-2.png

26.1 KB
Loading

0 commit comments

Comments
 (0)