Skip to content

Commit

Permalink
add public website layout pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadAhsan252 committed Dec 13, 2024
1 parent cc69ee4 commit a927aaa
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ collections:
permalink: /news/:categories/:year-:month-:day-:title/
pages:
output: true
permalink: /:name/
permalink: //:path/

# Exclude from processing.
# The following items will not be processed, by default.
Expand Down
1 change: 1 addition & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<li><a href="{{'/news' | relative_url}}" title="">News</a></li>
<li><a href="{{'/resources' | relative_url}}">Resources</a></li>
<li><a href="{{'/contact' | relative_url}}">Contact</a></li>
<li><a href="{{'/public' | relative_url}}">Public</a></li>
</ul>
</nav>
</div>
Expand Down
21 changes: 21 additions & 0 deletions _includes/toc-mainPage-placeholder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<ol>
{% for page in loopPages %}
{% if page.path contains '_appendixes' %}
{% assign subpages = site.appendixes | where: "parent", page.id | sort: "order" %}
{% else %}
{% assign subpages = site.pages | where: "parent", page.id | sort: "order" %}
{% endif %}

{% if page.title == currentMainParent %}
{% for subpage in subpages %}
{% assign content_size = subpage.content | strip | size %}
{% if content_size > 0 %}
<li>
<!-- <a href="{{site.base_url}}{{ subpage.url }}" class="{% if currentPageUrl contains subpage.url %}active{% endif %}">{{ subpage.title }}</a>-->
<a href="{{ subpage.url | relative_url }}" class="{% if currentPageUrl contains subpage.url %}active{% endif %}">{{ subpage.title }}</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</ol>
49 changes: 49 additions & 0 deletions _includes/toc-sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% if page.path contains '_appendixes' %}
{% assign loopPages = site.appendixes | sort: "order" %}
{% else %}
{% assign loopPages = include.pages | sort: "order" %}
{% endif %}

{% for page in loopPages %}
{% if page.parents contains page.url %}active{% endif %}
{% assign content_size = page.content | strip | size %}
{% if include.currentMainParent == page.mainParent %}

{% assign pageChilds = page.childs | split:',' %}
{% for pageChild in pageChilds %}
{% assign pageChildStripped = pageChild | downcase | remove: " " %}
{% assign currentPageTitleStripped = currentPageTitle | downcase | remove: " " %}
{% if pageChildStripped == currentPageTitleStripped %}
{% assign activeParent = true %}
{% break %}
{% else %}
{% assign activeParent = false %}
{% endif %}
{% endfor %}

{% assign subpages = site.pages | where: "parent", page.id | sort: "order" %}
<li class="leaf {% if subpages.size > 0 %}expandable{% endif %} {% if currentPageUrl contains page.url %}active{% endif %} {% if activeParent %}active{% endif %}">
{% if include.level %}
{% if content_size == 0 %}
<div><span>{{ page.title }}</span></div>
{% else %}
<!-- <a href="{{site.base_url}}{{ page.url }}" class="{% if currentPageUrl contains page.url %}active{% endif %}">{{ page.title }}</a>-->
<a href="{{ page.url | relative_url }}" class="{% if currentPageUrl contains page.url %}active{% endif %}">{{ page.title }}</a>
{% endif %}
{% endif %}

{% if page.path contains '_appendixes' %}
{% if content_size != 0 %}
<a href="{{ page.url | relative_url }}" class="{% if currentPageUrl contains page.url %}active{% endif %}">{{ page.title }}</a>
{% endif %}

{% endif %}

{% if subpages.size > 0 %}
<ul class="menu nav">
{% include toc-sidebar.html pages=subpages currentMainParent=page.mainParent level="secondary" %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
44 changes: 44 additions & 0 deletions _layouts/toc-type.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
layout: default
---
<div class="container container-columns">
<div class="col-sm-9">
<ol class="breadcrumb">
<li><a href="{{ "/public" | relative_url }}">Home</a></li>
{% if page.path contains '_appendixes' %}
<!-- Do Nothing -->
{% else %}
<!-- <li><a href="/Table-of-Contents">Table of Contents</a></li> -->
{% endif %}
{% assign pageParents = page.parents | split:';' %}
{% for parent in pageParents %}
{% assign pageParentsDetails = parent| split:':' %}
<li><a href="{{pageParentsDetails[1]}}">{{pageParentsDetails[0]}}</a></li>
{% endfor %}
</ol>

{% if content.size != 1 %}
{{ content }}
{% else %}
For information on {{page.title}} see:
{% assign currentMainParent = page.mainParent %}

{% if page.path contains '_appendixes' %}
{% assign loopPages = site.appendixes | where: "parent", "/public" | sort: "order" %}
{% else %}
{% assign loopPages = site.pages | where: "parent", "/public" | sort: "order" %}
{% endif %}

{% include toc-mainPage-placeholder.html loopPages=loopPages currentMainParent=currentMainParent %}
{% endif %}

</div>
<div class="col-sm-3">
<ul class="menu-sidebar">
{% assign currentPageUrl = page.url %}
{% assign currentPageTitle = page.title %}
{% assign pages = site.pages | where: "parent", "/public" | sort: "order" %}
{% include toc-sidebar.html pages=pages currentPageUrl=currentPageUrl currentMainParent=page.mainParent currentPageTitle=currentPageTitle%}
</ul>
</div>
</div>
23 changes: 23 additions & 0 deletions _pages/public.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Introduction
layout: page
permalink: /public
parent: "/"
order: 1
---

## Links

[Charters of our current TCs](charter)

[CalConnect Major Work Projects](work-in-progress)

[Timezone changes knowledge base](DateTime)

[Calendar Fest 2021](CalendarFest)

## Disclaimer

This site is maintained by people involved in the development of calendaring and scheduling standards and/or implementations. Although the content contributors are employed by a range of commercial and non-profit organizations, this site does not represent the views or opinions of those organizations.

Please note that the authors of this site have not made any attempt to confirm support for any of the implementations, products or services listed on this site.
5 changes: 5 additions & 0 deletions _pages/public/Table-of-Contents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: toc
title: Table of Contents
---

0 comments on commit a927aaa

Please sign in to comment.