Enable ToC on page layout with Chirpy theme

I want to enable ToC on both page and post layouts. Here’s the modified template I am using.
I have tried with changing the _layouts/page.html in the following way:

---
layout: default
refactor: true
panel_includes:
  - toc
---

{% include lang.html %}

{% include toc-status.html %}

<article class="px-1" data-toc="{{ enable_toc }}">
  {% if page.layout == 'page' or page.collection == 'pages' %}
    {% assign page_key = page.title | downcase %}
    {% assign title = site.data.locales[lang].pages[page_key] | default: page.title %}
    <header>
      <h1>
        {{ title }}
      </h1>
      {% if page.description %}
      <blockquote class="prompt-info">{{ page.description }}</blockquote>
      {% endif %}
    </header>

  {% if enable_toc %}
    <div id="toc-bar" class="d-flex align-items-center justify-content-between invisible">
      <span class="label text-truncate">{{ page.title }}</span>
      <button type="button" class="toc-trigger btn me-1">
        <i class="fa-solid fa-list-ul fa-fw"></i>
      </button>
    </div>

    <button id="toc-solo-trigger" type="button" class="toc-trigger btn btn-outline-secondary btn-sm">
      <span class="label ps-2 pe-1">{{- site.data.locales[lang].panel.toc -}}</span>
      <i class="fa-solid fa-angle-right fa-fw"></i>
    </button>

    <dialog id="toc-popup" class="p-0">
      <div class="header d-flex flex-row align-items-center justify-content-between">
        <div class="label text-truncate py-2 ms-4">{{- page.title -}}</div>
        <button id="toc-popup-close" type="button" class="btn mx-1 my-1 opacity-75">
          <i class="fas fa-close"></i>
        </button>
      </div>
      <div id="toc-popup-content" class="px-4 py-3 pb-4"></div>
    </dialog>
  {% endif %}

    <div class="content" style="text-align: justify;">
      {{ content }}
    </div>
  {% else %}
    {{ content }}
  {% endif %}
    <!-- lastmod date -->
    <!-- pageviews -->
</article>

and tested with following change in _pages/about.md:

---
layout: page
title: About
permalink: /about/
toc: true
---

# H1 

## H2

### H3 

The ToC is not appearing. How to resolve it?

If you check your code, there is no mention to page.toc, but there is a variable like enable_toc in your _layouts/page.html. Maybe change from enable_toc to page.toc.

I tried what you suggested. It didn’t work.
If you check _layouts/post.html, it has enable_toc too and it works.

The steps I have followed to enable ToC on the page layout: How to enable ToC on the layout `page`? · cotes2020/jekyll-theme-chirpy · Discussion #2241 · GitHub

I’ve never used the Chirpy template. Have you tried asking this question in their Q&A section?

Yes, I posted there, as you see in my previous reply - I have shared the link.
The issue seems solved. But my solution might have triggered something that disabled the PWA pop-up of the theme.

I have posted here (Enable PWA (Update Popup) and Deployment Issue) and on GitHub (Enable PWA (Update Popup) and Deployment Issue · cotes2020/jekyll-theme-chirpy · Discussion #2258 · GitHub) as well.