diff --git a/daprdocs/content/en/developing-applications/building-blocks/_index.md b/daprdocs/content/en/developing-applications/building-blocks/_index.md index d0df0b4aa..c1b10bbd4 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/_index.md @@ -8,4 +8,5 @@ description: "Dapr capabilities that solve common development challenges for dis Get a high-level [overview of Dapr building blocks]({{< ref building-blocks-concept >}}) in the **Concepts** section. -Diagram showing the different Dapr API building blocks \ No newline at end of file +Diagram showing the different Dapr API building blocks + diff --git a/daprdocs/content/en/developing-applications/building-blocks/actors/_index.md b/daprdocs/content/en/developing-applications/building-blocks/actors/_index.md index d3ae80d32..8a56cf484 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/actors/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/actors/_index.md @@ -5,3 +5,10 @@ linkTitle: "Actors" weight: 50 description: Encapsulate code and data in reusable actor objects as a common microservices design pattern --- + +{{% alert title="More about Dapr Actors" color="primary" %}} + Learn more about how to use Dapr Actors: + - Try the [Actors quickstart]({{< ref actors-quickstart.md >}}). + - Explore actors via any of the [Dapr SDKs]({{< ref sdks >}}). + - Review the [Actors API reference documentation]({{< ref actors_api.md >}}). +{{% /alert %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/bindings/_index.md b/daprdocs/content/en/developing-applications/building-blocks/bindings/_index.md index 578cfe0a9..d15682d7b 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/bindings/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/bindings/_index.md @@ -5,3 +5,12 @@ linkTitle: "Bindings" weight: 40 description: Interface with or be triggered from external systems --- + + +{{% alert title="More about Dapr Bindings" color="primary" %}} + Learn more about how to use Dapr Bindings: + - Try the [Bindings quickstart]({{< ref bindings-quickstart.md >}}). + - Explore input and output bindings via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Bindings API reference documentation]({{< ref bindings_api.md >}}). + - Browse the supported [input and output bindings component specs]({{< ref supported-bindings >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/configuration/_index.md b/daprdocs/content/en/developing-applications/building-blocks/configuration/_index.md index 59acf29b9..3974707d0 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/configuration/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/configuration/_index.md @@ -5,3 +5,11 @@ linkTitle: "Configuration" weight: 80 description: Manage and be notified of application configuration changes --- + +{{% alert title="More about Dapr Configuration" color="primary" %}} + Learn more about how to use Dapr Configuration: + - Try the [Configuration quickstart]({{< ref configuration-quickstart.md >}}). + - Explore configuration via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Configuration API reference documentation]({{< ref configuration_api.md >}}). + - Browse the supported [configuration component specs]({{< ref supported-configuration-stores >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/cryptography/_index.md b/daprdocs/content/en/developing-applications/building-blocks/cryptography/_index.md index 7b62e737c..664e94b6a 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/cryptography/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/cryptography/_index.md @@ -4,4 +4,11 @@ title: "Cryptography" linkTitle: "Cryptography" weight: 110 description: "Perform cryptographic operations without exposing keys to your application" ---- \ No newline at end of file +--- + +{{% alert title="More about Dapr Cryptography" color="primary" %}} + Learn more about how to use Dapr Cryptography: + - Try the [Cryptography quickstart]({{< ref cryptography-quickstart.md >}}). + - Explore cryptography via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Browse the supported [cryptography component specs]({{< ref supported-cryptography >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/distributed-lock/_index.md b/daprdocs/content/en/developing-applications/building-blocks/distributed-lock/_index.md index e9364c573..9b9924508 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/distributed-lock/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/distributed-lock/_index.md @@ -5,3 +5,10 @@ linkTitle: "Distributed lock" weight: 90 description: Distributed locks provide mutually exclusive access to shared resources from an application. --- + +{{% alert title="More about Dapr Distributed Lock" color="primary" %}} + Learn more about how to use Dapr Distributed Lock: + - Explore distributed locks via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Distributed Lock API reference documentation]({{< ref distributed_lock_api.md >}}). + - Browse the supported [distributed locks component specs]({{< ref supported-locks >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/observability/_index.md b/daprdocs/content/en/developing-applications/building-blocks/observability/_index.md index 265a1bca1..6b456a7d7 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/observability/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/observability/_index.md @@ -6,7 +6,10 @@ weight: 60 description: See and measure the message calls to components and between networked services --- -This section includes guides for development in the context of observability. To learn more about observability in Dapr, see: - -- [A general overview of the observability concept]({{< ref observability-concept >}}) in Dapr -- [Operations guidance on monitoring]({{< ref monitoring >}}) +{{% alert title="More about Dapr Observability" color="primary" %}} + Learn more about how to use Dapr Observability Lock: + - Explore observability via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Observability API reference documentation]({{< ref health_api.md >}}). + - Read the [general overview of the observability concept]({{< ref observability-concept >}}) in Dapr. + - Learn the [operations perspective and guidance on monitoring]({{< ref monitoring >}}). +{{% /alert %}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/_index.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/_index.md index a6c894a5a..df3fb8b7a 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/_index.md @@ -5,3 +5,11 @@ linkTitle: "Publish & subscribe" weight: 30 description: Secure, scalable messaging between services --- + +{{% alert title="More about Dapr Pub/sub" color="primary" %}} + Learn more about how to use Dapr Pub/sub: + - Try the [Pub/sub quickstart]({{< ref pubsub-quickstart.md >}}). + - Explore pub/sub via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Pub/sub API reference documentation]({{< ref pubsub_api.md >}}). + - Browse the supported [pub/sub component specs]({{< ref supported-pubsub >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/secrets/_index.md b/daprdocs/content/en/developing-applications/building-blocks/secrets/_index.md index 0a82e79c5..43179c9d9 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/secrets/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/secrets/_index.md @@ -5,3 +5,11 @@ linkTitle: "Secrets management" weight: 70 description: Securely access secrets from your application --- + +{{% alert title="More about Dapr Secrets" color="primary" %}} + Learn more about how to use Dapr Secrets: + - Try the [Secrets quickstart]({{< ref secrets-quickstart.md >}}). + - Explore secrets via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Secrets API reference documentation]({{< ref secrets_api.md >}}). + - Browse the supported [secrets component specs]({{< ref supported-secret-stores >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/_index.md b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/_index.md index 011c8b2e4..f59f106c5 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/_index.md @@ -5,3 +5,10 @@ linkTitle: "Service invocation" weight: 10 description: Perform direct, secure, service-to-service method calls --- + +{{% alert title="More about Dapr Service Invocation" color="primary" %}} + Learn more about how to use Dapr Service Invocation: + - Try the [Service Invocation quickstart]({{< ref serviceinvocation-quickstart.md >}}). + - Explore service invocation via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Service Invocation API reference documentation]({{< ref service_invocation_api.md >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/state-management/_index.md b/daprdocs/content/en/developing-applications/building-blocks/state-management/_index.md index fd6f95bdb..5b4a0ecb9 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/state-management/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/state-management/_index.md @@ -5,3 +5,11 @@ linkTitle: "State management" weight: 20 description: Create long running stateful services --- + +{{% alert title="More about Dapr State Management" color="primary" %}} + Learn more about how to use Dapr State Management: + - Try the [State Management quickstart]({{< ref statemanagement-quickstart.md >}}). + - Explore state management via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [State Management API reference documentation]({{< ref state_api.md >}}). + - Browse the supported [state management component specs]({{< ref supported-state-stores >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/building-blocks/state-management/state-store-ttl.md b/daprdocs/content/en/developing-applications/building-blocks/state-management/state-store-ttl.md index 2f7ecbf26..e5b22d3e0 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/state-management/state-store-ttl.md +++ b/daprdocs/content/en/developing-applications/building-blocks/state-management/state-store-ttl.md @@ -77,7 +77,7 @@ using Dapr.Client; await client.SaveStateAsync(storeName, stateKeyName, state, metadata: new Dictionary() { { - "metadata.ttlInSeconds", "120" + "ttlInSeconds", "120" } }); ``` diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/_index.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/_index.md index a8617ef85..a1b87a20a 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/_index.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/_index.md @@ -4,4 +4,11 @@ title: "Workflow" linkTitle: "Workflow" weight: 100 description: "Orchestrate logic across various microservices" ---- \ No newline at end of file +--- + +{{% alert title="More about Dapr Workflow" color="primary" %}} + Learn more about how to use Dapr Workflow: + - Try the [Workflow quickstart]({{< ref workflow-quickstart.md >}}). + - Explore workflow via any of the supporting [Dapr SDKs]({{< ref sdks >}}). + - Review the [Workflow API reference documentation]({{< ref workflow_api.md >}}). +{{% /alert %}} \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/integrations/Azure/azure-kubernetes-service-extension.md b/daprdocs/content/en/developing-applications/integrations/Azure/azure-kubernetes-service-extension.md index aae063bff..ccfda323f 100644 --- a/daprdocs/content/en/developing-applications/integrations/Azure/azure-kubernetes-service-extension.md +++ b/daprdocs/content/en/developing-applications/integrations/Azure/azure-kubernetes-service-extension.md @@ -14,4 +14,10 @@ The recommended approach for installing Dapr on AKS is to use the AKS Dapr exten If you install Dapr through the AKS extension, best practice is to continue using the extension for future management of Dapr _instead of the Dapr CLI_. Combining the two tools can cause conflicts and result in undesired behavior. {{% /alert %}} +Prerequisites for using the Dapr extension for AKS: +- [An Azure subscription](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) +- [The latest version of the Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) +- [An existing AKS cluster](https://learn.microsoft.com/azure/aks/tutorial-kubernetes-deploy-cluster) +- [The Azure Kubernetes Service RBAC Admin role](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#azure-kubernetes-service-rbac-admin) + {{< button text="Learn more about the Dapr extension for AKS" link="https://learn.microsoft.com/azure/aks/dapr" >}} diff --git a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md index 6dad64c9f..8bca30080 100644 --- a/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md +++ b/daprdocs/content/en/developing-applications/local-development/multi-app-dapr-run/multi-app-template.md @@ -83,7 +83,7 @@ apps: appProtocol: http appPort: 8080 appHealthCheckPath: "/healthz" - command: ["python3" "app.py"] + command: ["python3", "app.py"] appLogDestination: file # (optional), can be file, console or fileAndConsole. default is fileAndConsole. daprdLogDestination: file # (optional), can be file, console or fileAndConsole. default is file. - appID: backend # optional diff --git a/daprdocs/content/en/developing-applications/sdks/_index.md b/daprdocs/content/en/developing-applications/sdks/_index.md index 64a774f21..321d053cd 100644 --- a/daprdocs/content/en/developing-applications/sdks/_index.md +++ b/daprdocs/content/en/developing-applications/sdks/_index.md @@ -11,34 +11,25 @@ The Dapr SDKs are the easiest way for you to get Dapr into your application. Cho ## SDK packages -- **Client SDK**: The Dapr client allows you to invoke Dapr building block APIs and perform actions such as: - - [Invoke]({{< ref service-invocation >}}) methods on other services - - Store and get [state]({{< ref state-management >}}) - - [Publish and subscribe]({{< ref pubsub >}}) to message topics - - Interact with external resources through input and output [bindings]({{< ref bindings >}}) - - Get [secrets]({{< ref secrets >}}) from secret stores - - Interact with [virtual actors]({{< ref actors >}}) -- **Server extensions**: The Dapr service extensions allow you to create services that can: - - Be [invoked]({{< ref service-invocation >}}) by other services - - [Subscribe]({{< ref pubsub >}}) to topics -- **Actor SDK**: The Dapr Actor SDK allows you to build virtual actors with: - - Methods that can be [invoked]({{< ref "howto-actors.md#actor-method-invocation" >}}) by other services - - [State]({{< ref "howto-actors.md#actor-state-management" >}}) that can be stored and retrieved - - [Timers]({{< ref "howto-actors.md#actor-timers" >}}) with callbacks - - Persistent [reminders]({{< ref "howto-actors.md#actor-reminders" >}}) +Select your [preferred language below]({{< ref "#sdk-languages" >}}) to learn more about client, server, actor, and workflow packages. + +- **Client**: The Dapr client allows you to invoke Dapr building block APIs and perform each building block's actions +- **Server extensions**: The Dapr service extensions allow you to create services that can be invoked by other services and subscribe to topics +- **Actor**: The Dapr Actor SDK allows you to build virtual actors with methods, state, timers, and persistent reminders +- **Workflow**: Dapr Workflow makes it easy for you to write long running business logic and integrations in a reliable way ## SDK languages -| Language | Status | Client SDK | Server extensions | Actor SDK | -|----------|:------|:----------:|:-----------:|:---------:| -| [.NET]({{< ref dotnet >}}) | Stable | ✔ | [ASP.NET Core](https://github.com/dapr/dotnet-sdk/tree/master/examples/AspNetCore) | ✔ | -| [Python]({{< ref python >}}) | Stable | ✔ | [gRPC]({{< ref python-grpc.md >}})
[FastAPI]({{< ref python-fastapi.md >}})
[Flask]({{< ref python-flask.md >}})| ✔ | -| [Java]({{< ref java >}}) | Stable | ✔ | Spring Boot | ✔ | -| [Go]({{< ref go >}}) | Stable | ✔ | ✔ | ✔ | -| [PHP]({{< ref php >}}) | Stable | ✔ | ✔ | ✔ | -| [Javascript]({{< ref js >}}) | Stable| ✔ | | ✔ | -| [C++](https://github.com/dapr/cpp-sdk) | In development | ✔ | | -| [Rust](https://github.com/dapr/rust-sdk) | In development | ✔ | | | +| Language | Status | Client | Server extensions | Actor | Workflow | +|----------|:------|:----------:|:-----------:|:---------:|:---------:| +| [.NET]({{< ref dotnet >}}) | Stable | ✔ | [ASP.NET Core](https://github.com/dapr/dotnet-sdk/tree/master/examples/AspNetCore) | ✔ | ✔ | +| [Python]({{< ref python >}}) | Stable | ✔ | [gRPC]({{< ref python-grpc.md >}})
[FastAPI]({{< ref python-fastapi.md >}})
[Flask]({{< ref python-flask.md >}})| ✔ | ✔ | +| [Java]({{< ref java >}}) | Stable | ✔ | Spring Boot | ✔ | | +| [Go]({{< ref go >}}) | Stable | ✔ | ✔ | ✔ | | +| [PHP]({{< ref php >}}) | Stable | ✔ | ✔ | ✔ | | +| [Javascript]({{< ref js >}}) | Stable| ✔ | | ✔ | | +| [C++](https://github.com/dapr/cpp-sdk) | In development | ✔ | | | +| [Rust](https://github.com/dapr/rust-sdk) | In development | ✔ | | | | ## Further reading diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-inmemory.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-inmemory.md index 8a6a8951b..e2275a465 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-inmemory.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-inmemory.md @@ -1,13 +1,13 @@ --- type: docs -title: "In Memory" -linkTitle: "In Memory" +title: "In-memory" +linkTitle: "In-memory" description: "Detailed documentation on the In Memory pubsub component" aliases: - "/operations/components/setup-pubsub/supported-pubsub/setup-inmemory/" --- -The In Memory pub/sub component is useful for development purposes and works inside of a single machine boundary. +The in-memory pub/sub component operates within a single Dapr sidecar. This is primarily meant for development purposes. State is not replicated across multiple sidecars and is lost when the Dapr sidecar is restarted. ## Component format @@ -25,6 +25,7 @@ spec: > Note: in-memory does not require any specific metadata for the component to work, however spec.metadata is a required field. ## Related links + - [Basic schema for a Dapr component]({{< ref component-schema >}}) in the Related links section - Read [this guide]({{< ref "howto-publish-subscribe.md#step-2-publish-a-topic" >}}) for instructions on configuring pub/sub components - [Pub/Sub building block]({{< ref pubsub >}}) diff --git a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-inmemory.md b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-inmemory.md index d54277d17..17d8cc4be 100644 --- a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-inmemory.md +++ b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-inmemory.md @@ -1,20 +1,16 @@ --- type: docs -title: "In Memory" -linkTitle: "In Memory" -description: "Detailed documentation on the In Memory state component" +title: "In-memory" +linkTitle: "In-memory" +description: "Detailed documentation on the in-memory state component" aliases: - "/operations/components/setup-state-store/supported-state-stores/setup-inmemory/" --- -The In Memory state store component is useful for development purposes and works inside of a single machine boundary. - -{{% alert title="Warning" color="warning" %}} - This component **shouldn't be used for production**. It is developer only and will never be stable. If you come across a scenario and want to use it in production, you can submit an issue and discuss it with the community. - -{{% /alert %}} +The in-memory state store component maintains state in the Dapr sidecar's memory. This is primarily meant for development purposes. State is not replicated across multiple sidecars and is lost when the Dapr sidecar is restarted. ## Component format + To setup in-memory state store, create a component of type `state.in-memory`. See [this guide]({{< ref "howto-get-save-state.md#step-1-setup-a-state-store" >}}) on how to create and apply a state store configuration. ```yaml @@ -31,6 +27,7 @@ spec: > Note: While in-memory does not require any specific metadata for the component to work, `spec.metadata` is a required field. ## Related links + - [Basic schema for a Dapr component]({{< ref component-schema >}}) - Learn [how to create and configure state store components]({{< ref howto-get-save-state.md >}}) - Read more about the [state management building block]({{< ref state-management >}}) diff --git a/daprdocs/data/components/pubsub/generic.yaml b/daprdocs/data/components/pubsub/generic.yaml index 4ceabbfa6..38d775c63 100644 --- a/daprdocs/data/components/pubsub/generic.yaml +++ b/daprdocs/data/components/pubsub/generic.yaml @@ -1,6 +1,6 @@ - component: In-memory link: setup-inmemory - state: Beta + state: Stable version: v1 since: "1.7" features: diff --git a/daprdocs/data/components/state_stores/generic.yaml b/daprdocs/data/components/state_stores/generic.yaml index dd7cacd13..a4ffcd52c 100644 --- a/daprdocs/data/components/state_stores/generic.yaml +++ b/daprdocs/data/components/state_stores/generic.yaml @@ -77,9 +77,9 @@ query: false - component: In-memory link: setup-inmemory - state: Developer-only + state: Stable version: v1 - since: "1.8" + since: "1.9" features: crud: true transactions: true diff --git a/daprdocs/layouts/partials/page-meta-links.html b/daprdocs/layouts/partials/page-meta-links.html index 6bf0d95a1..7e87f5bd2 100644 --- a/daprdocs/layouts/partials/page-meta-links.html +++ b/daprdocs/layouts/partials/page-meta-links.html @@ -1,28 +1,53 @@ -{{ if .Path }} -{{ $pathFormatted := replace .Path "\\" "/" }} -{{ $gh_repo := ($.Param "github_repo") }} -{{ $gh_subdir := ($.Param "github_subdir") }} -{{ $gh_project_repo := ($.Param "github_project_repo") }} -{{ $gh_branch := (default "master" ($.Param "github_branch")) }} -{{ if $gh_repo }} -
-{{ $gh_repo_path := printf "%s/content/%s" $gh_branch $pathFormatted }} -{{ if and ($gh_subdir) (.Site.Language.Lang) }} -{{ $gh_repo_path = printf "%s/%s/content/%s/%s" $gh_branch $gh_subdir ($.Site.Language.Lang) $pathFormatted }} -{{ else if .Site.Language.Lang }} -{{ $gh_repo_path = printf "%s/content/%s/%s" $gh_branch ($.Site.Language.Lang) $pathFormatted }} -{{ else if $gh_subdir }} -{{ $gh_repo_path = printf "%s/%s/content/%s" $gh_branch $gh_subdir $pathFormatted }} -{{ end }} -{{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }} -{{ $createURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }} -{{ $issuesURL := printf "%s/issues/new/choose" $gh_repo}} -{{ $newPageStub := resources.Get "stubs/new-page-template.md" }} -{{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL }} -{{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS }} +{{ if .File }} +{{ $pathFormatted := replace .File.Path "\\" "/" -}} +{{ $gh_repo := ($.Param "github_repo") -}} +{{ $gh_url := ($.Param "github_url") -}} +{{ $gh_subdir := ($.Param "github_subdir") -}} +{{ $gh_project_repo := ($.Param "github_project_repo") -}} +{{ $gh_branch := (default "main" ($.Param "github_branch")) -}} +
+{{ if $gh_url -}} + {{ warnf "Warning: use of `github_url` is deprecated. For details see https://www.docsy.dev/docs/adding-content/repository-links/#github_url-optional" -}} + {{ T "post_edit_this" }} +{{ else if $gh_repo -}} + {{ $gh_repo_path := printf "%s/content/%s" $gh_branch $pathFormatted -}} + {{ if and ($gh_subdir) (.Site.Language.Lang) -}} + {{ $gh_repo_path = printf "%s/%s/content/%s/%s" $gh_branch $gh_subdir ($.Site.Language.Lang) $pathFormatted -}} + {{ else if .Site.Language.Lang -}} + {{ $gh_repo_path = printf "%s/content/%s/%s" $gh_branch ($.Site.Language.Lang) $pathFormatted -}} + {{ else if $gh_subdir -}} + {{ $gh_repo_path = printf "%s/%s/content/%s" $gh_branch $gh_subdir $pathFormatted -}} + {{ end -}} - {{ T "post_edit_this" }} - {{ T "post_create_issue" }} + {{/* Adjust $gh_repo_path based on path_base_for_github_subdir */ -}} + {{ $ghs_base := $.Param "path_base_for_github_subdir" -}} + {{ $ghs_rename := "" -}} + {{ if reflect.IsMap $ghs_base -}} + {{ $ghs_rename = $ghs_base.to -}} + {{ $ghs_base = $ghs_base.from -}} + {{ end -}} + {{ with $ghs_base -}} + {{ $gh_repo_path = replaceRE . $ghs_rename $gh_repo_path -}} + {{ end -}} + + {{ $viewURL := printf "%s/tree/%s" $gh_repo $gh_repo_path -}} + {{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path -}} + {{ $issuesURL := printf "%s/issues/new/choose" $gh_repo -}} + {{ $newPageStub := resources.Get "stubs/new-page-template.md" -}} + {{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL -}} + {{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS -}} + + {{ T "post_edit_this" }} + {{ T "post_create_issue" }} + + {{ with $gh_project_repo -}} + {{ $project_issueURL := printf "%s/issues/new/choose" . -}} + {{ T "post_create_project_issue" }} + {{ end -}} + +{{ end -}} +{{ with .CurrentSection.AlternativeOutputFormats.Get "print" -}} + {{ T "print_entire_section" }} +{{ end }}
-{{ end }} -{{ end }} +{{ end -}} \ No newline at end of file