From a8ac192107e2e9417aa56db6dccc1901f74dd3fc Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:35:31 +0530 Subject: [PATCH 1/7] Added sample for Breadcrumb index jsonld --- .env.sample | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env.sample b/.env.sample index 096468c..0eb257c 100644 --- a/.env.sample +++ b/.env.sample @@ -11,3 +11,5 @@ CUSTOM_REPLACE_VALUES="value_1", "value_2" # To replace ld+json data for the root index file use following variable ROOT_INDEX_JSONLD={"@context":"http://schema.org","@type":"Organization"} +# To add breadcrumb ld+json data for the root index file use following variable +BREADCRUMB_INDEX_JSONLD={"@context":"https://schema.org","@type":"BreadcrumbList"} From 3a9fbcdbd08c1f44768996c850e904a1804efdf1 Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:38:40 +0530 Subject: [PATCH 2/7] Added extra args for breadcrumb json ld data --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 62a95ed..1aad0bc 100644 --- a/action.yml +++ b/action.yml @@ -17,7 +17,10 @@ inputs: description: "Comma separated associated values for the item in custom_replace_keys" required: false root_index_jsonld: - description: "ld+json data for the root index file" + description: "Replace ld+json data in the root index file" + required: false + breadcrumb_root_index_jsonld: + description: "Add breadcrumb ld+json data to the root index file" required: false s3_bucket_name: description: "S3 bucket name to upload static HTML files" @@ -40,6 +43,7 @@ runs: - ${{ inputs.custom_replace_keys }} - ${{ inputs.custom_replace_values }} - ${{ inputs.root_index_jsonld }} + - ${{ inputs.breadcrumb_root_index_jsonld }} - ${{ inputs.s3_bucket_name }} - ${{ inputs.aws_access_key_id }} - ${{ inputs.aws_secret_access_key }} From 705a2c9002f58224557fc87db793b504966c4e02 Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:39:22 +0530 Subject: [PATCH 3/7] Update .env.sample --- .env.sample | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.sample b/.env.sample index 0eb257c..1ab23e8 100644 --- a/.env.sample +++ b/.env.sample @@ -9,7 +9,7 @@ AWS_DEFAULT_REGION=us-east-1 CUSTOM_REPLACE_KEYS="key_1", "key_2" CUSTOM_REPLACE_VALUES="value_1", "value_2" -# To replace ld+json data for the root index file use following variable +# To replace ld+json data in the root index file use following variable ROOT_INDEX_JSONLD={"@context":"http://schema.org","@type":"Organization"} -# To add breadcrumb ld+json data for the root index file use following variable -BREADCRUMB_INDEX_JSONLD={"@context":"https://schema.org","@type":"BreadcrumbList"} +# To add breadcrumb ld+json data in the root index file use following variable +BREADCRUMB_ROOT_INDEX_JSONLD={"@context":"https://schema.org","@type":"BreadcrumbList"} From 534f6f4e96b08e00035b06615f7a50d048537940 Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:40:19 +0530 Subject: [PATCH 4/7] Update entrypoint.sh --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index cd2b0c8..7d5a201 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,6 +6,7 @@ if [[ $# -gt 0 && ${GITHUB_ACTIONS} -eq true ]]; then export CUSTOM_REPLACE_KEYS=${INPUT_CUSTOM_REPLACE_KEYS} export CUSTOM_REPLACE_VALUES=${INPUT_CUSTOM_REPLACE_VALUES} export ROOT_INDEX_JSONLD=${INPUT_ROOT_INDEX_JSONLD} + export BREADCRUMB_ROOT_INDEX_JSONLD=${INPUT_BREADCRUMB_ROOT_INDEX_JSONLD} export S3_BUCKET_NAME=${INPUT_S3_BUCKET_NAME} export AWS_ACCESS_KEY_ID=${INPUT_AWS_ACCESS_KEY_ID} export AWS_SECRET_ACCESS_KEY=${INPUT_AWS_SECRET_ACCESS_KEY} From 49567cc2fa17b7ffbc266fbdf3dcea562420a21a Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:18:46 +0530 Subject: [PATCH 5/7] Update run.sh --- run.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/run.sh b/run.sh index 5ecf71d..cefaba5 100755 --- a/run.sh +++ b/run.sh @@ -8,6 +8,7 @@ # - CUSTOM_REPLACE_KEYS (comma separated list of items that needs to be replaced from the items in CUSTOM_REPLACE_VALUES at the same index) # - CUSTOM_REPLACE_VALUES (associated values for the item in CUSTOM_REPLACE_KEYS) # - ROOT_INDEX_JSONLD (LD+JSON data that needs to be replaced in root index.html page) +# - BREADCRUMB_ROOT_INDEX_JSONLD (Breadcrumb LD+JSON data that needs to be added in root index.html page) # - S3_BUCKET_NAME (S3 bucket name to upload static HTML files) # - AWS_ACCESS_KEY_ID # - AWS_SECRET_ACCESS_KEY @@ -118,6 +119,18 @@ if [[ ! -z "${ROOT_INDEX_JSONLD}" ]]; then echo "***** ld+json data replaced in index.html *****" fi + +if [[ ! -z "${BREADCRUMB_ROOT_INDEX_JSONLD}" ]]; then + echo " " + echo "***** Adding Breadcrumb ld+json data in index.html *****" + + sed "/" ${blog_dir}/index.html >${blog_dir}/_index.html + mv -f ${blog_dir}/_index.html ${blog_dir}/index.html + + echo "***** Breadcrumb ld+json data added in index.html *****" +fi + if [[ ! -z ${S3_BUCKET_NAME} ]]; then echo " " echo "***** Started uploading files to S3 *****" From 57bf392eccc82d8a1ab3545798f3732c6567d63c Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:20:19 +0530 Subject: [PATCH 6/7] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index f45d0b2..560e952 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,11 @@ Additionally, it also provides the functionality to upload the static HTML files **Optional** ld+json data for the root index file. + +## `breadcrumb_root_index_jsonld` + +**Optional** Breadcrumb ld+json data for the root index file. + ## `s3_bucket_name` **Optional** S3 bucket name to upload static HTML files. From 55e40630d44fff5b5c2d47b6355435c3b5252325 Mon Sep 17 00:00:00 2001 From: Abhishek Roy <43261722+roy-cse@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:21:19 +0530 Subject: [PATCH 7/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 560e952..36b3961 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,12 @@ Additionally, it also provides the functionality to upload the static HTML files ## `root_index_jsonld` -**Optional** ld+json data for the root index file. +**Optional** Replace ld+json data in the root index file. ## `breadcrumb_root_index_jsonld` -**Optional** Breadcrumb ld+json data for the root index file. +**Optional** Add Breadcrumb ld+json data in the root index file. ## `s3_bucket_name`