Skip to content

Commit

Permalink
fix the position of content by adding top-padding for body
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanzhangxiao committed Jan 14, 2024
1 parent dc58212 commit 479a83e
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 17 deletions.
7 changes: 5 additions & 2 deletions _includes/entity-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ <h4 class="card-title">{{ include.title }}</h4>
{% endif %}
</div>

<div style="border-top-color: transparent" class="card-footer bg-body">
{% if include.labels.size > 0 %}
<!-- <div style="border-top-color: transparent" class="card-footer bg-body"> -->
<div class="card-footer">
{% for label in include.labels %}
<span class="badge bg-primary">{{ label }}</span>
<span class="badge {% if include.type == 'reading' %}bg-primary{% elsif include.type == 'experience' %}bg-success{% elsif include.type == 'assessment' %}bg-danger{% endif %}">{{ label }}</span>
{% endfor %}
</div>
{% endif %}
<a href="{{ include.url }}" class="stretched-link"></a>
</div>
</div>
5 changes: 3 additions & 2 deletions _layouts/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
</head>
<body>

<div class="navbar navbar-expand-lg {{site.morea_theme_navbar_bg}}">
<!--<div class="navbar navbar-expand-lg bg-primary fixed-top">-->
<div class="navbar navbar-expand-lg bg-primary fixed-top" data-bs-theme="dark" style>
<!-- <div class="navbar navbar-expand-lg {{site.morea_theme_navbar_bg}} fixed-top"> -->
<!-- <div class="navbar navbar-expand-lg bg-primary fixed-top"> -->
<div class="container">
<a class="navbar-brand" href="{{ site.baseurl }}/index.html"> {{ site.name }} </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Expand Down
3 changes: 0 additions & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<div class="container">
{{ content }}
</div>
<div class="table-of-contents">
<!-- Table of Contents will be automatically inserted here -->
</div>
{% else %}
{{ content }}
{% endif %}
7 changes: 4 additions & 3 deletions _layouts/module.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: default
---

{% include breadcrumb-3.html %}

<div class="container">
Expand Down Expand Up @@ -51,7 +52,7 @@ <h3>{{ outcome.title }}</h3>
{% unless page.morea_page.morea_readings.size == 0 %}
<div class="{% cycle 'section-background-1', 'section-background-2' %}">
<div class="container">
<h2>Readings</h2>
<h2 class="text-primary">Readings</h2>

<div class="row">
{% for page_id in page.morea_page.morea_readings %}
Expand All @@ -66,7 +67,7 @@ <h2>Readings</h2>
{% unless page.morea_page.morea_experiences.size == 0 %}
<div class="{% cycle 'section-background-1', 'section-background-2' %}">
<div class="container">
<h2>Experiential Learning</h2>
<h2 class="text-success">Experiential Learning</h2>
<div class="row">
{% for page_id in page.morea_page.morea_experiences %}
{% assign experience = site.morea_page_table[page_id] %}
Expand All @@ -80,7 +81,7 @@ <h2>Experiential Learning</h2>
{% unless page.morea_page.morea_assessments.size == 0 %}
<div class="{% cycle 'section-background-1', 'section-background-2' %}">
<div class="container">
<h2>Assessments</h2>
<h2class="text-danger">Assessments</h2>
<div class="row">
{% for page_id in page.morea_page.morea_assessments %}
{% assign assessment = site.morea_page_table[page_id] %}
Expand Down
2 changes: 1 addition & 1 deletion assessments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ title: Assessments
<div class="row">
{% for page_id in module.morea_assessments %}
{% assign assessment = site.morea_page_table[page_id] %}
{% include entity-card.html url=assessment.morea_url title=assessment.title summary=assessment.morea_summary labels=assessment.morea_labels outcomes=assessment.morea_outcomes_assessed_titles %}
{% include entity-card.html type="assessment" url=assessment.morea_url title=assessment.title summary=assessment.morea_summary labels=assessment.morea_labels outcomes=assessment.morea_outcomes_assessed_titles %}
{% endfor %}
</div>
</div>
Expand Down
14 changes: 14 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
/* Use this file to make simple customizations to your site theme. */

/* Add top padding to the body so that the content starts at the correct position when the navbar is fixed-top */
body {
padding-top: 60px; /* Height for larger screens */
}

@media (max-width: 768px) {
body {
padding-top: 100px; /* Increased height for smaller screens */
}
}


/* Make link anchors aware of sticky navbar */
:target {
scroll-margin-top: 60px;
Expand Down Expand Up @@ -31,11 +43,13 @@
.section-background-1 {
padding-top: 1em;
padding-bottom: 1em;
background-color: var(--bs-gray-100);
}

.section-background-2 {
padding-top: 1em;
padding-bottom: 1em;
background-color: var(--bs-white);
}

h1, h2, h3 {
Expand Down
2 changes: 1 addition & 1 deletion experiences/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ title: Experiences
<div class="row">
{% for page_id in module.morea_experiences %}
{% assign experience = site.morea_page_table[page_id] %}
{% include entity-card.html url=experience.morea_url title=experience.title summary=experience.morea_summary labels=experience.morea_labels %}
{% include entity-card.html type="experience" url=experience.morea_url title=experience.title summary=experience.morea_summary labels=experience.morea_labels %}
{% endfor %}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: default
title: Modules
---

{% include breadcrumb-2.html %}

<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion morea/01-introduction/module-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ morea_assessments:
morea_type: module
morea_icon_url: /morea/01-introduction/introduction.jpg
morea_start_date: "2024-01-07"
morea_end_date: "2024-01-07T23:00"
morea_end_date: "2024-01-08T23:00"
morea_labels:
morea_sort_order: 10
---
Expand Down
3 changes: 0 additions & 3 deletions morea/02-overview/reading-building-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ morea_type: reading
morea_labels:
---

* TOC
{:toc}

# Basic building blocks

Here is the block diagram of a typical <span style="color: red;">point-to-point</span> communication system. The top row are blocks in the transmitter, and the bottom row are blocks in the receiver.
Expand Down
2 changes: 1 addition & 1 deletion readings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ title: Readings
<div class="row">
{% for page_id in module.morea_readings %}
{% assign reading = site.morea_page_table[page_id] %}
{% include entity-card.html url=reading.morea_url title=reading.title summary=reading.morea_summary labels=reading.morea_labels %}
{% include entity-card.html type="reading" url=reading.morea_url title=reading.title summary=reading.morea_summary labels=reading.morea_labels %}
{% endfor %}
</div>
</div>
Expand Down

0 comments on commit 479a83e

Please sign in to comment.