diff --git a/.gitignore b/.gitignore index c09fad56..e5f1f23a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,11 +15,8 @@ .env.test.local .env.production.local .eslintcache +.idea npm-debug.log* yarn-debug.log* yarn-error.log* - -/opentofu-repo -/docs/** -!/docs/index.mdx diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..9b37bc56 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "opentofu-repo"] + path = opentofu-repo + url = https://github.com/opentofu/opentofu + branch = main \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 46e32500..00000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# Variables -REPO_URL := https://github.com/opentofu/opentofu.git -CLONE_DIR := ./opentofu-repo -DEST_DIR := . -SOURCE_DIR := website -BRANCH := main - -# Default target to execute when 'make' is called without arguments -all: clean clone copy - -clean : - rm -rf $(CLONE_DIR) - -# Clone the repo -clone: clean - git clone --depth 1 -b $(BRANCH) $(REPO_URL) $(CLONE_DIR); \ - -# Ensure the destination directory exists -prepare-dest: - mkdir -p $(DEST_DIR)/docs - -# Copy the entire folder -copy: clone prepare-dest - cp -v -r $(CLONE_DIR)/$(SOURCE_DIR)/docs/. $(DEST_DIR)/docs/ - -.PHONY: all clone copy prepare-dest diff --git a/README.md b/README.md index dba235d0..4bd75c55 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ npm i 3. Fetch the documentation ```bash -make +git submodule init +git submodule update ``` 4. Start the development server diff --git a/docusaurus.config.js b/docusaurus.config.js index eb2fb250..e32a9df2 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -100,12 +100,13 @@ const config = { }, docs: { sidebarPath: require.resolve("./sidebars.js"), + path: "opentofu-repo/website/docs", routeBasePath: "/docs", editUrl: ({ docPath }) => { // Remove the edit link from the documentation index page // TODO: remove after moving the page to the main OpenTofu repo if (docPath === "index.mdx") { - return undefined; + return `https://github.com/opentofu/opentofu.org/edit/main/docs/${docPath}`; } return `https://github.com/opentofu/opentofu/edit/main/website/docs/${docPath}`; diff --git a/opentofu-repo b/opentofu-repo new file mode 160000 index 00000000..ad463efd --- /dev/null +++ b/opentofu-repo @@ -0,0 +1 @@ +Subproject commit ad463efd25d0e1a1974399192aba511330502a03