diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3a6dd82 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,5 @@ +[submodule "content/compage"] + path = content/compage + url = https://github.com/intelops/compage-docs/ + branch = chandu + ignore = dirty \ No newline at end of file diff --git a/content/capten/_index.md b/content/capten/_index.md index d4862eb..ab4dfad 100644 --- a/content/capten/_index.md +++ b/content/capten/_index.md @@ -1,4 +1,6 @@ --- redirect_to_latest: true # Redirects the user to the latest version of this topic if they are on the root page itself. latest_version: 0.0.1 # you must specify the latest version of this topic +type : "docs-root" +draft: true --- \ No newline at end of file diff --git a/content/changelog/capten/1.0.0/_index.en.md b/content/capten/changelog/1.0.0/_index.en.md similarity index 100% rename from content/changelog/capten/1.0.0/_index.en.md rename to content/capten/changelog/1.0.0/_index.en.md diff --git a/content/changelog/capten/1.0.0/capten-project-changelog/_index.en.md b/content/capten/changelog/1.0.0/capten-project-changelog/_index.en.md similarity index 100% rename from content/changelog/capten/1.0.0/capten-project-changelog/_index.en.md rename to content/capten/changelog/1.0.0/capten-project-changelog/_index.en.md diff --git a/content/changelog/capten/_index.en.md b/content/capten/changelog/_index.en.md similarity index 95% rename from content/changelog/capten/_index.en.md rename to content/capten/changelog/_index.en.md index b4c5265..0a15115 100644 --- a/content/changelog/capten/_index.en.md +++ b/content/capten/changelog/_index.en.md @@ -5,6 +5,6 @@ description: "Capten project changelog." type : "changelog" redirect_to_latest: true # Redirects the user to the latest version of this topic if they are on the root page itself. latest_version: 1.0.0 # you must specify the latest version of this changelog -draft: false +draft: true weight: 3 --- \ No newline at end of file diff --git a/content/changelog/capten/_index.fr.md b/content/capten/changelog/_index.fr.md similarity index 100% rename from content/changelog/capten/_index.fr.md rename to content/capten/changelog/_index.fr.md diff --git a/content/changelog/_index.en.md b/content/changelog.md similarity index 76% rename from content/changelog/_index.en.md rename to content/changelog.md index b22f7b7..07191fb 100644 --- a/content/changelog/_index.en.md +++ b/content/changelog.md @@ -1,12 +1,12 @@ --- title: "Changelog" +date: 2020-05-01T00:00:00+05:30 description: "Tracking changes for the IntelOps Projects." draft: false ignoreSearch: true -layout : "changelog" --- ###### Check each project related changelog doc to know the changes committed to the project. - [Compage](compage/1.0.1/compage-project-changelog/) -- [Capten](capten/1.0.1/capten-project-changelog/) \ No newline at end of file +- [Capten](capten/1.0.1/capten-project-changelog/) diff --git a/content/changelog/compage/0.0.1/_index.en.md b/content/changelog/compage/0.0.1/_index.en.md deleted file mode 100644 index 1850114..0000000 --- a/content/changelog/compage/0.0.1/_index.en.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Compage" -date: 2023-03-31 -description: "Compage project changelog." -type : "changelog" -draft: false -weight: 1 ---- \ No newline at end of file diff --git a/content/changelog/compage/0.0.1/compage-project-changelog/_index.en.md b/content/changelog/compage/0.0.1/compage-project-changelog/_index.en.md deleted file mode 100644 index 6ee2bba..0000000 --- a/content/changelog/compage/0.0.1/compage-project-changelog/_index.en.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: "changelog" -date: 2023-03-31 -weight: 1 -draft: false ---- - - - -### February Updates - -**Feb 6, 2019** - -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt dolore magna aliquyam erat, sed diam voluptua. At vero eos et ustoLorem ipsum dolor sit amet, consetetur." - -{{< changelog "changed" >}} -* Better support for using applying additional filters to posts_tax_query for categories for custom WordPress syncs - -* Reporting fine-tuning for speed improvements (up to 60% improvement in latency) - -* Replaced login / registration pre-app screens with a cleaner design -{{}} - - -{{< changelog "removed" >}} -* Removed an issue with the sync autolinker only interlinking selectively. -* Removed up an issue with prematurely logging out users -{{}} - -
- - -### March Updates - -**Mar 6, 2019** - -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt dolore magna aliquyam erat, sed diam voluptua. At vero eos et ustoLorem ipsum dolor sit amet, consetetur." - -{{< changelog "added" >}} -* Some scheduled changelogs, tweets, and slack messages queued up this weekend and were not published on time. We fixed the issue and all delayed publications should be out. -* We now prioritize keywords over title and body so customers can more effectively influence search results -* Support form in the Assistant is now protected with reCaptcha to reduce spam reinitializeOnUrlChange added to the JavaScript API to improve support for pages with turbolinks -{{}} - - -{{< changelog "fixed" >}} -* Fixed an issue with the sync autolinker only interlinking selectively. -* Fixed up an issue with prematurely logging out users -{{}} - -
- -### Changelog label - -{{< changelog "Added" >}} -{{}} - -{{< changelog "Changed" >}} -{{}} - -{{< changelog "Depricated" >}} -{{}} - -{{< changelog "Removed" >}} -{{}} - -{{< changelog "Fixed" >}} -{{}} - -{{< changelog "Security" >}} -{{}} - -{{< changelog "Unreleased" >}} -{{}} \ No newline at end of file diff --git a/content/changelog/compage/_index.en.md b/content/changelog/compage/_index.en.md deleted file mode 100644 index a72351c..0000000 --- a/content/changelog/compage/_index.en.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Compage" -date: 2023-03-31 -description: "Compage project changelog." -type : "changelog" -redirect_to_latest: true # Redirects the user to the latest version of this topic if they are on the root page itself. -latest_version: 0.0.1 # you must specify the latest version of this changelog -draft: false -weight: 1 ---- \ No newline at end of file diff --git a/content/changelog/compage/_index.fr.md b/content/changelog/compage/_index.fr.md deleted file mode 100644 index fde9dac..0000000 --- a/content/changelog/compage/_index.fr.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Compage" -date: 2023-03-31 -description: "this is meta description" -type : "changelog" -draft: true ---- \ No newline at end of file diff --git a/content/compage b/content/compage new file mode 160000 index 0000000..b6f334a --- /dev/null +++ b/content/compage @@ -0,0 +1 @@ +Subproject commit b6f334ad33af398c6622c7658a914b193352e85e diff --git a/content/compage/0.0.1/1-docs-structure/_index.en.md b/content/compage/0.0.1/1-docs-structure/_index.en.md deleted file mode 100644 index 5de146e..0000000 --- a/content/compage/0.0.1/1-docs-structure/_index.en.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: "Docs structure" -date: 2023-03-31 -weight: 1 -draft: false ---- - - -![Compage-banner](compage_logo.svg#gh-light-mode-only) - - - - -This section is a high-level overview of how the Compage Documentation is structured. It will help you use the documentation more effectively by guiding you on where to look for specific information. - -The Compage Documentation covers everything you need to know about Compage. It made up of four main sections which are: - -- [Getting started](../3-installation) -- [Contributing](../6-contribution) -- [User Guide](../5-guides) -- [FAQs](../8-faq) - - -## Introduction - -In the `introduction` section, you will find the three pages below. Head over to the `Installation` page to get the Compage up and running on your KinD cluster. -The `What is Compage?` page summarizes the goals and features of the Compage project. - -- [What is Compage?](../2-overview) -- [Community](../4-community) -- [Installation](../3-installation) - - -## Contributing - -Compage is written in `Golang`, `NodeJS` and `ReactJS` and is `Apache License` - contributions are always welcome whether that means providing feedback, be it through GitHub, through the `#feedback` channel on our [Discord server](https://discord.gg/DeapQc22qe) or testing existing and new features. All the relevant information below: - -- [Contribute](../6-contribution) - -## Guides - -We want to be able to give Compage users the tips and guidance necessary to be able to get the most value from the tool as quickly as possible. That's why we will be continuously adding and updating informative guides and series in which try to relay valuable and actionable advice. - -- [How to use Compage](../5-guides) - -## FAQs - -Find all the answers to all the Compage related questions you might have. Feel free to reach out via the `#feedback` channel on [Discord](https://discord.gg/DeapQc22qe) to request the inclusion of additional questions. - -- [FAQs](../8-faq) \ No newline at end of file diff --git a/content/compage/0.0.1/1-docs-structure/compage-dark.png b/content/compage/0.0.1/1-docs-structure/compage-dark.png deleted file mode 100644 index 3f1aa68..0000000 Binary files a/content/compage/0.0.1/1-docs-structure/compage-dark.png and /dev/null differ diff --git a/content/compage/0.0.1/1-docs-structure/compage-light.png b/content/compage/0.0.1/1-docs-structure/compage-light.png deleted file mode 100644 index 3f1aa68..0000000 Binary files a/content/compage/0.0.1/1-docs-structure/compage-light.png and /dev/null differ diff --git a/content/compage/0.0.1/1-docs-structure/compage_full_logo.png b/content/compage/0.0.1/1-docs-structure/compage_full_logo.png deleted file mode 100644 index 86498ec..0000000 Binary files a/content/compage/0.0.1/1-docs-structure/compage_full_logo.png and /dev/null differ diff --git a/content/compage/0.0.1/1-docs-structure/compage_logo.svg b/content/compage/0.0.1/1-docs-structure/compage_logo.svg deleted file mode 100644 index 07fc2d5..0000000 --- a/content/compage/0.0.1/1-docs-structure/compage_logo.svg +++ /dev/null @@ -1 +0,0 @@ -C mpage \ No newline at end of file diff --git a/content/compage/0.0.1/2-overview/_index.en.md b/content/compage/0.0.1/2-overview/_index.en.md deleted file mode 100644 index 2b53321..0000000 --- a/content/compage/0.0.1/2-overview/_index.en.md +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: "Overview" -date: 2023-03-31 -weight: 2 -draft: false ---- - -![Compage-banner](compage_logo.svg#gh-light-mode-only) - -**Compage** is the `open-source` project by IntelOps. - -Compage was pictured in mind after facing troubles while bootstrapping new projects and adding integrations of standard -practices. - -As a project, Compage's goal is to help developers **spend less time in bootstrapping projects** and follow standard -practices all the time. What's offered from this project is that you can draw diagrams, create connections between the -nodes(microservices) and get the skeleton projects generated which follow standard cloud-native practices. - -Compage is a low-code framework to develop Rest APIs, gRPC, dRPC, GraphQL APIs, WebSockets, Micro-services, FaaS, -Temporal workloads, -IoT and edge services, K8s controllers, K8s CRDs, K8s custom APIs, K8s Operators, K8s hooks, etc. with visual coding -and -by automatically applying best practice methods like software supply chain security measures, SBOM, openAPI, -cloud-events, vulnerability reports, etc. auto generate code after defining requirements in UI as architecture -diagram. - -**Draw the requirements for backend workloads, and then auto generate code, customize it and maintain it by using Compage.** - -> Our goal is to support both auto-generate code and import existing code. Let's see how far we can go with importing -> existing code support. One step at a time! - -### Problem statement: - -Problems with many of the current low-code platforms - - -- Single programming language support only. -- Vendor Lock-in Infrastructure if you want to choose their cloud hosting. -- No proper support or automation for self-hosting and also lots of dependencies on the low-code/no-code tool itself to - run it on your infrastructure. -- No Zero-Vendor Lock-in platform to generate cloud-native. friendly backend source code, especially for Rest APIs, - gRPC, - WebSockets, etc. in any programming language and framework we want. -- Non-availability of a very opinionated development process & management of infrastructure. -- Not compatible to cloud-native, especially for self-hosting K8s environment. -- Not invoking standards like openAPI, Event-driven, software supply chain security, secure container builds, - microservices, etc. -- Not supporting modern tech stack and no feasibility to adopt new tech stack dynamically. -- No bi-directional code management (export, import and manage). -- No easy UX to make any level of developer to learn, adopt and implement development process for K8s ecosystem for - cloud-native world. -- and the list can go on **(please let us know what more you can think of, we will try to solve those problems for you) - ** - -### Solution: **Compage** - -- An opensource tool that runs on your k8s cluster (can be deployed once per team), helps to visually develop backend - workloads for cloud-native & K8s :- -- Easy to adopt & use UI/UX. -- GitHub's integration, container build tools, cosign, etc. -- Equipped with diagramming library to define the project requirements by drawing the flow of backend workloads. -- Annotations, labels, tags, versioning, etc. can be defined within the diagram using forms. -- Select the programming language and framework you prefer (support for each programming language and framework will be - added one by one); first priority is GoLang and Rust. Frameworks can be configured as plug-ins. -- Auto generate code for backend workloads like Rest API, gRPC, dRPC, GraphQL, WebSockets, Microservices, FaaS, - Temporal workloads, IoT and edge services, K8s controllers, K8s CRDs, K8s custom APIs, K8s Operators, K8s hooks, etc. - **(for now support will be for golang and then Rust as priority, followed by Python, C, Carbon, Node.js, Dart, Deno, - etc. Community contribution will help us to achieve more support)** -- Auto generate the backend code, based on requirements defined via diagram & forms -- Auto generate the endpoint configs to be able to use with API gateways & service-mesh environments like Kong, Tyk, - Easegress, Istio, Linkerd, Kuma, Ngnix, Cilium tools, Calico, etc. -- Easy plug-ins by supporting tools like Ory Hydra, Kratos, Keto, OathKeeper, KeyCloak, Gluu, Janssen, Cerbos, Open - Policy Agent, OAuth, OIDC, FIDO, SAML, Dex, MFA, Passwordless, etc. -- Auto build containers as multi-stage and/or distroless to make them secure, portable and optimal. -- Automatically take care of all git processes like tagging, versioning, commits, PRs, etc. -- Automatically enforce software supply chain security process like signing the source code for integrity and generating - immutable ledger logs, generating SBOM, generating vulnerability report, and also generate configurations to auto - verify, validate & control the source code integrity and container image integrity for deployments, etc. in K8s env. -- Automatically convert backend application related environment variables' content to configmaps, secrets, etc. to make - the generated backend compatible to K8s of any flavor (K8s, K3s, TalOS, etc.) and also auto configs to support - integration with Vault, cert-manager, external secrets, sealed secrets & Venafi tools for TLS/SSL and secrets - management. -- Slowly add support for ML development & ML frameworks to make it easy to develop ML applications that will run on - Kubernetes. -- **Automatically manage generated code for by auto creating the services catalog & their visualization by versioning - and integrations, and also git repo observability.** -- **Please suggest what you would like to add as features.** - ---- - -### Current features in compage - -- An opensource tool that runs on your k8s cluster (mostly a local cluster running on developer's machine), helps to - visually develop backend workloads for cloud-native & K8s. -- Easy to adopt & use UI. -- GitHub's integration for authentication, container build tools, cosign, etc. -- Equipped with diagramming library to define the project requirements by drawing the flow of backend workloads. -- Annotations, labels, tags, versioning, etc. can be defined within the diagram using forms. -- Auto generate code for backend workloads like Rest API. -- Auto generate the backend code, based on requirements defined via diagram & forms. -- Auto build containers as multi-stage and/or distro-less to make them secure, portable and optimal. -- Automatically take care of all git processes like tagging, versioning, commits, PRs, etc. -- Automatically enforce software supply chain security process like generating cosign configuration in GitHub actions - for generated source code for the diagrams drawn, generating deepsource configurations, generating configurations for - deployments, services etc. in K8s env. -- Can be deployed directly with docker images or via Helm chart. Helm chart is the tested and preferred way. Even if you - are deploying compage with docker images, you still need K8s cluster access to persist project and user data in etcd - as CRs. - -#### Languages supported: - -> OpenApi Generator based templates (REST services) - -- GoLang -- Java -- Python -- JavaScript -- Ruby -- **we would like to add more support to different languages. Please feel free to suggest.** - -> Compage managed templates (REST) - -- Go -- Rust (in progress) - -Support of different programming languages, protocols and frameworks will be added one by one with community -contribution. - -### Architecture - -![Compage-banner](./compage-architecture-light.png#gh-light-mode-only) - -Compage runs on any K8s cluster. Compage uses K8s custom resource as a store for projects and users. Compage currently -has a support for `Login with Github`. Once user logs into the Compage, user can create projects. The information of -projects created on Compage is stored in K8s and code generated by Compage is stored on GitHub. - -When user tries to log in to Compage, user is redirected to GitHub for login and asked for permissions to access -repository. Once user provides permissions, user logs into the compage. A User CR will be created post user signs into -the Compage along with the GitHub token retrieved by the earlier process. - -User now needs to create a project before he could use the Canvas to draw diagrams. -When the project is created in Compage, a project CR is created on K8s cluster(where your Compage is running). This -process also creates a repository on GitHub and creates a .compage directory in it. As Compage makes use of aws -diagram-maker, the configuration of the canvas can be exported to json. We can redraw the components on canvas using -that json. Compage stores that json under .compage directory in config.json file. On every click of `Save project`, this -file is updated in GitHub repository with the latest state of canvas. - -Compage has 3 components: core, app and ui. - -- core - - This is a `Go` component and acts as code generator for the configurations passed. - - This component considers the configuration passed from `app` and runs it on the templates. - - This component is a gRPC server to `app` component and streams the generated code back to `app`. - - Currently, it supports REST protocol and two types of REST templates are supported as of now. - 1. Compage managed templates - The Compage managed templates are git submodules in the `core` component. If you want to support more - frameworks or languages, you have to add the template in a separate repository and import it as submodule in - this project. The current template for `Go` is a separate - repository - https://github.com/intelops/compage-template-go.git - 2. OpenApi Generator templates -- app - - This is a `NodeJs` component and is responsible for authentication with GitHub and all the GitHub related - operations. - - This component is a REST server to `ui` component and also a gRPC client to `core`. - - Further additions of other logins and GitHub operations will be done in this component. -- ui - - This is a `ReactJs` component and has an integration with aws diagram-maker for canvas. - - User draws diagram and the json created out of it is used to generate the code. diff --git a/content/compage/0.0.1/2-overview/compage-architecture-light.png b/content/compage/0.0.1/2-overview/compage-architecture-light.png deleted file mode 100644 index c2988b8..0000000 Binary files a/content/compage/0.0.1/2-overview/compage-architecture-light.png and /dev/null differ diff --git a/content/compage/0.0.1/2-overview/compage_logo.svg b/content/compage/0.0.1/2-overview/compage_logo.svg deleted file mode 100644 index 07fc2d5..0000000 --- a/content/compage/0.0.1/2-overview/compage_logo.svg +++ /dev/null @@ -1 +0,0 @@ -C mpage \ No newline at end of file diff --git a/content/compage/0.0.1/3-installation/_index.en.md b/content/compage/0.0.1/3-installation/_index.en.md deleted file mode 100644 index 20480e2..0000000 --- a/content/compage/0.0.1/3-installation/_index.en.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: "Installation" -date: 2023-03-31 -weight: 3 -draft: false ---- - -This document covers about how to set up Compage on your local with helm charts and `Compage` will be exposed -through `NodePort` service to the outer world. When you deploy -on -the server, you have to expose the `ui` service using LoadBalancer service type or need to create an ingress. - -### Create a KinD cluster - -Make sure you have access to Kubernetes cluster. You can create a KinD cluster as explained [here](https://github.com/intelops/compage/blob/main/CONTRIBUTING.md), in a cluster creation section. Make sure that you are installing the nginx ingress controller as well. - -We have configured the KinD cluster to be available at these ports: -- ui-32222 -- app—31111 - -So, you can access the compage using [http://localhost:32222](http://localhost:32222) - -### Create a namespace - -Currently, the `compage` namespace is made hard-coded but in-future, it will be completely configurable. - -```yaml -kubectl create ns compage -kubectl config set-context --current --namespace=compage -``` - -### Configure Cassandra -You need to get the details for Cassandra as compage/app uses Cassandra as a database. -You need to update the values.yaml file with the Cassandra details. -```shell -app: - cassandra: - contactPoints: "test-dc1-service.k8ssandra-operator.svc.cluster.local" - localDataCenter: "dc1" - username: "test-superuser" - password: "Vr58zqslXCgQniIfHdYe" - keyspace: "compage" -``` -You can use any Cassandra cluster to store the data. If you want to start a local Cassandra cluster, you can follow the steps given in the [compage/deploy/steps.md](https://github.com/intelops/compage/blob/v1.0.0/deploy/steps.md) file. - -### Install the latest version from GitHub helm repository. - -Fire below set of commands and install the compage on your KinD cluster running locally. - -Before this, you will have to create a docker image for ui component. As this is a UI component and commands in -Dockerfile use below CONFIG values - -- REACT_APP_COMPAGE_APP_SERVER_URL - -to create it, you will have to use your configurations and create a docker image using below commands (run them from base folder of compage) - -```shell -TAG_NAME="{version you are installing so that it will be automatically taken.}" -UI_IMAGE="ghcr.io/intelops/compage/ui:$TAG_NAME" -# Assuming this is the name of your kind cluster -CLUSTER_NAME=compage -# create docker image for ui -docker build -t $UI_IMAGE --network host ui/ -kind load docker-image --name $CLUSTER_NAME $UI_IMAGE -``` - -Once you are done with above commands, kindly run below set of commands. - -```shell -helm repo remove intelops -helm repo add "intelops" "https://raw.githubusercontent.com/intelops/compage/main/charts" -helm install compage intelops/compage --values charts/compage/values.yaml -kubectl get pods -n compage -kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=compage-ui -kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=compage-core -kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=compage-app -``` - -Go to [http://localhost:32222](http://localhost:32222) - -### Uninstall - -Simply, delete the cluster created above using `kind delete cluster --name compage`. If that's not possible, delete the -namespace `kubectl delete ns compage` diff --git a/content/compage/0.0.1/4-community/_index.en.md b/content/compage/0.0.1/4-community/_index.en.md deleted file mode 100644 index 5b3b926..0000000 --- a/content/compage/0.0.1/4-community/_index.en.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "Community" -date: 2023-03-31 -weight: 4 -draft: false ---- - - -The `Compage by IntelOps` community consists of people having industry experience of more than 30 years, we rally around -one mission though which is: - -> Assist developers in building software with proper set of tools, standards, frameworks, quality, etc. for smoothening developer's workflow by having secured practices in place. -> Sharing is caring! - -You can participate and/or [contribute](../6-contribution) to the community. - -## Discord Server - -For any assistance, please reach out to use on [Discord Server](https://discord.gg/DeapQc22qe), it is an open and -inclusive place, you can interact with the maintainers or simply hang out with the community and talk about anything -around cloud-native, microservices, security and DevOps. - -## Community calls - -We will soon have a few slots open for one-to-one connect with our core-developers. We encourage you to book time with -the developers to understand the `Compage by IntelOps` better or share the idea. \ No newline at end of file diff --git a/content/compage/0.0.1/5-guides/1-how-to-use-compage/_index.en.md b/content/compage/0.0.1/5-guides/1-how-to-use-compage/_index.en.md deleted file mode 100644 index 6a8c12b..0000000 --- a/content/compage/0.0.1/5-guides/1-how-to-use-compage/_index.en.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "How to use Compage" -date: 2023-03-31 -weight: 1 -draft: false ---- - -End users of the Compage are developers in team. A developer as a user - -- Logs in to the compage using his/her GitHub credentials. He/she needs to provide permissions for the Compage GitHub - App to create repositories on his/her behalf, commit generated code to the repositories. -- Selects from existing projects or creates a new project from the dialog box presented. - A compage project has a one-to-one relationship with GitHub repository. The compage project's connected GitHub - repository can contain all the generated source code for all the nodes created on drawing panel. Compage follows - monorepo method, all connected microservices in single git repository. -- Uses drawing canvas to create nodes and configure one by one using forms after double-clicking on nodes. At last, - he/she saves the project and hits `Generate Code` button. The code will be generated and saved to connected GitHub - repository for that project. -- Uses same panel to add more microservices(nodes) or modify existing microservices. When the code is generated, version - is locked till that point and any change made post code-generation till next code-generation is part of next version. - User's can have at most 10 versions per project as of now. Moving between versions is not yet supported. - -1. [Create a node](../2-create-services) -2. [Create an edge](../3-configure-services) diff --git a/content/compage/0.0.1/5-guides/2-create-services/_index.en.md b/content/compage/0.0.1/5-guides/2-create-services/_index.en.md deleted file mode 100644 index 6ac5d88..0000000 --- a/content/compage/0.0.1/5-guides/2-create-services/_index.en.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "Creating MicroServices" -date: 2023-03-31 -weight: 2 -draft: false ---- - -A node in Compage represents a microservice from developers perspective. - -- Developers can drag nodes to canvas after logging into Compage and creating/selecting project. - [diagram] -- Once the node is dragged and dropped, developer needs to add more properties to it. A dialog box is opened after - double-clicking on the node. -- Compage supports REST protocol as of now. That means, Code for REST servers and REST clients can be generated by - Compage. -- There are two ways to create REST servers as of now. - - OpenAPI generator templates - - Compage managed templates - -Supported Languages by OpenApi generator templates - -- Go (go-server, go-gin-server, go-echo-server) -- Java (java-play-framework,java-micronaut-server,java-undertow-server) -- JavaScript (nodejs-express-server) -- TypeScript (typescript-node,typescript-axios) -- Ruby (ruby-on-rails,ruby-sinatra) -- Python (python-flask) - -Supported Languages by Compage managed templates - -- Go (go-gin framework) -- Rust (in progress) - -Now, based on your choice, framework needs to be selected. -- You have to add port for Compage managed templates but for OpenApi Generator templates, you don't have to supply it as it's taken automatically. For OpenApi Generator templates, you have to upload a valid OpenApi specification file. -- After adding all the properties to the node, you can create another node and follow the same steps to add property to it. -- If you want to create connection between nodes, you can drag from source node to destination node. diff --git a/content/compage/0.0.1/5-guides/3-configure-services/_index.en.md b/content/compage/0.0.1/5-guides/3-configure-services/_index.en.md deleted file mode 100644 index 6beab58..0000000 --- a/content/compage/0.0.1/5-guides/3-configure-services/_index.en.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Declaring MicroServices Requirements" -date: 2023-03-31 -weight: 3 -draft: false ---- - -An edge in Compage represents a connection from source microservice to destination service. Source microservice is a server here, and destination microservice is a client. - -- If you want to create connection between nodes, you can drag from source node to destination node. -- You can add properties to an edge too by double-clicking on it. You may have to select the edge and then double-click on it. -- The properties for the edge are just name and port (which is by default selected). Once the name is added, the edge gets renamed to that name. \ No newline at end of file diff --git a/content/compage/0.0.1/5-guides/_index.en.md b/content/compage/0.0.1/5-guides/_index.en.md deleted file mode 100644 index 9be4872..0000000 --- a/content/compage/0.0.1/5-guides/_index.en.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "User Guide" -date: 2023-03-31 -weight: 5 -draft: false ---- - -- [How to use Compage](./1-how-to-use-compage) -- [Creating MicroServices](./2-create-services) -- [Declaring Requirements for the Services creation](./3-configure-services) diff --git a/content/compage/0.0.1/6-contribution/_index.en.md b/content/compage/0.0.1/6-contribution/_index.en.md deleted file mode 100644 index 042e469..0000000 --- a/content/compage/0.0.1/6-contribution/_index.en.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "Contribution" -date: 2023-03-31 -weight: 6 -draft: false ---- - -If you are willing to contribute to Compage, kindly follow the guidelines -here [contributors](https://github.com/intelops/compage/blob/main/CONTRIBUTING.md). Thank you for your contribution! - -## Contributing to the docs - -- The best way to get started is by reading - the ["Contributor.md"](https://www.compage.dev/blog/how-to-contribute-to-compage?utm_source=docs&utm_medium=referral) - along with the [Contributor Guidelines](https://github.com/intelops/compage/blob/main/CONTRIBUTING.md). -- The docs are in the code repository itself under /docs directory. The documentation is created using based on famous - framework `Docusaurus`. -- Afterwards, go ahead and **fork** the compage [repository](https://github.com/intelops/compage). Make any changes you - want to your fork, and when you're ready to send those changes to us, go to your fork and create a new pull request. - -- If it takes longer than expected to get feedback from the `Compage by IntelOps` team, head over to - the [Discord Server](https://discord.gg/DeapQc22qe) and **ping** a IntelOps staff member either in the `#general` - or `#feedback` channel, unless you are a member of the private `contributor` channel. You can always request access to - this channel. - -- Once your pull request has been opened, it will be assigned to one or more reviewers. Those reviewers will do a - thorough code review, looking for correctness, bugs, opportunities for improvement, documentation, comments, and - style. - -- Make sure you include relevant updates or additions to documentation when creating or modifying features. Once you’ve - received review and approval, your commits are squashed, and your PR is ready for merging. - -- Congrats you’re officially a Compage contributor 🎊 - ---- -If you're in need of any assistance at any stage of your contributing journey please don't hesitate to reach out to -anybody in the `#general` or `#feedback` discord channels, also let us know if you want to be added to the -private `#contributors` channel too. Or directly to `@mahendraintelops` or `@azar-intelops` who will always be happy to -help. \ No newline at end of file diff --git a/content/compage/0.0.1/7-telemetry/_index.en.md b/content/compage/0.0.1/7-telemetry/_index.en.md deleted file mode 100644 index 621c54e..0000000 --- a/content/compage/0.0.1/7-telemetry/_index.en.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "Telemetry" -date: 2023-03-31 -weight: 7 -draft: false ---- - -By default, the Compage collects some anonymous usage data. There are two types of data we collect: - -- **Usage**: features usage, we use this data to understand which providers are being used and how much, which helps - guide our roadmap and development efforts. -- **Errors**: stack traces sent whenever a panic occurs in the core component. Having this data allows us to be notified - when there is a bug that needs to be prioritized. - -### We will never: - -- Identify or track users. -- Collect personal information such as IP addresses, email addresses, or website URLs. -- Store data about your cloud resources or credentials . - -## Why collect telemetry data? - -We collect telemetry data for only two reasons: - -- In order to create a better product, we need reliable quantitative information. The data we collect helps us fix bugs, - evaluate the success of features, and better understand our users' needs. - -- We also need to prove that people are actually using Compage. - -## How to disable data collection - -Data collection can be disabled at any time by setting a key in values.yaml, then re-installing the Compage instance. - -```yaml -core: - telemetry: false -``` - diff --git a/content/compage/0.0.1/8-faq/_index.en.md b/content/compage/0.0.1/8-faq/_index.en.md deleted file mode 100644 index 39a1071..0000000 --- a/content/compage/0.0.1/8-faq/_index.en.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "FAQs" -date: 2023-03-31 -weight: 8 -draft: false ---- - - -## What can Compage help me with? - -If you are developer and working on microservices, you might have experienced the pain of integrations with latest and -trending technologies and tools. There are many scaffolding tools, generators in market and have different way of -implementing same stuff. Compage will help you generate the project with the popular integrations. - -## Is Compage regularly maintained? - -Compage is an open-source project that is actively maintained by the IntelOps team. The tool is currently in alpha state -and will go in major breaking changes in near future. Join the [Discord server](https://discord.gg/DeapQc22qe) so you -don't miss any updates. - -## How can I request a new feature? - -If you would like to request a feature to be added to Compage, feel free to do so through any of the following channels: - -- GitHub [issues](https://github.com/intelops/compage/issues) -- Discord [server](https://discord.gg/DeapQc22qe) (#feature-requests channel) - - -## Where can I see the upcoming features? - -We will make a heavy use of GitHub issues. so if you think we should prioritize a certain feature over another, let your -voice be heard by up-voting it, we really appreciate your input. Also, let us know if we are missing anything. - -## How can I stay in the loop with new releases? - -Please check [changelog](https://github.com/intelops/compage/releases). The best way to find out about the cool -features and improvements we've shipped in the latest releases. \ No newline at end of file diff --git a/content/compage/0.0.1/9-mermaid/_index.en.md b/content/compage/0.0.1/9-mermaid/_index.en.md deleted file mode 100644 index 25a2df6..0000000 --- a/content/compage/0.0.1/9-mermaid/_index.en.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: "Mermaid Js" -date: 2023-03-31 -weight: 9 -draft: true ---- - -
-
- -```mermaid -mindmap - root(Learn a programming language) - Changelog - Ruby - Go - Operating System - VCS Hosting - Version Control System -``` - ---- - -## Flowchart - -```mermaid -flowchart TD - A[Changelog] -->|Go| B(Go shopping) - B --> C{Let me think} - C -->|One| D[Laptop] - C -->|Two| E[iPhone] - C -->|Three| F[fa:fa-car Car] -``` - ---- - -## C4Context - -```mermaid -C4Deployment - title Deployment Diagram for Internet Banking System - Live - - Deployment_Node(mob, "Customer's mobile device", "Apple IOS or Android"){ - Container(mobile, "Changelog", "Xamarin", "Provides a limited subset of the Internet Banking functionality to customers via their mobile device.") - } - - Deployment_Node(comp, "Customer's computer", "Microsoft Windows or Apple macOS"){ - Deployment_Node(browser, "Web Browser", "Google Chrome, Mozilla Firefox,
Apple Safari or Microsoft Edge"){ - Container(spa, "Go", "JavaScript and Angular", "Provides all of the Internet Banking functionality to customers via their web browser.") - } - } - - Deployment_Node(plc, "Big Bank plc", "Big Bank plc data center"){ - Deployment_Node(dn, "bigbank-api*** x8", "Ubuntu 16.04 LTS"){ - Deployment_Node(apache, "Apache Tomcat", "Apache Tomcat 8.x"){ - Container(api, "API Application", "Java and Spring MVC", "Provides Internet Banking functionality via a JSON/HTTPS API.") - } - } - Deployment_Node(bb2, "bigbank-web*** x4", "Ubuntu 16.04 LTS"){ - Deployment_Node(apache2, "Apache Tomcat", "Apache Tomcat 8.x"){ - Container(web, "Web Application", "Java and Spring MVC", "Delivers the static content and the Internet Banking single page application.") - } - } - Deployment_Node(bigbankdb01, "bigbank-db01", "Ubuntu 16.04 LTS"){ - Deployment_Node(oracle, "Oracle - Primary", "Oracle 12c"){ - ContainerDb(db, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.") - } - } - Deployment_Node(bigbankdb02, "bigbank-db02", "Ubuntu 16.04 LTS") { - Deployment_Node(oracle2, "Oracle - Secondary", "Oracle 12c") { - ContainerDb(db2, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.") - } - } - } - - Rel(mobile, api, "Makes API calls to", "json/HTTPS") - Rel(spa, api, "Makes API calls to", "json/HTTPS") - Rel_U(web, spa, "Delivers to the customer's web browser") - Rel(api, db, "Reads from and writes to", "JDBC") - Rel(api, db2, "Reads from and writes to", "JDBC") - Rel_R(db, db2, "Replicates data to") - - UpdateRelStyle(spa, api, $offsetY="-40") - UpdateRelStyle(web, spa, $offsetY="-40") - UpdateRelStyle(api, db, $offsetY="-20", $offsetX="5") - UpdateRelStyle(api, db2, $offsetX="-40", $offsetY="-20") - UpdateRelStyle(db, db2, $offsetY="-10") -``` - ---- - -## ZenUML - -```mermaid -zenuml - title Reply message - Changelog->A.method() { - GO.method() { - if(condition) { - return Changelog - // return early - @return - A->Changelog: x11 - } - } - return go - } -``` - -```mermaid -zenuml - BookLibService.Borrow(id) { - User = Changelog.GetUser() - if(User.isActive) { - try { - BookRepository.Update(id, onLoan, User) - receipt = new Receipt(id, dueDate) - } catch (BookNotFoundException) { - ErrorService.onException(BookNotFoundException) - } finally { - Connection.close() - } - } - return receipt - } -``` diff --git a/content/compage/0.0.1/_index.en.md b/content/compage/0.0.1/_index.en.md deleted file mode 100644 index eb19d69..0000000 --- a/content/compage/0.0.1/_index.en.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Compage" -date: 2023-03-31 -description: "Compage User Guide doc" -type : "docs" -draft: false -ignoreSearch: false -weight: 1 ---- \ No newline at end of file diff --git a/content/compage/_index.md b/content/compage/_index.md deleted file mode 100644 index 9b1585f..0000000 --- a/content/compage/_index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -redirect_to_latest: true # Redirects the user to the latest version of this topic if they are on the root page itself. -latest_version: 0.0.1 # you must specify the latest version of this changelog ---- \ No newline at end of file diff --git a/content/kubviz/_index.md b/content/kubviz/_index.md index 5295ca5..82643f3 100644 --- a/content/kubviz/_index.md +++ b/content/kubviz/_index.md @@ -1,4 +1,5 @@ --- redirect_to_latest: true # Redirects the user to the latest version of this topic if they are on the root page ("/kubviz") itself. latest_version: 1.0.0 # you must specify the latest version of this changelog +type: "docs-root" --- \ No newline at end of file diff --git a/content/changelog/kubviz/1.0.0/_index.en.md b/content/kubviz/changelog/1.0.0/_index.en.md similarity index 100% rename from content/changelog/kubviz/1.0.0/_index.en.md rename to content/kubviz/changelog/1.0.0/_index.en.md diff --git a/content/changelog/kubviz/1.0.0/capten-project-changelog/_index.en.md b/content/kubviz/changelog/1.0.0/capten-project-changelog/_index.en.md similarity index 65% rename from content/changelog/kubviz/1.0.0/capten-project-changelog/_index.en.md rename to content/kubviz/changelog/1.0.0/capten-project-changelog/_index.en.md index b1c0c0f..40f73a5 100644 --- a/content/changelog/kubviz/1.0.0/capten-project-changelog/_index.en.md +++ b/content/kubviz/changelog/1.0.0/capten-project-changelog/_index.en.md @@ -1,12 +1,10 @@ --- -title: "changelog" +title: "Changelog" date: 2023-03-31 weight: 2 draft: false --- - - ### February Updates **Feb 6, 2019** @@ -14,21 +12,21 @@ draft: false Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt dolore magna aliquyam erat, sed diam voluptua. At vero eos et ustoLorem ipsum dolor sit amet, consetetur." {{< changelog "changed" >}} -* Better support for using applying additional filters to posts_tax_query for categories for custom WordPress syncs -* Reporting fine-tuning for speed improvements (up to 60% improvement in latency) +- Better support for using applying additional filters to posts_tax_query for categories for custom WordPress syncs -* Replaced login / registration pre-app screens with a cleaner design -{{}} +- Reporting fine-tuning for speed improvements (up to 60% improvement in latency) +- Replaced login / registration pre-app screens with a cleaner design + {{}} {{< changelog "removed" >}} -* Removed an issue with the sync autolinker only interlinking selectively. -* Removed up an issue with prematurely logging out users -{{}} -
+- Removed an issue with the sync autolinker only interlinking selectively. +- Removed up an issue with prematurely logging out users + {{}} +
### March Updates @@ -37,16 +35,17 @@ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt dolore magna aliquyam erat, sed diam voluptua. At vero eos et ustoLorem ipsum dolor sit amet, consetetur." {{< changelog "added" >}} -* Some scheduled changelogs, tweets, and slack messages queued up this weekend and were not published on time. We fixed the issue and all delayed publications should be out. -* We now prioritize keywords over title and body so customers can more effectively influence search results -* Support form in the Assistant is now protected with reCaptcha to reduce spam reinitializeOnUrlChange added to the JavaScript API to improve support for pages with turbolinks -{{}} +- Some scheduled changelogs, tweets, and slack messages queued up this weekend and were not published on time. We fixed the issue and all delayed publications should be out. +- We now prioritize keywords over title and body so customers can more effectively influence search results +- Support form in the Assistant is now protected with reCaptcha to reduce spam reinitializeOnUrlChange added to the JavaScript API to improve support for pages with turbolinks + {{}} {{< changelog "fixed" >}} -* Fixed an issue with the sync autolinker only interlinking selectively. -* Fixed up an issue with prematurely logging out users -{{}} + +- Fixed an issue with the sync autolinker only interlinking selectively. +- Fixed up an issue with prematurely logging out users + {{}}
@@ -71,4 +70,4 @@ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod {{}} {{< changelog "Unreleased" >}} -{{}} \ No newline at end of file +{{}} diff --git a/content/changelog/kubviz/_index.en.md b/content/kubviz/changelog/_index.en.md similarity index 94% rename from content/changelog/kubviz/_index.en.md rename to content/kubviz/changelog/_index.en.md index a3d9a38..e8bf8ff 100644 --- a/content/changelog/kubviz/_index.en.md +++ b/content/kubviz/changelog/_index.en.md @@ -2,7 +2,7 @@ title: "KubViz" date: 2023-03-31 description: "KubViz project changelog." -type : "changelog" +type: "changelog" redirect_to_latest: true # Redirects the user to the latest version of this topic if they are on the root page itself. latest_version: 1.0.0 # you must specify the latest version of this changelog draft: false diff --git a/content/changelog/kubviz/_index.fr.md b/content/kubviz/changelog/_index.fr.md similarity index 80% rename from content/changelog/kubviz/_index.fr.md rename to content/kubviz/changelog/_index.fr.md index d5dfd01..6e9d8f3 100644 --- a/content/changelog/kubviz/_index.fr.md +++ b/content/kubviz/changelog/_index.fr.md @@ -2,6 +2,6 @@ title: "Capten" date: 2023-03-31 description: "this is meta description" -type : "changelog" +type: "changelog" draft: true ---- \ No newline at end of file +--- diff --git a/netlify.toml b/netlify.toml index 700e43c..8fc8a18 100644 --- a/netlify.toml +++ b/netlify.toml @@ -6,12 +6,6 @@ HUGO_VERSION = "0.118.2" GO_VERSION = "1.20.5" -# [[redirects]] -# from = "/latest/*" -# to = "/1.0.1/:splat" -# status = 301 -# force = true - [[headers]] for = "/*" # This defines which paths this specific [[headers]] block will cover. diff --git a/package.json b/package.json index 7e51175..16c0524 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,16 @@ { - "name": "gethugothemes-boilerplate", + "name": "intelops-docs", "version": "2.1.3", "license": "UNLICENSED", - "author": "gethugothemes", + "author": "Intelops", "scripts": { + "update-submodules": "git submodule update --init --recursive --remote", "dev": "cd exampleSite; hugo server || hugo server --themesDir ../..", "test": "cd exampleSite; hugo server --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify || hugo server --themesDir ../.. --disableFastRender --navigateToChanged --templateMetrics --templateMetricsHints --buildExpired --buildFuture --watch --forceSyncStatic -e production --minify", "build": "cd exampleSite; hugo --gc --minify --templateMetrics --templateMetricsHints --buildExpired --buildFuture --forceSyncStatic || hugo --themesDir ../.. --gc --minify --templateMetrics --templateMetricsHints --buildExpired --buildFuture --forceSyncStatic", "update": "hugo mod clean && hugo mod get -u ./... && hugo mod tidy" }, "devDependencies": { - "@fullhuman/postcss-purgecss": "^5.0.0", - "postcss": "^8.4.31", - "postcss-cli": "^10.1.0", "prettier": "^3.0.3", "prettier-plugin-go-template": "^0.0.15" } diff --git a/themes/godocs-4/assets/js/script.js b/themes/godocs-4/assets/js/script.js index 9f0352f..47b077e 100644 --- a/themes/godocs-4/assets/js/script.js +++ b/themes/godocs-4/assets/js/script.js @@ -8,7 +8,7 @@ $(preloader); "use strict"; // Show temporary white overlay (for better user experience) if user want to navigate to url that contains "latest" word - let overlay404 = document.querySelector(".overlay-404"); + let overlay404 = document.querySelector(".overlay-white"); let url = window.location.pathname; let DoesLatestWordExist = url.match(/(^|\/)latest($|\/)/); let DoesVersionExist = url.match(/\d+\.\d+\.\d+/); @@ -18,32 +18,6 @@ $(preloader); } } - // copy-to-clipboard - let copyEl = document.querySelector(".copy-url"); - if (copyEl !== null) { - let pageUrl = window.location.href; - let latestDocVer = document.querySelector("[latest-data-version]")?.getAttribute("latest-data-version"); - if (pageUrl.includes(latestDocVer)) { - pageUrl = pageUrl.replace(latestDocVer, "latest"); - } - - copyEl.addEventListener("click", function () { - this.classList.add("done"); - - let textarea = document.createElement("textarea"); - textarea.value = pageUrl; - document.body.appendChild(textarea); - textarea.select(); - document.execCommand("copy"); - document.body.removeChild(textarea); - - }); - - copyEl.addEventListener("mouseleave", function () { - this.classList.remove("done"); - }); - } - if ($('.search-wrapper').length > 0) { // searchToggler keyboard shortcut const searchToggler = document.querySelectorAll('[data-search-toggler]'); @@ -83,29 +57,27 @@ $(preloader); // Code Copy // ---------------------------------------- - let blocks = document.querySelectorAll(".code-highlight"); - - async function copyCode(block, button) { - let code = block.querySelector("code"); - let text = code.innerText; - await navigator.clipboard.writeText(text); - button.innerText = "copied"; - setTimeout(() => { - button.innerText = "copy"; - }, 700); - } - + let blocks = document.querySelectorAll("pre"); blocks.forEach((block) => { if (navigator.clipboard) { let button = document.createElement("span"); button.innerText = "copy"; - button.className = "copy"; + button.className = "copy-to-clipboard"; block.appendChild(button); - button?.addEventListener("click", async () => { + button.addEventListener("click", async () => { await copyCode(block, button); }); } }); + async function copyCode(block, button) { + let code = block.querySelector("code"); + let text = code.innerText; + await navigator.clipboard.writeText(text); + button.innerText = "copied"; + setTimeout(() => { + button.innerText = "copy"; + }, 700); + } // scroll function $(window).scroll(function () { diff --git a/themes/godocs-4/assets/scss/_common.scss b/themes/godocs-4/assets/scss/_common.scss index fad5f4b..86f6e33 100644 --- a/themes/godocs-4/assets/scss/_common.scss +++ b/themes/godocs-4/assets/scss/_common.scss @@ -218,3 +218,9 @@ mark { .gap-20 { gap: 20px; } +.dropdown-doc-version .dropdown-item:not(.inactive), .dropdown-doc-version .dropdown-item.active { + background-position: .4rem 50% !important; +} +.border-muted-50 { + border-color: rgba(0, 0, 0, 0.05) !important; +} \ No newline at end of file diff --git a/themes/godocs-4/assets/scss/templates/_main.scss b/themes/godocs-4/assets/scss/templates/_main.scss index b027ed6..c9d747b 100644 --- a/themes/godocs-4/assets/scss/templates/_main.scss +++ b/themes/godocs-4/assets/scss/templates/_main.scss @@ -1216,7 +1216,7 @@ object { } } -.overlay-404 { +.overlay-white { position: fixed; width: 100vw; height: 100vh; diff --git a/themes/godocs-4/layouts/404.html b/themes/godocs-4/layouts/404.html index 463fe3c..262eef6 100644 --- a/themes/godocs-4/layouts/404.html +++ b/themes/godocs-4/layouts/404.html @@ -1,5 +1,5 @@ {{ define "main" }} -
+

{{ .Title | markdownify }}

diff --git a/themes/godocs-4/layouts/_default/changelog.html b/themes/godocs-4/layouts/_default/changelog.html index 5c52850..120db6d 100644 --- a/themes/godocs-4/layouts/_default/changelog.html +++ b/themes/godocs-4/layouts/_default/changelog.html @@ -1,111 +1,5 @@ {{ define "main" }} -
-
-
- + +{{ partial "default.html" . }} -
-
-
-

{{ .Title }}

- {{ $scratch := newScratch }} - {{ with .File }} - {{ $scratch.Set "path" .Path }} - {{ end }} -
- {{ partial "version-switcher.html" . }} - - - - - Edit in Git Repo - - -
-
- -
- - {{ if .Content }} -
- {{ .Content }} -
- {{ else }} -
    - {{- if .IsSection }} - {{- $numberOfPages := (add (len .Pages) (len .Sections)) }} - {{- safeHTML .Params.head }} - - {{- if ne $numberOfPages 0 }} - {{- $pages := .Pages }} - {{- if .Sections }} - {{- $pages = (.Pages | union .Sections) }} - {{- end }} - - {{- range $pages.ByWeight }} - {{- if .IsSection }} -
  • {{ .Title }}
  • - {{- end }} - {{- end }} - {{- end }} - - {{- end }} - -
- {{ end }} - -
-
- -
- {{ if gt .WordCount 100 }} - {{ .TableOfContents }} - {{ end }} -
-
-
-
{{ end }} diff --git a/themes/godocs-4/layouts/_default/index.json b/themes/godocs-4/layouts/_default/index.json index f871e02..2df4c47 100644 --- a/themes/godocs-4/layouts/_default/index.json +++ b/themes/godocs-4/layouts/_default/index.json @@ -1,7 +1,7 @@ {{- $len := sub (len (.Pages.GroupBy "Section")) 1 -}} [{{- range $item, $el := .Pages.GroupBy "Section" -}} {{- range $i, $e := .Pages -}} - {{- if and (not .Params.ignoreSearch) (.Params.visible) (ne $e.Type "json") -}} + {{- if and (not .Params.ignoreSearch) (ne $e.Type "json") -}} { "version": "", "url": "{{ $e.Permalink }}", @@ -16,9 +16,8 @@ {{- $section := (where site.Pages "Section" .Section) | intersect (where site.Pages ".Title" "!=" .Title) -}} {{- $sectionLen := len $section -}} - {{- $sectionLenTotal := sub $sectionLen 1 -}} - - {{- range $i, $page := $section -}} + {{- $filteredSections := slice -}} + {{- range $in, $page := $section -}} {{- $currentPageVersion := index (findRE `(\d+\.\d+\.\d+)` .RelPermalink) 0 -}} {{- $index := "" -}} {{- if eq (index (split .RelPermalink "/") 3) $currentPageVersion -}} @@ -28,21 +27,32 @@ {{- end -}} {{- $currentSection := string (delimit (first $index (split .RelPermalink "/")) "/") -}} {{- $latest_version := (string (site.GetPage (string $currentSection)).Params.latest_version) -}} - {{- if and (not .Params.ignoreSearch) (ne $page.Type "json") (eq $latest_version $currentPageVersion) -}} - { - "$sectionLenTotal": "{{$sectionLenTotal}}", - "$i": "{{$i}}", - "version": "{{index (findRE `(\d+\.\d+\.\d+)` .RelPermalink) 0}}", - "url": "{{ $page.Permalink }}", - "title": "{{ with $page.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $page.Title}}{{end}}", - "description": "{{ htmlEscape .Description}}", - "searchKeyword": "{{ htmlEscape .Params.searchKeyword}}", - "content": {{$page.Plain | jsonify}} - }{{- if eq $item $len -}}{{- if ne $i $sectionLenTotal -}},{{- end -}}{{- else -}},{{- end -}} + {{- $filteredSections = $filteredSections | append $page -}} + {{- end -}} {{- end -}} - {{- end -}} + {{- $filteredSectionLen := sub (len $filteredSections) 1 -}} + {{- range $rangeIndex, $page := $filteredSections -}} + {{- $currentPageVersion := index (findRE `(\d+\.\d+\.\d+)` .RelPermalink) 0 -}} + {{- $index := "" -}} + {{- if eq (index (split .RelPermalink "/") 3) $currentPageVersion -}} + {{- $index = 3 -}} + {{- else -}} + {{- $index = 2 -}} + {{- end -}} + {{- $currentSection := string (delimit (first $index (split .RelPermalink "/")) "/") -}} + {{- $latest_version := (string (site.GetPage (string $currentSection)).Params.latest_version) -}} + + { + "version": "{{index (findRE `(\d+\.\d+\.\d+)` .RelPermalink) 0}}", + "url": "{{ $page.Permalink }}", + "title": "{{ with $page.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $page.Title}}{{end}}", + "description": "{{ htmlEscape .Description}}", + "searchKeyword": "{{ htmlEscape .Params.searchKeyword}}", + "content": {{$page.Plain | jsonify}} + }{{- if eq $item $len -}}{{- if ne $rangeIndex $filteredSectionLen -}},{{- end -}}{{- else -}},{{- end -}} + {{- end -}} {{- end -}} {{- end -}} {{- end -}}] \ No newline at end of file diff --git a/themes/godocs-4/layouts/partials/default.html b/themes/godocs-4/layouts/partials/default.html index acf3800..93ead39 100644 --- a/themes/godocs-4/layouts/partials/default.html +++ b/themes/godocs-4/layouts/partials/default.html @@ -30,8 +30,6 @@ {{ end }} {{ end }} - -
diff --git a/themes/godocs-4/layouts/partials/header.html b/themes/godocs-4/layouts/partials/header.html index 352b4b2..242941f 100644 --- a/themes/godocs-4/layouts/partials/header.html +++ b/themes/godocs-4/layouts/partials/header.html @@ -5,6 +5,7 @@ {{ end }} {{ end }} + {{ $index := "" }} {{ if eq (index (split .RelPermalink "/") 3) "" }} @@ -189,6 +190,7 @@ {{ "" | safeHTML }} + -{{ partial "search-modal" . }} + {{ partial "search-modal" . }} diff --git a/themes/godocs-4/layouts/partials/menu.html b/themes/godocs-4/layouts/partials/menu.html index 97beafe..68eca8b 100644 --- a/themes/godocs-4/layouts/partials/menu.html +++ b/themes/godocs-4/layouts/partials/menu.html @@ -1,37 +1,113 @@ {{ $currentNode := . }} -{{ $isChangelogSection := eq .Section "changelog" }} -{{ $currentChangelogNode := site.GetPage "/changelog/" }} -{{ $currentRelPermalink := delimit (first 3 (split .RelPermalink "/")) "/" }} +{{ $isSeparateChangelogPage := findRE "changelog" (index (split .RelPermalink "/") 1) }} +{{ $currentPageRoot := site.GetPage .Section }} +{{ $currentRelPermalink := delimit (first 2 (split .RelPermalink "/")) "/" }} {{ $currentPageVersion := index (findRE `(\d+\.\d+\.\d+)` .RelPermalink) 0 }} +{{ $isChangelog := eq (index (first 4 (split .RelPermalink "/")) 2) "changelog" }} diff --git a/themes/godocs-4/layouts/partials/script.html b/themes/godocs-4/layouts/partials/script.html index 1a1e19a..926186f 100644 --- a/themes/godocs-4/layouts/partials/script.html +++ b/themes/godocs-4/layouts/partials/script.html @@ -30,16 +30,30 @@ {{ $scripts := slice }} -{{ range site.Params.plugins.js}} -{{ if findRE "^http" .link }} - -{{ else }} -{{ $scripts = $scripts | append (resources.Get .link) }} +{{ range site.Params.plugins.js }} + {{ if findRE "^http" .link }} + + {{ else }} + {{ $scripts = $scripts | append (resources.Get .link) }} + {{ end }} {{ end }} + + +{{ $scripts = $scripts | append (resources.Get "js/script.js") }} +{{ $scripts = $scripts | resources.Concat "js/script.js" }} + +{{ if hugo.IsProduction }} + {{ $scripts = $scripts | minify | fingerprint }} {{ end }} -{{ $scripts := $scripts | append (resources.Get "js/script.js") }} -{{ $scripts := $scripts | resources.Concat "/js/script.js" | minify | fingerprint "sha512" }} - + +{{/* scripts */}} + {{ if site.Params.cookies.enable }} diff --git a/themes/godocs-4/layouts/partials/version-switcher.html b/themes/godocs-4/layouts/partials/version-switcher.html index daba651..c372dbf 100644 --- a/themes/godocs-4/layouts/partials/version-switcher.html +++ b/themes/godocs-4/layouts/partials/version-switcher.html @@ -1,5 +1,5 @@ {{ $currentPageVersion := index (findRE `(\d+\.\d+\.\d+)` .RelPermalink) 0 }} -{{ if and (site.Params.docVersion) (ne .RelPermalink "/changelog/")}} +{{ if and (site.Params.docVersion) (ne .RelPermalink "/changelog/") }} {{ if not .IsHome }} + {{ $isChangelog := findRE "changelog" (index (first 4 (split .RelPermalink "/")) 2)}} {{ if $currentPageVersion }} {{ $index := "" }} - {{ if eq (index (split .RelPermalink "/") 3) $currentPageVersion }} + {{ if $isChangelog }} {{ $index = 3 }} {{ else }} {{ $index = 2 }} {{ end }} -