Giter Club home page Giter Club logo

Comments (5)

deviantintegral avatar deviantintegral commented on May 27, 2024

At a basic level, setting trailingSlash: true, fixes the issue for me. As noted in the stack overflow threads, it does mean ADRs are rendered as directories, such as http://localhost/adr/0001-record-architecture-decisions/. However, that could actually be a good thing if we get inline images working, because then those assets could be included in the ADR path.

from log4brains.

fire avatar fire commented on May 27, 2024

How do you enable that?

@deviantintegral

from log4brains.

deviantintegral avatar deviantintegral commented on May 27, 2024

You can set it in next.config.js: https://nextjs.org/docs/api-reference/next.config.js/trailing-slash

from log4brains.

llwt avatar llwt commented on May 27, 2024

For anyone coming to this issue looking to apply this fix, you can use patch-package while we wait for this change to be merged:

The autogenerated output from patch-package is below :)


Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @log4brains/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@log4brains/web/dist/next.config.js b/node_modules/@log4brains/web/dist/next.config.js
index a5dd2e9..4d14fab 100644
--- a/node_modules/@log4brains/web/dist/next.config.js
+++ b/node_modules/@log4brains/web/dist/next.config.js
@@ -13,6 +13,16 @@ module.exports = withBundleAnalyzer({
   reactStrictMode: true,
   target: "serverless",
   poweredByHeader: false,
+  /**
+   * This patch is to ensure that next outputs page/index.html instead of page.html
+   * Without this, links to pages other than the index file will not work on s3
+   * 
+   * without:
+   *   .log4brains/out/adr/2022022-document-frontend-infra-decisions.html
+   * with:
+   *   .log4brains/out/adr/2022022-document-frontend-infra-decisions/index.html
+   */
+  trailingSlash: true,
   serverRuntimeConfig: {
     PROJECT_ROOT: __dirname, // https://github.com/vercel/next.js/issues/8251
     VERSION: process.env.HIDE_LOG4BRAINS_VERSION ? "" : packageJson.version

This issue body was partially generated by patch-package.

from log4brains.

thomvaill avatar thomvaill commented on May 27, 2024

LGTM. Thank you all

from log4brains.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.