Skip to content

Commit

Permalink
Implement optional page tree, and support for fixed positioning of pa…
Browse files Browse the repository at this point in the history
…ge tree (so that Bedrock doesn't mess with any overall positioning logic)
  • Loading branch information
Wolfr committed Jun 22, 2021
1 parent 5e7e2e5 commit 06c206b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 20 deletions.
48 changes: 32 additions & 16 deletions bedrock.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
*/

module.exports = {
/**
* Page tree generation: existence of this section
* determines whether the page tree gets generated
*/
pageTree: {
layoutStyle: 'sidebar' // 'sidebar' or 'fixed'
},
/**
* CSS and JS minification
* Adjust these values to set up your project for production or dev
*/
js: {
minify: false
},
Expand All @@ -13,39 +24,44 @@ module.exports = {
minify: false,
purge: false
},
/**
* Styleguide generation: existence of this section
* determines whether the styleguide gets generated
*/
styleguide: {
/**
* search [boolean]
* Feature flag for search feature
*/
search: true,
colors: './content/scss/_colors.scss',
/**
* categoryOrder
* Determines the order of documentation categories
*/
categoryOrder: [
'Style guide',
'Design patterns',
'Components'
],
/**
* componentCategories
* The prefix on folder names in /components determines the category
*/
componentCategories: {
aov: 'Overviews',
c: 'Components',
}
},
/**
* Icon
* Set up whether Bedrock should generate icon fonts
* Set up CSS classnames for SVG icons and icon font
*/
icons: {
generateIconFont: false,
iconFontPath: "./content/scss/_icon-font.scss",
svgIconClassPrefix: 'o-svg-icon',
iconFontClassPrefix: 'if'
},
pug: {
pretty: true,
basedir: "./content"
},
prettify: {
indentWithTabs: true,
preserveNewlines: true,
inline: '',
logSuccess: false,
indentSize: 2,
unformatted: ['pre', 'textarea'],
extraLiners: ['body']
},
express: {
port: 8000,
},
};
14 changes: 10 additions & 4 deletions content/templates/_layouts/master.pug
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ html(dir="ltr" lang="en" class=htmlClass ? htmlClass : '')
body(class=bodyClass ? bodyClass : '')

.br-prototype-wrapper
include ../../../core/templates/includes/prototype-nav
.br-prototype-content
block body
if config.pageTree && config.pageTree.layoutStyle == 'sidebar'
.br-prototype-wrapper
include ../../../core/templates/includes/prototype-nav
.br-prototype-content
block body
else
block body
if config.pageTree && config.pageTree.layoutStyle == 'fixed'
.br-pagetree-fixed-wrapper
include ../../../core/templates/includes/prototype-nav

= "\n"
script(src='/js/bundle-prototype.js')
Expand Down
3 changes: 3 additions & 0 deletions core/discovery/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const DEFAULT_CONFIG = {
pageTree: {
layoutStyle: 'sidebar'
},
js: {
minify: false
},
Expand Down
11 changes: 11 additions & 0 deletions core/scss/prototype.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ $br-styleguide-content-padding-left: 4.8rem*$br-rem-multiplier !default;

@import "../../content/scss/br-variables-override";


/* Fixed layout
========================================================================== */

.br-pagetree-fixed-wrapper {
position: fixed;
right: 0;
bottom: 0;
height: 100vh;
}

/* Basic setup
========================================================================== */

Expand Down

0 comments on commit 06c206b

Please sign in to comment.