Skip to content

Commit

Permalink
Issue #104: Routes without trailing slash lead to 404 (#119)
Browse files Browse the repository at this point in the history
* Issue #104: Routes without trailing slash lead to 404

Signed-off-by: macdonst <[email protected]>
Co-authored-by: Taylor Beseda <[email protected]>
  • Loading branch information
macdonst and tbeseda committed Dec 13, 2022
1 parent a69438a commit d33c68e
Show file tree
Hide file tree
Showing 4 changed files with 1,778 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/api/docs/$$.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable filenames/match-regex */
import { readFileSync } from 'fs'
import { existsSync, readFileSync } from 'fs'
import { URL } from 'url'
import { Arcdown } from 'arcdown'
import arcStaticImg from 'markdown-it-arc-static-img'
Expand Down Expand Up @@ -34,7 +34,16 @@ export async function get(request) {
const gacode =
process.env.ARC_ENV === 'production' ? 'G-FQHNPN78V3' : 'G-0ES194BJQ6'

const docURL = new URL(`../../docs/md/${docPath}.md`, import.meta.url)
let docURL = new URL(`../../docs/md/${docPath}.md`, import.meta.url)
if (!existsSync(docURL.pathname)) {
docURL = new URL(`../../docs/md/${docPath}/index.md`, import.meta.url)
if (existsSync(docURL.pathname)) {
return {
status: 302,
location: `${activePath}/`,
}
}
}

const sidebarData = navDataLoader('docs', activePath)

Expand Down
1 change: 1 addition & 0 deletions src/shared/enhance-styles
59 changes: 59 additions & 0 deletions tmp/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"base": 16,
"scale": {
"ratio": "majorThird",
"steps": 10
},
"fonts": {
"sans": "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
"mono": "Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
"roboto": "'Roboto Mono', monospace",
"rubik": "'Rubik', sans-serif"
},
"grid": {
"steps": 6
},
"color": {
"white": "#FFFFFF",
"black": "#000000",
"light": "#EFEFEF",
"dark": "#222222",
"ateneo": "#113A62",
"blue": "#1F74D6",
"cloud": "#F7F0FE",
"dark-purple": "#7327CE",
"denim": "#003451",
"green": "#2CDD93",
"halite": "#00293F",
"indigo": "#004163",
"inky": "#4D7185",
"lily": "#E5EBEE",
"magenta": "#E21893",
"orange": "#FF6263",
"princess": "#F57AFF",
"purple": "#AD6EF9",
"rift": "#01040D",
"smoke": "#F3F3F3"
},
"properties": [
{
"bg-gradient": "linear-gradient(125deg, var(--orange), var(--magenta), var(--purple))"
}
],
"queries": {
"lg": "48em",
"xl": "72em"
},
"radius": [
2,
4,
6
],
"borders": {
"widths": [
1,
2,
3
]
}
}
Loading

0 comments on commit d33c68e

Please sign in to comment.