Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/sidebar/SidebarProduct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const SidebarProduct = () => {
const isStandaloneCategory = childPage.page.documentType === 'article'

const childTitle = childPage.renderedShortTitle || childPage.renderedFullTitle

const isActive = routePath.includes(childPage.href) || routePath === childPage.href
const isActive =
routePath.includes(childPage.href + '/') || routePath === childPage.href
const defaultOpen = hasExactCategory ? isActive : false
return (
<li
Expand Down
12 changes: 8 additions & 4 deletions middleware/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import express from 'express'
import basicAuth from 'express-basic-auth'
import instrument from '../lib/instrument-middleware.js'
import haltOnDroppedConnection from './halt-on-dropped-connection.js'
import abort from './abort.js'
Expand Down Expand Up @@ -61,6 +62,7 @@ import renderPage from './render-page.js'
const { NODE_ENV } = process.env
const isDevelopment = NODE_ENV === 'development'
const isTest = NODE_ENV === 'test' || process.env.GITHUB_ACTIONS === 'true'
const isProduction = NODE_ENV === 'production' && process.env.HEROKU_PRODUCTION_APP

// Catch unhandled promise rejections and passing them to Express's error handler
// https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016
Expand Down Expand Up @@ -143,16 +145,18 @@ export default function (app) {
instrument(archivedEnterpriseVersionsAssets, './archived-enterprise-versions-assets')
)
)
app.use(
'/storybook',
app.use('/storybook', [
(isProduction &&
basicAuth({ users: { octocat: process.env.STORYBOOK_PASSWORD }, challenge: true })) ||
((req, res, next) => next()),
express.static('storybook', {
index: false,
etag: false,
immutable: true,
lastModified: false,
maxAge: '1 day', // Relatively short in case we update index.html
})
)
}),
])
app.use(
'/assets',
express.static('assets', {
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"dayjs": "^1.10.6",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"express-basic-auth": "^1.2.0",
"express-rate-limit": "^5.3.0",
"express-timeout-handler": "^2.2.2",
"flat": "^5.0.2",
Expand Down