+{{% /blocks/lead %}}
+
+{{< blocks/section color="light" >}}
+
+{{% blocks/feature icon="fab fa-github" title="Contributions welcome!" url="https://github.com/kubernetes-sigs/jobset" %}}
+We do a [Pull Request](https://github.com/kubernetes-sigs/jobset/pulls) contributions workflow on **GitHub**. New users are always welcome!
+{{% /blocks/feature %}}
+
+{{% blocks/feature icon="fab fa-slack" title="Connect with us" url="https://kubernetes.slack.com" %}}
+Talk to contributors on [#wg-batch](https://kubernetes.slack.com/messages/wg-batch) channel
+{{% /blocks/feature %}}
+
+{{% blocks/feature icon="fa fa-envelope" title="Join the mailing group" url="https://groups.google.com/a/kubernetes.io/g/wg-batch" %}}
+Join the conversation on the [mailing group](https://groups.google.com/a/kubernetes.io/g/wg-batch)
+{{% /blocks/feature %}}
+
+
+{{< /blocks/section >}}
diff --git a/site/content/en/docs/_index.md b/site/content/en/docs/_index.md
new file mode 100755
index 00000000..f72f7329
--- /dev/null
+++ b/site/content/en/docs/_index.md
@@ -0,0 +1,8 @@
+---
+title: "Documentation"
+linkTitle: "Documentation"
+weight: 20
+menu:
+ main:
+ weight: 20
+---
diff --git a/site/content/en/docs/concepts/_index.md b/site/content/en/docs/concepts/_index.md
new file mode 100644
index 00000000..0427edb4
--- /dev/null
+++ b/site/content/en/docs/concepts/_index.md
@@ -0,0 +1,152 @@
+---
+title: "Concepts"
+linkTitle: "Concepts"
+weight: 4
+description: >
+ Core Jobset Concepts
+no_list: true
+---
+
+## Jobset
+
+A JobSet creates one or more Jobs. It allows you to create sets of jobs of different or identical templates, and control their lifecycle together.
+
+## Running an Example JobSet
+
+Here is an example JobSet. It runs a distributed PyTorch training workload.
+
+```yaml
+apiVersion: jobset.x-k8s.io/v1alpha2
+kind: JobSet
+metadata:
+ name: pytorch
+spec:
+ replicatedJobs:
+ - name: workers
+ template:
+ spec:
+ parallelism: 4
+ completions: 4
+ backoffLimit: 0
+ template:
+ spec:
+ containers:
+ - name: pytorch
+ image: gcr.io/k8s-staging-jobset/pytorch-resnet:latest
+ ports:
+ - containerPort: 3389
+ env:
+ - name: MASTER_ADDR
+ value: "pytorch-workers-0-0.pytorch-workers"
+ - name: MASTER_PORT
+ value: "3389"
+ command:
+ - bash
+ - -xc
+ - |
+ torchrun --nproc_per_node=1 --master_addr=$MASTER_ADDR --master_port=$MASTER_PORT resnet.py --backend=gloo
+```
+
+To list all the jobs that belong to a JobSet, you can use a command like this:
+
+```shell
+kubectl get jobs --selector=jobset.sigs.k8s.io/jobset-name=pytorch
+```
+
+The output is similar to
+
+```
+NAME COMPLETIONS DURATION AGE
+pytorch-workers-0 0/4 6m12s 6m12s
+```
+
+To list all the pods that belong to a JobSet, you can use a command like this:
+
+```shell
+kubectl get pods --selector=jobset.sigs.k8s.io/jobset-name=pytorch
+```
+
+The output is similar to
+
+```
+NAME READY STATUS RESTARTS AGE
+pytorch-workers-0-0-tcngx 1/1 Running 0 13m
+pytorch-workers-0-1-sbhxs 1/1 Running 0 13m
+pytorch-workers-0-2-5m6d6 1/1 Running 0 13m
+pytorch-workers-0-3-mn8c8 1/1 Running 0 13m
+```
+
+## JobSet defaults for Jobs and Pods
+
+- Job [`completionMode`](https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode) is defaulted to `Indexed`
+- Pod [`restartPolicy`](https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-template) is defaulted to `OnFailure`
+
+
+## JobSet labels
+
+JobSet labels will have `jobset.x-k8s.io/` prefix. JobSet sets the following labels on both the jobs and pods:
+- `jobset.sigs.k8s.io/jobset-name`: `.metadata.name`
+- `jobset.sigs.k8s.io/replicatedjob-name`: `.spec.replicatedJobs[*].name`
+- `jobset.sigs.k8s.io/replicatedjob-replicas`: `.spec.replicatedJobs[*].replicas`
+- `jobset.sigs.k8s.io/job-index`: ordinal index of a job within a `spec.replicatedJobs[*]`
+
+
+## ReplicatedJob
+
+The list `.spec.replicatedJobs` allows the user to define groups of Jobs of different templates.
+
+Each entry of `.spec.replicatedJobs` defines a Job template in `spec.replicatedJobs[*].template`,
+and the number replicas that should be created in `spec.replicatedJobs[*].replicas`. When
+unset, it is defaulted to 1.
+
+Each Job in each `spec.replicatedJobs` gets a different job-index in the range 0 to `.spec.replicatedJob[*].replicas-1`.
+The Job name will have the following format: `--`.
+
+
+### DNS hostnames for Pods
+
+By default, JobSet configures DNS for Pods by creating a headless service for each `spec.replicatedJobs`.
+The headless service name, which determines the subdomain, is `.metadata.name-.spec.replicatedJobs[*].name`
+
+To list all the headless services that belong to a JobSet, you can use a command like this:
+
+```shell
+kubectl get services --selector=jobset.sigs.k8s.io/jobset-name=pytorch
+```
+
+The output is similar to
+
+```
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+pytorch-workers ClusterIP None 25m
+```
+
+### Exclusive Job to topology placement
+
+The JobSet annotation `alpha.jobset.sigs.k8s.io/exclusive-topology` defines 1:1 job to topology placement.
+For example, consider the case where the nodes are assigned a rack label. To optimize for network
+performance, we want to assign each job exclusively to one rack. This can be done as follows:
+
+```yaml
+apiVersion: jobset.x-k8s.io/v1alpha2
+kind: JobSet
+metadata:
+ name: pytorch
+ annotations:
+ alpha.jobset.sigs.k8s.io/exclusive-topology: rack
+spec:
+ replicatedJobs:
+ - name: workers
+ template:
+ spec:
+ ...
+```
+
+## JobSet termination
+
+A JobSet is marked as successful when ALL the Jobs it created completes successfully.
+
+A JobSet failure is counted when ANY of its child Jobs fail. `spec.failurePolicy.maxRestarts` defines how many times
+to automatically restart the JobSet. A restart is done by recreating all child jobs.
+
+A JobSet is terminally failed when the number of failures reaches `spec.failurePolicy.maxRestarts`
diff --git a/site/content/en/docs/contribution guidelines/_index.md b/site/content/en/docs/contribution guidelines/_index.md
new file mode 100644
index 00000000..839fd044
--- /dev/null
+++ b/site/content/en/docs/contribution guidelines/_index.md
@@ -0,0 +1,32 @@
+---
+title: "Contribution Guidelines"
+linkTitle: "Contribution Guidelines"
+weight: 9
+description: >
+ How to contribute to Jobset
+---
+
+Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://git.k8s.io/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt:
+
+_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._
+
+## Getting Started
+
+We have full documentation on how to get started contributing here:
+
+
+
+- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
+- [Kubernetes Contributor Guide](https://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](https://git.k8s.io/community/contributors/guide#contributing)
+- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet) - Common resources for existing developers
+
+## Mentorship
+
+- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
+
+## Contact Information
+
+- [Slack](https://kubernetes.slack.com/messages/sig-scheduling)
+- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-scheduling)
diff --git a/site/content/en/docs/faq/_index.md b/site/content/en/docs/faq/_index.md
new file mode 100755
index 00000000..17a54030
--- /dev/null
+++ b/site/content/en/docs/faq/_index.md
@@ -0,0 +1,61 @@
+---
+
+title: "Faqs"
+linkTitle: "Faqs"
+weight: 10
+date: 2022-02-14
+description: >
+ Frequently asked questions about JobSet.
+no_list: true
+---
+
+## Troubleshooting Common Issues
+
+## 1. "Webhook not available" error when attempting to create a JobSet
+
+Example error: `failed calling webhook "mjobset.kb.io": failed to call webhook: Post "https://jobset-webhook-service.jobset-system.svc:443/mutate-jobset-x-k8s-io-v1alpha1-jobset?timeout=10s": no endpoints available for service "jobset-webhook-service"`
+
+**Cause**: Usually this means the JobSet controller manager Deployment pods are unschedulable for some reason.
+
+**Solution**: Check if jobset-controller-manager deployment pods are running (`kubectl get pods -n jobset-system`).
+If they are in a `Pending` state, describe the pod to see why (`kubectl describe pod -n jobset-system`), you
+should see a message in the pod Events indicating why they are unschedulable. The solution will depend on why the pods
+are unschedulable. For example, if they unschedulable due to insufficient CPU/memory, the solution is to scale up your CPU node pools or turn on autoscaling.
+
+## 2. JobSet is created but child jobs and/or pods are not being created
+
+Check the jobset controller logs to see why the jobs are not being created:
+
+- `kubectl get pods -n jobset-system`
+- `kubectl logs -n jobset-system`
+
+Inspect the logs to look for one of the following issues:
+
+1. Error message indicating an index does not exist (example: ` "error": "Index with name field:.metadata.controller does not exist"`)
+
+**Cause**: In older versions of JobSet (older than v0.2.1) if the indexes could not be built for some reason, the JobSet controller would log the error and launch anyway. This resulted in confusing behavior later when trying to create JobSets, where the controller would encounter this "index not found" error and not be able to create any jobs. This bug was fixed
+in v0.2.1 so the JobSet controller now fails fast and exits with an error if indexes cannot be built.
+
+**Solution**: Uninstall JobSet and re-install using the latest release (or at minimum, JobSet v0.2.1). See [installation guide](/docs/setup/install.md) for the commands to do this.
+
+2. Validation error creating Jobs and/or Services, indicating the Job/Service name is invalid.
+
+**Cause**: Generated child job names or headless services names (which are derived from the JobSet name and ReplicatedJob names) are not valid.
+
+**Solution**: Validation has been added to fail the JobSet creation if the generated job/service names will be invalid, but the fix is not included in a release yet. For now, to resolve this simply delete/recreate the JobSet with a name such that:
+
+* The generated Job names (format: `---.`) will be valid DNS labels as defined in RFC 1035.
+* The subdomain name (manually specified in `js.Spec.Network.Subdomain` or defaulted to the JobSet name if unspecified) is both [RFC 1123](https://datatracker.ietf.org/doc/html/rfc1123) compliant and [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035) compliant.
+
+
+## 3. Using JobSet + Kueue, preempted workloads never resume
+
+Look at the JobSet controller logs and you'll probably see an error like this:
+
+```
+ ERROR resuming jobset {"controller": "jobset", "controllerGroup": "jobset.x-k8s.io", "controllerKind": "JobSet", "JobSet": {"name":"js","namespace":"default"}, "namespace": "default", "name": "js", "reconcileID": "e1ab5e21-586c-496e-96b7-8629cd702f3b", "jobset": {"name":"js","namespace":"default"}, "error": "jobs.batch \"js-slice-job-1\" is forbidden: User \"system:serviceaccount:jobset-system:jobset-controller-manager\" cannot update resource \"jobs/status\" in API group \"batch\" in the namespace \"default\""}
+ ```
+
+**Cause**: This could be due to a known bug in an older version of JobSet, or a known bug in an older version of Kueue. JobSet and Kueue integration requires JobSet v0.2.3+ and Kueue v0.4.1+.
+
+**Solution**: If you're using JobSet version less than v0.2.3, uninstall and re-install using a versoin >= v0.2.3 (see the JobSet [installation guide](/docs/setup/install.md) for the commands to do this). If you're using a Kueue version less than v0.4.1, uninstall and re-install using a v0.4.1 (see the Kueue [installation guide](https://kueue.sigs.k8s.io/docs/installation/) for the commands to do this).
diff --git a/site/content/en/docs/installation/_index.md b/site/content/en/docs/installation/_index.md
new file mode 100644
index 00000000..f147b2b6
--- /dev/null
+++ b/site/content/en/docs/installation/_index.md
@@ -0,0 +1,203 @@
+---
+title: "Installation"
+linkTitle: "Installation"
+weight: 2
+description: >
+ Installing Jobset to a Kubernetes Cluster
+---
+
+
+- [Before you begin](#before-you-begin)
+- [Install a released version](#install-a-released-version)
+ - [Uninstall](#uninstall)
+- [Install the latest development version](#install-the-latest-development-version)
+ - [Uninstall](#uninstall-1)
+- [Build and install from source](#build-and-install-from-source)
+ - [Uninstall](#uninstall-2)
+- [Use Cert Manager instead of internal cert](#optional-use-cert-manager-instead-of-internal-cert)
+
+
+
+## Before you begin
+
+Make sure the following conditions are met:
+
+- A Kubernetes cluster with version 1.21 or newer is running. Learn how to [install the Kubernetes tools](https://kubernetes.io/docs/tasks/tools/).
+- Your cluster has at least 1 node with 2+ CPUs and 512+ MB of memory available for the JobSet controller manager Deployment to run on. **NOTE: On some cloud providers, the default node machine type will not have sufficient resources to run the JobSet controller manager and all the required kube-system pods, so you'll need to use a larger
+machine type for your nodes.**
+- The `SuspendJob` [feature gate][feature_gate] is enabled. In Kubernetes 1.22 or newer, the feature gate is enabled by default and reached stable in Kubernetes 1.24.
+- The kubectl command-line tool has communication with your cluster.
+
+
+
+
+
+
+
+
+
+
+
+
+
+[feature_gate]: https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
+
+
+# Install a released version
+
+To install a released version of Jobset in your cluster, run the following command:
+
+```shell
+VERSION=v0.3.1
+kubectl apply --server-side -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml
+```
+
+### Optional: Add metrics scraping for prometheus-operator
+
+If you are using [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
+to scrape metrics from jobset components, run the following command:
+
+```shell
+VERSION=v0.3.1
+kubectl apply -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/prometheus.yaml
+```
+
+If you are using [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus), metrics
+can be scraped without performing this step.
+
+
+## Uninstall
+
+To uninstall a released version of JobSet from your cluster, run the following command:
+
+```shell
+VERSION=v0.3.1
+kubectl delete -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Install the latest development version
+
+To install the latest development version of Jobset in your cluster, run the
+following command:
+
+```shell
+kubectl apply --server-side -k github.com/kubernetes-sigs/jobset/config/default?ref=main
+```
+
+The controller runs in the `jobset-system` namespace.
+
+### Optional: Add metrics scraping for prometheus-operator
+
+If you are using [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
+to scrape metrics from jobset components, you need to run the following command so it can access
+the metrics:
+
+```shell
+kubectl apply --server-side -k github.com/kubernetes-sigs/jobset/config/prometheus?ref=main
+```
+If you are using [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus), metrics
+can be scraped without performing this step.
+
+## Uninstall
+
+To uninstall JobSet, run the following command:
+
+```shell
+kubectl delete -k github.com/kubernetes-sigs/jobset/config/default
+```
+
+# Build and install from source
+
+To build Jobset from source and install Jobset in your cluster, run the following
+commands:
+
+```sh
+git clone https://github.com/kubernetes-sigs/jobset.git
+cd jobset
+IMAGE_REGISTRY=/ make image-push deploy
+```
+
+### Optional: Add metrics scraping for prometheus-operator
+
+If you are using [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
+to scrape metrics from jobset components, you need to run the following command so it has access
+to the metrics:
+
+```shell
+make prometheus
+```
+
+If you are using [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus), metrics
+can be scraped without performing this step.
+
+## Uninstall
+
+To uninstall JobSet, run the following command:
+
+```sh
+make undeploy
+```
+
+# Optional: Use cert manager instead of internal cert
+JobSet webhooks use an internal certificate by default. However, if you wish to use cert-manager (which
+supports cert rotation), instead of internal cert, you can by performing the following steps.
+
+First, install cert-manager on your cluster by running the following command:
+
+```shell
+VERSION=v1.11.0
+kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/$VERSION/cert-manager.yaml
+```
+
+Next, in the file ``jobset/config/default/kustomization.yaml`` replace ``../components/internalcert`` with
+``../components/certmanager`` then uncomment all the lines beginning with ``[CERTMANAGER]``.
+
+Finally, apply these configurations to your cluster with ``kubectl apply --server-side -k config/default``.
\ No newline at end of file
diff --git a/site/content/en/docs/reference/_index.md b/site/content/en/docs/reference/_index.md
new file mode 100644
index 00000000..3abcdcfa
--- /dev/null
+++ b/site/content/en/docs/reference/_index.md
@@ -0,0 +1,7 @@
+---
+title: "Reference"
+linkTitle: "Reference"
+weight: 9
+description: >
+ This section contains the Jobset reference information.
+---
diff --git a/site/content/en/docs/reference/metrics.md b/site/content/en/docs/reference/metrics.md
new file mode 100644
index 00000000..9213c49c
--- /dev/null
+++ b/site/content/en/docs/reference/metrics.md
@@ -0,0 +1,21 @@
+---
+title: "Prometheus Metrics"
+linkTitle: "Prometheus Metrics"
+date: 2022-02-14
+description: >
+ Prometheus metrics exported by Jobset
+---
+
+## Prometheus Metrics
+
+JobSet exposes [prometheus](https://prometheus.io) metrics to monitor the health
+of the controller.
+
+## JobSet controller health
+
+Use the following metrics to monitor the health of the jobset controller:
+
+| Metric name | Type | Description | Labels |
+| ----------- | ---- | ----------- | ------ |
+| `controller_runtime_reconcile_errors_total` | Counter | The total number of reconciliation errors encountered by each controller. | `controller`: name of controller (i.e. use value `jobset` to obtain metrics for jobset controller) |
+| `controller_runtime_reconcile_time_seconds` | Histogram | The latency of a reconciliation attempt in seconds. | `controller`: name of controller (i.e. use value `jobset` to obtain metrics for jobset controller) |
diff --git a/site/content/en/docs/tasks/_index.md b/site/content/en/docs/tasks/_index.md
new file mode 100755
index 00000000..47d9c330
--- /dev/null
+++ b/site/content/en/docs/tasks/_index.md
@@ -0,0 +1,61 @@
+---
+
+title: "Tasks"
+linkTitle: "Tasks"
+weight: 6
+date: 2022-02-14
+description: >
+ Doing common Jobset tasks
+no_list: true
+---
+
+## PyTorch Examples
+
+In [pytorch](examples/pytorch), there are two examples using pytorch
+
+- [mnist](examples/pytorch/mnist.yaml)
+- [resnet](examples/pytorch/resnet.yaml)
+
+Each of these examples demonstrate how you use the JobSet API to run pytorch jobs.
+
+Machine Learning images can be quite large so it may take some time to pull the images.
+
+## Simple Examples
+
+In [simple](examples/simple), we have some examples demonstrating features for the JobSet.
+
+- [success-policy](examples/simple/driver-worker-success-policy.yaml)
+- [max-restarts](examples/simple/max-restarts.yaml)
+- [paralleljobs](examples/simple/paralleljobs.yaml)
+
+[Success Policy](examples/simple/driver-worker-success-policy.yaml) demonstrates an example of utilizing `successPolicy`.
+Success Policy allows one to specify when to mark a JobSet as success.
+This example showcases an example of using the success policy to mark the JobSet as successful if the worker replicated job completes.
+
+[Max Restarts](examples/simple/max-restarts.yaml) demonstrates an example of utilizing `failurePolicy`.
+Failure Policy allows one to control how many restarts a JobSet can do before declaring the JobSet as failed.
+
+[Parallel Jobs](examples/simple/paralleljobs.yaml) demonstates how we can submit multiple replicated jobs in a jobset.
+
+## Tensorflow Examples
+
+In [tensorflow](examples/tensorflow), we have some examples demonstrating how to use Tensorflow with a JobSet.
+
+- [mnist](examples/tensorflow/mnist.yaml)
+
+[mnist](examples/tensorflow/mnist.yaml) runs an example job for a single epoch.
+You can view the progress of your jobs via `kubectl logs jobs/tensorflow-tensorflow-0`.
+
+```
+Train Epoch: 1 [0/60000 (0%)] loss=2.3130, accuracy=12.5000
+Train Epoch: 1 [6400/60000 (11%)] loss=0.4624, accuracy=86.4171
+Train Epoch: 1 [12800/60000 (21%)] loss=0.3381, accuracy=90.0109
+Train Epoch: 1 [19200/60000 (32%)] loss=0.2724, accuracy=91.8916
+Train Epoch: 1 [25600/60000 (43%)] loss=0.2367, accuracy=92.9941
+Train Epoch: 1 [32000/60000 (53%)] loss=0.2111, accuracy=93.7063
+Train Epoch: 1 [38400/60000 (64%)] loss=0.1925, accuracy=94.2882
+Train Epoch: 1 [44800/60000 (75%)] loss=0.1796, accuracy=94.6416
+Train Epoch: 1 [51200/60000 (85%)] loss=0.1677, accuracy=94.9945
+Train Epoch: 1 [57600/60000 (96%)] loss=0.1565, accuracy=95.3229
+Test Loss: 0.0635, Test Accuracy: 97.8400
+```
diff --git a/site/content/en/featured-background.png b/site/content/en/featured-background.png
new file mode 100644
index 00000000..07436c39
Binary files /dev/null and b/site/content/en/featured-background.png differ
diff --git a/site/content/en/search.md b/site/content/en/search.md
new file mode 100644
index 00000000..e3690fd5
--- /dev/null
+++ b/site/content/en/search.md
@@ -0,0 +1,6 @@
+---
+title: Search Results
+layout: search
+
+---
+
diff --git a/site/layouts/404.html b/site/layouts/404.html
new file mode 100644
index 00000000..4429eab8
--- /dev/null
+++ b/site/layouts/404.html
@@ -0,0 +1,19 @@
+{{ define "main"}}
+
+{{ end }}
\ No newline at end of file
diff --git a/site/layouts/partials/feedback.html b/site/layouts/partials/feedback.html
new file mode 100644
index 00000000..78e65fec
--- /dev/null
+++ b/site/layouts/partials/feedback.html
@@ -0,0 +1,61 @@
+
+
+ {{- with .content -}}
+ {{- . -}}
+ {{- else -}}
+ {{- if eq $.Page.BundleType "leaf" -}}
+ {{- /* find the file somewhere inside the bundle. Note the use of double asterisk */ -}}
+ {{- with $.Page.Resources.GetMatch (printf "**%s*" .include) -}}
+ {{- if ne .ResourceType "page" -}}
+ {{- /* Assume it is a file that needs code highlighting. */ -}}
+ {{- $codelang := $e.codelang | default ( path.Ext .Name | strings.TrimPrefix ".") -}}
+ {{- highlight .Content $codelang "" -}}
+ {{- else -}}
+ {{- .Content -}}
+ {{- end -}}
+ {{- end -}}
+ {{- else -}}
+ {{- $path := path.Join $.Page.File.Dir .include -}}
+ {{- $page := site.GetPage "page" $path -}}
+ {{- with $page -}}
+ {{- .Content -}}
+ {{- else -}}
+ {{- errorf "[%s] tabs include not found for path %q" site.Language.Lang $path -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+
+{{- end -}}
+
diff --git a/site/layouts/shortcodes/include.html b/site/layouts/shortcodes/include.html
new file mode 100644
index 00000000..0c71b0bb
--- /dev/null
+++ b/site/layouts/shortcodes/include.html
@@ -0,0 +1,43 @@
+
+{{/* Handle the "file" and "lang" named parameter or two unnamed parameter as the filepath and coding language*/}}
+{{/* The first parameter should be a relative path to the "static" directory. Ex: "examples/jobs/sample-job.yaml" */}}
+{{ if .IsNamedParams }}
+ {{ $.Scratch.Set "fparameter" ( .Get "file" ) }}
+ {{ $.Scratch.Set "lang" ( .Get "lang") }}
+{{ else }}
+ {{ $.Scratch.Set "fparameter" ( .Get 0 ) }}
+ {{ $.Scratch.Set "lang" ( .Get 1 ) }}
+{{ end }}
+
+{{/* If coding language are specified, then the static file is a code file; If not, then the static are non-code file. */}}
+{{ if eq ($.Scratch.Get "lang") "" }}
+{{ $.Scratch.Set "iscode" "false"}}
+{{ else }}
+{{ $.Scratch.Set "iscode" "true" }}
+{{ end }}
+
+{{/* `fparameter is a relative path of the static file from the `static` diretory. For exampl, `/example/simple/exclusive-placement.yaml` */}}
+{{ $.Scratch.Set "filepath" "/" }}
+{{ $.Scratch.Add "filepath" "static/" }}
+{{ $.Scratch.Add "filepath" ($.Scratch.Get "fparameter") }}
+
+{{/* If the file exists, read it and highlight it if it's code.
+Throw a compile error or print an error on the page if the file is not found */}}
+
+{{ if fileExists ($.Scratch.Get "filepath") }}
+ {{ $filename := (path.Split ($.Scratch.Get "filepath")).File }}
+ {{ $link := printf "/%s" ($.Scratch.Get "fparameter") | safeURL }}
+
The file {{ $.Scratch.Get "filepath" }} was not found.
+
+{{ else }}{{- errorf "Shortcode %q: file %q not found at %s" .Name ($.Scratch.Get "filepath") .Position -}}{{ end }}
\ No newline at end of file
diff --git a/site/layouts/shortcodes/needs-update.html b/site/layouts/shortcodes/needs-update.html
new file mode 100644
index 00000000..e0a875b3
--- /dev/null
+++ b/site/layouts/shortcodes/needs-update.html
@@ -0,0 +1,4 @@
+
+
Documentation Needs Update
+ This page needs updating. The instructions don't work for the current version of Jobset.
+