Skip to content

Commit

Permalink
✨ Support for footer navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Oct 27, 2019
1 parent db0573e commit 644aa43
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ You can create a `.staartrc` file or another [Cosmiconfig](https://github.com/da
| `linkColor` | Hyperlink color | `#0e632c` |
| `lightColor` | Light text color | `#ffffff` |
| `navbar` | Array of filenames for navbar | Root files/folders in `contentDir` |
| `footerNavbar` | Array of filenames for footer | `[]` |
| `contentFileExt` | File extension for content files | `md` |
| `keepHomeHeading` | Show `h1` heading on homepage | `false` |
| `ignoreReplaceTitle` | Don't update `<title>` from `title` | `false` |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staart/site",
"version": "1.1.7",
"version": "1.1.8",
"module": "dist/module.js",
"main": "dist/index.js",
"bin": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const getData = async () => {
config.data.githubUrl = `[open source](https://${config._gitRepo.resource}/${config._gitRepo.full_name})`;
config.data.rootFiles = await getNavbar();
config.data.navBar = await getNavbar(config.navbar);
config.data.footerNavBar = await getNavbar(config.footerNavbar);
if (!config.ignoreReplaceTitle)
config.data.title = await getSiteMeta("title", "name");
if (!config.ignoreReplaceDescription)
Expand Down
13 changes: 6 additions & 7 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ <h1>{{ title }}</h1>
</header>
<main id="content">{{{ content }}}</main>
<footer>
<div>
<span>&copy; {{ year }}{{#if author}} {{{ author }}}{{/if}}</span>
<span><a href="/sitemap.html">Sitemap</a></span>
{{#if agastyaApiKey}}<span><button onclick="window.agastya.open()">Accessibility</button></span>{{/if}}
<span>This site is
{{#if githubUrl}}{{{ githubUrl }}}, {{/if}} built with <a href="https://staart.js.org/site" target="_blank" rel="noopener">Staart Site</a></span>
</div>
<span>&copy; {{ year }}{{#if author}} {{{ author }}}{{/if}}</span>
<span><a href="/sitemap.html">Sitemap</a></span>
{{#if agastyaApiKey}}<span><button onclick="window.agastya.open()">Accessibility</button></span>{{/if}}
{{{ footerNavBar }}}
<span>This site is
{{#if githubUrl}}{{{ githubUrl }}}, {{/if}} built with <a href="https://staart.js.org/site" target="_blank" rel="noopener">Staart Site</a></span>
</footer>
{{#if agastyaApiKey}}<script src="https://platform-beta.oswaldlabs.com/v1/agastya/load/{{agastyaApiKey}}"></script>
<script>
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface StaartSiteConfig {
homePath?: string;
hostname?: string;
navbar?: string[];
footerNavbar?: string[];
contentFileExt?: string[];
keepHomeHeading?: boolean;
ignoreReplaceTitle?: boolean;
Expand Down
16 changes: 15 additions & 1 deletion src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ a {
}

header a + a,
footer span + span {
footer span + span,
footer ul + span {
margin-left: 1.5rem;
}

Expand All @@ -177,7 +178,9 @@ h3 {
}

footer {
text-align: center;
margin-bottom: 5vh;
line-height: 2.5;
a {
color: inherit;
}
Expand All @@ -192,6 +195,17 @@ footer {
padding: 0;
color: inherit;
}
ul {
list-style: none;
margin: 0;
padding: 0;
display: inline;
li {
display: inline-block;
padding: 0;
margin: 0 0 0 1.5rem;
}
}
}

blockquote {
Expand Down

0 comments on commit 644aa43

Please sign in to comment.