Is there a way to use Docusaurus just for the /docs directory? - docusaurus

I have an existing website, and just want to use docusaurus to manage the /docs directory (e.g. published as a static site into there). When I follow all the documentation it creates both the docs directory and separate website directory, how can I just have it render /docs when testing locally and only publish that sub-directory when doing a build of the static site?

found the answer in the docs 🤣
https://v2.docusaurus.io/docs/docs-introduction#docs-only-mode

Related

making it so docusaurus uploads to subdirectory instead of web root

From node_modules\docusaurus\lib\publish-gh-pages.js:
const websiteURL =
GITHUB_HOST === GITHUB_DOMAIN
? `https://${ORGANIZATION_NAME}.github.io/${PROJECT_NAME}` // gh-pages hosted repo
: `https://${GITHUB_HOST}/pages/${ORGANIZATION_NAME}/${PROJECT_NAME}`; // GitHub enterprise hosting.
My question is... why is the documentation being uploaded to a subdirectory? What if I wanted it uploaded to the root directory? How might I do that?
The front page of a docusaurus v1 website is more of a splash page with sections like "feature callouts", etc. Overall, it seems best suited to be a root page as it appears to be for https://hermesengine.dev/ , https://hydra.cc/ and pretty much every other facebook open source project.
Also, the HTML that docusaurus generates has <link rel="stylesheet" href="/css/main.css"/> in it, which works great when you're building your site with npm run start (which results in the files living in web root), but not so much when using publish-gh-pages.js since main.css then lives at /${PROJECT_NAME}/css/main.css.
So how can I do the same - make it so my docusaurus built website gets uploaded to web root instead of a subdirectory?
The repo was that the repo wasn't named project_name.github.io - it was named docs. That this would result in docusaurus doing the build process is evident from the build script BUT apparently github.com itself will default to a subdirectory for github.io unless your repo name is project_name.github.io. This can be seen by scrolling to the bottom of the page that Settings brings up.

Why am I getting resource 404s on static nuxt.js app hosted on GitHub pages?

I have followed these steps:
Made a vue project with Nuxt.js (tested and working with npm run dev)
Used Nuxt.js static site generation to generate a static distribution under the dist directory of my master repository (also tested using VSCode's Live server plugin, works fine).
Deployed the dist directory to the gh-pages branch using: gh-pages -d dist
In the Options for my GitHub project, which is the GitHub Page for my user (augusto-moura.github.io/), I changed the Source to gh-pages.
The gh-pages branch seems to hold exactly what it's supposed to, but as I open the page, the scripts aren't loaded and each return a 404 eror.
What am I doing wrong? GitHub seems to not be serving the JS files inside the _nuxt directory.
you need to add .nojekyll file at root dir when publishing to GitHub Pages, otherwise it won't get resource files from _nuxt dir.
As indicated in the How to deploy on GitHub Pages? guide, in this tiny, easy-to-miss note...
Branch gh-pages for project repository OR branch master for user or organization site
In order to use Pages for your user account, you need
push-dir --dir=dist --branch=master

Cloud Run doesn’t work with Express static middleware

I have an express container that serves static files and it works perfectly when built and deployed locally. However, when I build and deploy it to Cloud Run, the dynamic html is returned but static assets like css files are 404. Are there any known limitations with Cloud Runthat May be contributing to this difficult-to-diagnose issue?
Searching the problem, I found this issue and realize the correct answer is masked because it's in the last comment on SO.
Google cloud use a file called .gcloudignore to not ignore some files while uploading.
If the file does not exist, .git and .gitignore files are used, and typically some assets will be in your .gitignore.
https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore

Deploy a vue cli site to s3

I am trying to deploy a static website to an s3 bucket. I built my site using the webpack template from vue-cli
When I build the site there is a note that:
Tip: built files are meant to be served over an HTTP server.
Opening index.html over file:// won't work.
Indeed there are no script tags in index.html but there is a comment that:
<!-- built files will be auto injected -->
If I add a path to the JS build file build/build.js I get that error that require cannot be found.
Is there a way to serve this site via s3? If so, how? Thank you

How to route to generated Ex_Docs in Phoenix Framework

I used the ex_docs package to automatically generate documentation regarding my project modules in a Phoenix Framework project.
Then with mix docs I successfully created the doc folder at the root of the project.
However the contained files are full-fledged html files instead of templates.
How can I route to these files with the Router?
The documentation is generated as static HTML files. You can serve static files with phoenix from the priv/static directory, copy your files from doc/ to the static directory.
You can find the configuration for the static file in your endpoint.ex file, see plug for documentation: http://hexdocs.pm/plug/Plug.Static.html.