chore: Fixed linter issues
This commit is contained in:
parent
4b037111be
commit
8edf9cff94
8 changed files with 10 additions and 19 deletions
|
@ -15,7 +15,7 @@ import {
|
||||||
BaseLayoutRight,
|
BaseLayoutRight,
|
||||||
} from 'shared/components/base-layout.mjs'
|
} from 'shared/components/base-layout.mjs'
|
||||||
|
|
||||||
const ContactPage = ({ page, slug }) => {
|
const ContactPage = ({ page }) => {
|
||||||
const title = 'About FreeSewing'
|
const title = 'About FreeSewing'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -180,7 +180,6 @@ export async function getStaticProps() {
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
...(await serverSideTranslations('en')),
|
...(await serverSideTranslations('en')),
|
||||||
slug: 'about',
|
|
||||||
page: {
|
page: {
|
||||||
path: ['about'],
|
path: ['about'],
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
|
|
||||||
const namespaces = [...pageNs]
|
const namespaces = [...pageNs]
|
||||||
|
|
||||||
const SearchPage = ({ page, slug }) => {
|
const SearchPage = ({ page }) => {
|
||||||
const title = 'Search'
|
const title = 'Search'
|
||||||
|
|
||||||
const tip = (
|
const tip = (
|
||||||
|
@ -51,7 +51,6 @@ export async function getStaticProps() {
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
...(await serverSideTranslations('en', namespaces)),
|
...(await serverSideTranslations('en', namespaces)),
|
||||||
slug: 'search',
|
|
||||||
page: {
|
page: {
|
||||||
path: ['search'],
|
path: ['search'],
|
||||||
},
|
},
|
||||||
|
|
|
@ -69,13 +69,7 @@ const RenderTree = ({ tree, recurse, depth = 1, level = 0 }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ReadMore = ({
|
export const ReadMore = ({ recurse = 0, root = false, site = 'org', depth = 99 }) => {
|
||||||
recurse = 0,
|
|
||||||
root = false,
|
|
||||||
site = 'org',
|
|
||||||
depth = 99,
|
|
||||||
ignoreControl,
|
|
||||||
}) => {
|
|
||||||
const { siteNav, slug } = useContext(NavigationContext)
|
const { siteNav, slug } = useContext(NavigationContext)
|
||||||
|
|
||||||
// Deal with recurse not being a number
|
// Deal with recurse not being a number
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
export const ns = ['designs', 'tags']
|
export const ns = ['designs', 'tags']
|
||||||
|
|
||||||
export const Set = ({ name }) => {
|
export const Set = ({}) => {
|
||||||
//const { t } = useTranslation(ns)
|
//const { t } = useTranslation(ns)
|
||||||
|
|
||||||
return <p>fixme</p>
|
return <p>fixme</p>
|
||||||
|
|
|
@ -35,7 +35,7 @@ export const NavigationContextProvider = ({ children }) => {
|
||||||
* @param value {value} to set
|
* @param value {value} to set
|
||||||
*/
|
*/
|
||||||
function updateSiteNav(path, value) {
|
function updateSiteNav(path, value) {
|
||||||
setSiteNav(objUpdate(__siteNav.siteNav, path, value))
|
setSiteNav(objUpdate(siteNav[locale], path, value))
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -49,7 +49,7 @@ export const NavigationContextProvider = ({ children }) => {
|
||||||
* We'll do this later. Not even certain it's needed as we may just not place
|
* We'll do this later. Not even certain it's needed as we may just not place
|
||||||
* previous/next links on user-generated content.
|
* previous/next links on user-generated content.
|
||||||
*/
|
*/
|
||||||
function updateSlugLut(path, value) {
|
function updateSlugLut() {
|
||||||
// FIXME: Is this even needed?
|
// FIXME: Is this even needed?
|
||||||
console.log('updateSlugLut is not implemented (yet)')
|
console.log('updateSlugLut is not implemented (yet)')
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ export const NavigationContextProvider = ({ children }) => {
|
||||||
* so that updating it will trigger a re-render and the propagated value will update.
|
* so that updating it will trigger a re-render and the propagated value will update.
|
||||||
*/
|
*/
|
||||||
const [siteNav, setSiteNav] = useState(defaultSiteNav)
|
const [siteNav, setSiteNav] = useState(defaultSiteNav)
|
||||||
const [slugLut, setSlugLut] = useState(defaultSlugLut)
|
const [slugLut] = useState(defaultSlugLut)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pass everything down as the value object, including the methods to update
|
* Pass everything down as the value object, including the methods to update
|
||||||
|
|
|
@ -84,7 +84,7 @@ const getMdxFileList = async (cwd) => {
|
||||||
const cmd = `find ${cwd} -type f -name "en.md"`
|
const cmd = `find ${cwd} -type f -name "en.md"`
|
||||||
const find = exec(cmd, { cwd }, (error, stdout, stderr) => {
|
const find = exec(cmd, { cwd }, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`exec error: ${error}`)
|
console.error(`exec error: ${error} - ${stderr}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ const loadFolderFrontmatter = async (key, site, folder, transform = false, lang
|
||||||
* Figure out what directory to spawn the child process in
|
* Figure out what directory to spawn the child process in
|
||||||
*/
|
*/
|
||||||
const cwd = await path.resolve(process.cwd(), '..', '..', 'markdown', site, folder)
|
const cwd = await path.resolve(process.cwd(), '..', '..', 'markdown', site, folder)
|
||||||
let list = false
|
|
||||||
/*
|
/*
|
||||||
* When going through a small number of files in a flat directory (eg. blog posts) a
|
* When going through a small number of files in a flat directory (eg. blog posts) a
|
||||||
* recursive grep through all files is faster.
|
* recursive grep through all files is faster.
|
||||||
|
@ -44,7 +43,7 @@ const loadFolderFrontmatter = async (key, site, folder, transform = false, lang
|
||||||
}.md" -exec grep "^${key}:" -ism 1 {} +`
|
}.md" -exec grep "^${key}:" -ism 1 {} +`
|
||||||
const grep = exec(cmd, { cwd }, (error, stdout, stderr) => {
|
const grep = exec(cmd, { cwd }, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`exec error: ${error}`)
|
console.error(`exec error: ${error} - ${stderr}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Note: Set 'n' to mark this as a noisy entry that should always be closed unless active (like blog)
|
* Note: Set 'n' to mark this as a noisy entry that should always be closed unless active (like blog)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const extendSiteNav = (pages, lang) => {
|
export const extendSiteNav = (pages) => {
|
||||||
pages.about = {
|
pages.about = {
|
||||||
s: 'about',
|
s: 'about',
|
||||||
t: 'About FreeSewing',
|
t: 'About FreeSewing',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue