aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-docs/src/layouts/components/SubpageLink.js
diff options
context:
space:
mode:
authorPascal Mugnier <pascal.mugnier@sonarsource.com>2018-09-10 11:32:33 +0200
committersonartech <sonartech@sonarsource.com>2018-09-19 10:50:57 +0200
commit55822b5c264747a28161902119482ef7f000ab66 (patch)
treea5a984280429502ffe41219b21502bece97727b1 /server/sonar-docs/src/layouts/components/SubpageLink.js
parent80418249fe5b1f8cf3ee10f4f80d538351fd106c (diff)
downloadsonarqube-55822b5c264747a28161902119482ef7f000ab66.tar.gz
sonarqube-55822b5c264747a28161902119482ef7f000ab66.zip
MMF-1377 Finalize the static documentation site (#673)
Diffstat (limited to 'server/sonar-docs/src/layouts/components/SubpageLink.js')
-rw-r--r--server/sonar-docs/src/layouts/components/SubpageLink.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/server/sonar-docs/src/layouts/components/SubpageLink.js b/server/sonar-docs/src/layouts/components/SubpageLink.js
new file mode 100644
index 00000000000..1d4746fb73f
--- /dev/null
+++ b/server/sonar-docs/src/layouts/components/SubpageLink.js
@@ -0,0 +1,35 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import Link from 'gatsby-link';
+import HeadingsLink from './HeadingsLink';
+
+export default function SubpageLink({ node, headers, displayHeading }) {
+ return (
+ <div>
+ <h3>
+ <Link className={displayHeading ? 'active' : ''} to={node.fields.slug}>
+ {node.frontmatter.title}
+ </Link>
+ </h3>
+ {displayHeading && <HeadingsLink headers={headers} />}
+ </div>
+ );
+}