[gtk-web/new-website: 114/191] changed the link structure
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-web/new-website: 114/191] changed the link structure
- Date: Thu, 21 Nov 2019 12:28:03 +0000 (UTC)
commit 9205050d523f07557f5a9be92d63ec70ce4a8f2b
Author: ravgeetdhillon <ravgeetdhillon gmail com>
Date: Sat Jul 20 13:27:06 2019 +0530
changed the link structure
_config.yml | 2 +-
_data/navigation.yml | 15 +++++++++++--
_includes/footer.html | 9 +++++---
_includes/header.html | 61 +++++++++++++++++++++++++--------------------------
assets/css/index.css | 5 ++---
docs.html | 2 +-
features.html | 2 +-
index.html | 16 ++++++++------
8 files changed, 63 insertions(+), 49 deletions(-)
---
diff --git a/_config.yml b/_config.yml
index 7f4fa25..796f896 100644
--- a/_config.yml
+++ b/_config.yml
@@ -56,7 +56,7 @@ defaults:
type: docs
values:
layout: documentation
- navbar_dark: true
+ navbar_type: dark
# website statistics
diff --git a/_data/navigation.yml b/_data/navigation.yml
index 6e0e0ae..38876d2 100644
--- a/_data/navigation.yml
+++ b/_data/navigation.yml
@@ -12,7 +12,8 @@ menu_links_sections:
# href: the location where the link points to
# header: set this to 'true' if the link should be present in the header, else set 'false'
# footer: set this to 'true' if the link should be present in the footer, else set 'false'
-# section: if footer is set to 'true', specify the name of the section the link belongs. Make sure that
the section exists.
+# section: if footer is set to 'true', specify the name of the section the link belongs. Make sure that
the section exists
+# external: if the link provided in href is an external link i.e it points to a link outside of the
website, then set this to 'false', else don't add this attribute
menu_links:
- name: GTK
href: /
@@ -44,6 +45,7 @@ menu_links:
header: false
footer: true
section: Project
+ external: true
- name: Community
href: /community/
header: true
@@ -54,6 +56,7 @@ menu_links:
header: false
footer: true
section: Project
+ external: true
- name: Releases
href: /releases/
header: false
@@ -64,13 +67,15 @@ menu_links:
header: false
footer: true
section: Support
+ external: true
- name: Gitlab
href: https://gitlab.gnome.org/GNOME/gtk/
header: true
footer: true
section: Project
+ external: true
- name: Mailing Lists
- href: /mailing-lists
+ href: /mailing-lists/
header: false
footer: true
section: Company
@@ -79,16 +84,19 @@ menu_links:
header: false
footer: true
section: Support
+ external: true
- name: Request a feature
href: https://gitlab.gnome.org/GNOME/gtk/
header: false
footer: true
section: Support
+ external: true
- name: Code of Conduct
href: https://wiki.gnome.org/Foundation/CodeOfConduct/
header: false
footer: true
section: Company
+ external: true
- name: Donate
href: http://www.gnome.org/foundation/
header: false
@@ -141,6 +149,8 @@ sidebar_sections:
# title: the display text for the section
# name: the name of the `.md` file in '/collection/_docs', to which the link should point
# section: the name of the section the link belongs to
+# external: if the link provided in href is an external link i.e it points to a link outside of the
website, then set this to 'false', else dont add this attribute
+
sidebar_links:
- title: Mono Develop
name: mono-develop
@@ -164,6 +174,7 @@ sidebar_links:
name: gtk3
section: API References
href: https://developer.gnome.org/gtk3/
+ external: true
- title: GTK4
name: gtk4
section: API References
diff --git a/_includes/footer.html b/_includes/footer.html
index 536c452..6831d06 100644
--- a/_includes/footer.html
+++ b/_includes/footer.html
@@ -9,8 +9,7 @@
<a href="https://www.gnome.org/"><img src="{{ '/assets/img/logo-gnome-horizontal.svg' | prepend:
site.url }}"
class="img-fluid pb-2" width="100" /></a>
<p>GTK is hosted by GNOME.</p>
- <p>GTK is maintained by the core team of <strong><a href="/community#contributors"
class="text-muted">contributors</a></strong>
- under GNOME.</p>
+ <p>GTK is maintained by the core team of <strong><a href="{{ '/community#contributors' | prepend:
site.url }}" class="text-muted">contributors</a></strong> under GNOME.</p>
{% assign date_arr = site.time | date_to_string | split: ' ' %}
{% assign year = date_arr[2] %}
<p>© 2007-{{ year }}, The GTK Project. All Rights Reserved.</p>
@@ -25,7 +24,11 @@
<ul class="list-unstyled text-small">
{% for link in menu_links %}
{% if link.footer %}
- <li><a href="{{ link.href }}" class="text-info">{{ link.name }}</a></li>
+ {% if link.external %}
+ <li><a href="{{ link.href }}" class="text-info">{{ link.name }}</a></li>
+ {% else %}
+ <li><a href="{{ link.href | prepend: site.url }}" class="text-info">{{ link.name
}}</a></li>
+ {% endif %}
{% endif %}
{% endfor %}
</ul>
diff --git a/_includes/header.html b/_includes/header.html
index a4f6883..aa9b1c6 100644
--- a/_includes/header.html
+++ b/_includes/header.html
@@ -30,35 +30,34 @@
</head>
<body>
- {% if page.navbar_dark %}
- <header class="navbar small bg-dark">
- {% else %}
- <header class="navbar small">
- {% endif %}
- <nav class="container navbar-expand-md px-0 px-md-3">
- {% if page.navbar_dark %}
- <a href="/" class="navbar-brand text-white"><img src="{{ '/assets/img/logo-gtk.png' | prepend:
site.url }}" width="40" height="40" /><strong>GTK</strong></a>
- {% else %}
- <a href="/" class="navbar-brand text-dark"><img src="{{ '/assets/img/logo-gtk.png' | prepend: site.url
}}" width="40" height="40" /><strong>GTK</strong></a>
- {% endif %}
- <a class="btn navbar-toggler border-0 p-0" role="button" data-toggle="collapse"
data-target="#navbarSupportedContent">
- <i class="fas fa-ellipsis-h"></i>
- </a>
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <ul class="navbar-nav ml-auto">
- {% assign menu_links = site.data.navigation.menu_links %}
- {% for link in menu_links %}
- {% assign page_split = page.url | split: '/' %}
- {% assign page_type = page_split[1] | capitalize %}
- {% if link.header %}
- {% if page.navbar_dark %}
- <li class="nav-item"><a href="{{ link.href }}" class="nav-link text-light float-right">{{
link.name }}</a></li>
- {% else %}
- <li class="nav-item"><a href="{{ link.href }}" class="nav-link text-dark float-right">{{
link.name }}</a></li>
+ {% if page.navbar_type == 'dark' %}
+ {% assign text_color = 'white' %}
+ {% assign bg_color = 'dark' %}
+ {% elsif page.navbar_type == 'light' %}
+ {% assign text_color = 'dark' %}
+ {% assign bg_color = 'white %}
+ {% endif %}
+ <header class="navbar small bg-{{ bg_color }}">
+ <nav class="container navbar-expand-md px-0 px-md-3">
+ <a href="{{ site.url }}" class="navbar-brand text-{{ text_color }}"><img src="{{
'/assets/img/logo-gtk.png' | prepend: site.url }}" width="40" height="40" /><strong>GTK</strong></a>
+ <a class="btn navbar-toggler border-0 p-0" role="button" data-toggle="collapse"
data-target="#navbarSupportedContent">
+ <i class="fas fa-ellipsis-h"></i>
+ </a>
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ <ul class="navbar-nav ml-auto">
+ {% assign menu_links = site.data.navigation.menu_links %}
+ {% for link in menu_links %}
+ {% assign page_split = page.url | split: '/' %}
+ {% assign page_type = page_split[1] | capitalize %}
+ {% if link.header %}
+ {% if link.external %}
+ <li class="nav-item"><a href="{{ link.href }}" class="nav-link float-right text-{{
text_color }}">{{ link.name }}</a></li>
+ {% else %}
+ <li class="nav-item"><a href="{{ link.href | prepend: site.url }}" class="nav-link
float-right text-{{ text_color }}">{{ link.name }}</a></li>
+ {% endif %}
{% endif %}
- {% endif %}
- {% endfor %}
- </ul>
- </div>
- </nav>
-</header>
\ No newline at end of file
+ {% endfor %}
+ </ul>
+ </div>
+ </nav>
+ </header>
\ No newline at end of file
diff --git a/assets/css/index.css b/assets/css/index.css
index 2d302d3..7f2fca3 100644
--- a/assets/css/index.css
+++ b/assets/css/index.css
@@ -144,7 +144,6 @@
height: auto !important;
}
}
-
html, body {
overflow-x: hidden;
scroll-behavior: smooth;
@@ -169,8 +168,8 @@ html, body {
.op-7 {
opacity: 0.75;
}
-.nav-item {
- transition: 0.15s ease;
+.nav-item .nav-link {
+ transition: 0.15s ease-in-out;
}
.nav-item:hover .nav-link,
.nav-item:focus .nav-link {
diff --git a/docs.html b/docs.html
index 909004a..4282c36 100644
--- a/docs.html
+++ b/docs.html
@@ -1,5 +1,5 @@
---
-navbar_dark: true
+navbar_type: dark
---
diff --git a/features.html b/features.html
index 904ffab..a8719d6 100644
--- a/features.html
+++ b/features.html
@@ -1,5 +1,5 @@
---
-
+navbar_type: dark
---
{%- include header.html -%}
diff --git a/index.html b/index.html
index 83e80e2..6126b39 100644
--- a/index.html
+++ b/index.html
@@ -1,4 +1,6 @@
---
+navbar_type: light
+
page_main_heading: Create interfaces, that users just love
page_main_heading_description: Offering a complete set of widgets, GTK is suitable for projects ranging from
small one-off tools to complete application suites.
@@ -78,13 +80,13 @@ news_and_events_list:
<h1 class="display-4 pb-3">{{ page.page_main_heading }}</h1>
<span class="text-muted pb-3">{{ page.page_main_heading_description | markdownify }}</span>
<div class="pb-3 d-flex">
- <a href="/docs/" class="btn btn-md btn-primary" role="button">Learn GTK</a>
+ <a href="{{ '/docs/' | prepend: site.url }}" class="btn btn-md btn-primary" role="button">Learn
GTK</a>
<div class="dropdown">
<a class="btn btn-md btn-outline-secondary dropdown-toggle ml-2" href="#" role="button"
id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Downloads</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
- <a href="/downloads/linux/" class="dropdown-item"><i class="fab fa-linux"></i> Linux</a>
- <a href="/downloads/windows/" class="dropdown-item"><i class="fab fa-windows"></i> Windows</a>
- <a href="/downloads/macos/" class="dropdown-item"><i class="fab fa-apple"></i> MacOS</a>
+ <a href="{{ '/downloads/linux/' | prepend: site.url }}" class="dropdown-item"><i class="fab
fa-linux"></i> Linux</a>
+ <a href="{{ '/downloads/windows/' | prepend: site.url }}" class="dropdown-item"><i class="fab
fa-windows"></i> Windows</a>
+ <a href="{{ '/downloads/macos/' | prepend: site.url }}" class="dropdown-item"><i class="fab
fa-apple"></i> MacOS</a>
</div>
</div>
</div>
@@ -123,11 +125,11 @@ news_and_events_list:
<h6>{{ case.title }}</h6>
<span class="text-muted small">{{ case.description }}</span>
<br>
- <a href="/usecases/{{ case.title }}/" class="small border-bottom text-decoration-none
border-primary">Read More</a>
+ <a href="{{'/usecases/' | prepend: site.url | append: case.title }}/" class="small border-bottom
text-decoration-none border-primary">Read More</a>
</div>
{% endfor %}
<div class="col-12 text-center pt-3 pt-md-4">
- <a href="/usecases/" class="btn btn-md btn-outline-primary" role="button">Discover Usecases</a>
+ <a href="{{'/usecases/' | prepend: site.url }}" class="btn btn-md btn-outline-primary"
role="button">Discover Usecases</a>
</div>
</div>
</div>
@@ -274,7 +276,7 @@ news_and_events_list:
<h2 class="font-weight-light mb-3">{{ page.tutorials_main_heading }}</h2>
<span class="text-muted">{{ page.tutorials_main_heading_description | markdownify }}</span>
<div>
- <a href="/docs/" class="btn btn-sm btn-outline-primary" role="button">Developers Guide</a>
+ <a href="{{ '/docs/' | prepend: site.url }}" class="btn btn-sm btn-outline-primary"
role="button">Developers Guide</a>
</div>
</div>
</div>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]