Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Fetch upstream (#5)
Browse files Browse the repository at this point in the history
* fix(daattali#744): Escape special characters in title (daattali#745)

* add matt artist as sponsor

* Fix margin top alignment issue on Safari (daattali#750)

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Remove references to any public Staticman API instance (daattali#775)

* Update CHANGELOG.md

* Adding option for Medium Social Link at footer  (daattali#784)

* Itch.io social link (daattali#788)

* Update CHANGELOG.md

* Add support for Cloudflare analytics (daattali#798)

* Include Reddit in share options of posts (daattali#815)

* add search to the navbar using 'post_search' config param

* Update CHANGELOG.md

* ui: make sure search results dont have underline until hovered

* search feature: make sure page scrollbar disappears when searching but a scrollbar for search items shows if needed

* update changelog

Co-authored-by: Dmitry <[email protected]>
Co-authored-by: Dean Attali <[email protected]>
Co-authored-by: Amy Troschinetz <[email protected]>
Co-authored-by: Dean Attali <[email protected]>
Co-authored-by: Vincent Tam <[email protected]>
Co-authored-by: Diksha Verma <[email protected]>
Co-authored-by: Emaleth <[email protected]>
Co-authored-by: Ari Kalfus <[email protected]>
Co-authored-by: Leedan <[email protected]>
Co-authored-by: Marco Blessing <[email protected]>
  • Loading branch information
11 people authored Aug 2, 2021
1 parent 5e52982 commit 6a84cef
Show file tree
Hide file tree
Showing 12 changed files with 237 additions and 5 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG-SA.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v5.0.0 (2020-11-21)
## 📅 21-08-08

Initial version of this SA edition implemented. It's based on `beautiful-jekyll 5.0.0` -> commit `8b41236`.
- 📌 Merge upstream changes to commit `30a757d
`
## 📅 v5.0.0 (2020-11-21)

- Initial version of this SA edition implemented. It's based on `beautiful-jekyll 5.0.0` -> commit `8b41236`.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
## Unreleased version

- Added `post_search` config setting that creates a Search button in the navbar (older websites need to set `post_search: true` to enable this feature) (#770)
- Slightly reworked margins and position for avatar image to resolve an alignment issue on Safari.
- Changed the width at which the navbar collapses to a higher threshold because most modern non-mobile browsers are >1000px
- Fixed bug where navbar secondary level dropdown items didn't inherit the same colour as the primary navbar links
- Fixed bug where the navbar "burger" collapsed button didn't always revert back to a light colour
- Fixed bug where using an image as a navbar title did not render in GitHub Project pages that did not have a custom domain
- Fixed issue where image thumbnails on the feed page were always forced into a square rather than maintaining a proper image aspect ratio
- Added support for Patreon in the social network links in the footer
- Added support for Patreon, Medium, and Itch.io in the social network links in the footer (#783, #788)
- Fixed bug where special characters in the title led to broken share tags (#744)
- Updated staticman from using v2 (public servers) to v3 (private servers) due to the public servers becoming obsolete (#775)
- Added support for Cloudflare Analytics (#797)
- Added Reddit in share options of posts (#815)

## v5.0.0 (2020-09-15)

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ with the hosting in [GDPR](https://gdpr.eu/) affected countries.

# Features

Check out [*What's New?*](https://beautifuljekyll.com/updates/) to see the latest features.
__Check out [*What's New?*](https://beautifuljekyll.com/updates/) to see the latest features.__

- **SIMPLE**: The primary goal of Beautiful Jekyll is to allow literally *anyone* to create a website in a few minutes.
- **Modern**: Uses the latest best practices and technologies to achieve nearly perfect scores on Google Chrome's Audit.
Expand All @@ -41,8 +41,9 @@ Check out [*What's New?*](https://beautifuljekyll.com/updates/) to see the lates
- **Battle-tested**: By using Beautiful Jekyll, you'll be joining 50,000+ users enjoying this theme since 2015.
- **SEO and social media support**: Customize how your site looks on Google and when shared on social media.
- **Comments support**: Add comments to any page using either [Disqus](https://disqus.com/), [Facebook comments](https://developers.facebook.com/docs/plugins/comments), [Utterances](https://utteranc.es/), or [Staticman](https://staticman.net).
- **Tags**: Any blog post can be tagged with keywords, and an index page showing all the tags is automatically generated.
- **Tags**: Any blog post can be tagged with keywords, and an index page is automatically generated.
- **Analytics**: Easily integrate Google Analytics, or other analytics platforms, to track visits to your website.
- **Search**: Let users easily find any page using a Search button in the navigation bar.
- **Photos support**: Any page can have a full-width cover photo and thumbnail.
- **RSS**: An RSS feed is automatically created, so you can even host a podcast easily with Beautiful Jekyll.

Expand Down
7 changes: 7 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ social-network-links:
twitter: daattali
patreon: DeanAttali
youtube: c/daattali
# medium: yourname
# reddit: yourname
# linkedin: daattali
# xing: yourname
Expand Down Expand Up @@ -88,6 +89,9 @@ feed_show_excerpt: true
# Whether or not to show a list of tags below each post preview in the feed page
feed_show_tags: true

# Add a search button to the navbar
post_search: true

# The keywords to associate with your website, for SEO purposes
#keywords: "my,list,of,keywords"

Expand Down Expand Up @@ -132,6 +136,9 @@ footer-link-col: "#404040"
# Fill in your Google Analytics ID to track your website using Google Analytics
#google_analytics: ""

# Fill in your Cloudflare Analytics beacon token to track your website using Cloudflare Analytics
#cloudflare_analytics: ""

# Google Tag Manager ID
#gtm: ""

Expand Down
8 changes: 8 additions & 0 deletions _includes/cloudflare_analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if site.cloudflare_analytics %}
<!-- Cloudflare Web Analytics -->
<script defer
src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "{{ site.cloudflare_analytics}}"}'>
</script>
<!-- End Cloudflare Web Analytics -->
{% endif %}
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{% include gtag.html %}
{% include gtm_head.html %}
{% include google_analytics.html %}
{% include cloudflare_analytics.html %}

{% if layout.common-ext-css %}
{% for css in layout.common-ext-css %}
Expand Down
10 changes: 10 additions & 0 deletions _includes/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
</li>
{%- endif -%}
{%- endfor -%}
{% if site.post_search %}
<li class="nav-item">
<a class="nav-link" id="nav-search-link" href="#" title="Search">
<span id="nav-search-icon" class="fa fa-search"></span>
<span id="nav-search-text">Search</span>
</a>
</li>
{%- endif -%}
</ul>
</div>

Expand All @@ -50,3 +58,5 @@
{% endif %}

</nav>

{% include search.html %}
39 changes: 39 additions & 0 deletions _includes/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% if site.post_search %}

<div id="beautifuljekyll-search-overlay">

<div id="nav-search-exit" title="Exit search"></div>
<input type="text" id="nav-search-input" placeholder="Search">
<ul id="search-results-container"></ul>

<script src="https://unpkg.com/simple-jekyll-search@latest/dest/simple-jekyll-search.min.js"></script>
<script>
var searchjson = '[ \
{% for post in site.posts %} \
{ \
"title" : "{% if post.title != "" %}{{ post.title | escape }}{% else %}{{ post.excerpt | strip_html | escape | strip }}{%endif%}", \
"category" : "{{ post.tags | join: \', \' }}", \
"url" : "{{ site.baseurl }}{{ post.url }}", \
"date" : "{{ post.date | date: "%B %e, %Y" | default: "January 1, 1970" }}" \
}, \
{% endfor %} \
{% for page in site.html_pages %}{% if page.title != "{title}" and page.title != "404 - Page not found" %} \
{ \
"title" : "{% if page.title != "" %}{{ page.title | escape }}{% else %}{{ page.excerpt | strip_html | escape | strip }}{% endif %}", \
"category" : "{% if page.tags %}{{ page.tags | join: \', \' }}{% else %}page{% endif %}", \
"url" : "{{ site.baseurl }}{{ page.url }}", \
"date" : "{{ page.date | date: '%B %e, %Y' | default: "January 1, 1970" }}" \
}{% unless forloop.last %},{% endunless %} \
{% endif %}{% endfor %} \
]';
searchjson = JSON.parse(searchjson);

var sjs = SimpleJekyllSearch({
searchInput: document.getElementById('nav-search-input'),
resultsContainer: document.getElementById('search-results-container'),
json: searchjson
});
</script>
</div>

{% endif %}
24 changes: 24 additions & 0 deletions _includes/social-networks-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,29 @@
</a>
</li>
{%- endif -%}

{%- if site.social-network-links.medium -%}
<li class="list-inline-item">
<a href="https://medium.com/@{{ site.social-network-links.medium }}" title="Medium">
<span class="fa-stack fa-lg" aria-hidden="true">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-medium fa-stack-1x fa-inverse"></i>
</span>
<span class="sr-only">Medium</span>
</a>
</li>
{%- endif -%}

{%- if site.social-network-links.itchio -%}
<li class="list-inline-item">
<a href="https://{{ site.social-network-links.itchio }}.itch.io/" title="Itchio">
<span class="fa-stack fa-lg" aria-hidden="true">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-itch-io fa-stack-1x fa-inverse"></i>
</span>
<span class="sr-only">Itchio</span>
</a>
</li>
{%- endif -%}

</ul>
8 changes: 8 additions & 0 deletions _includes/social-share.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
</a>
{% endif %}

{% if site.share-links-active.reddit %}
<a href="https://www.reddit.com/submit?url={{ page.url | absolute_url | url_encode }}"
class="btn btn-social-icon btn-reddit" title="Share on Reddit">
<span class="fab fa-fw fa-reddit" aria-hidden="true"></span>
<span class="sr-only">Reddit</span>
</a>
{% endif %}

</section>

{% endif %}
101 changes: 101 additions & 0 deletions assets/css/beautifuljekyll.css
Original file line number Diff line number Diff line change
Expand Up @@ -993,3 +993,104 @@ pre {
display: block;
margin: 0 auto;
}

/* Search bar */
#beautifuljekyll-search-overlay {
display: none;
z-index: 999999;
position: fixed;
background: rgba(0,0,0,0.9);
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
padding: 1rem;
}
#nav-search-exit {
position: absolute;
top: 1.5rem;
cursor: pointer;
right: 25%;
margin-right: 2rem;
color: #555;
font-size: 2rem;
line-height: 2rem;
font-weight: bold;
}
#nav-search-exit:hover {
color: #000;
}
#nav-search-input {
text-align: center;
background: #e7edee;
margin: auto;
display: block;
font-size: 2rem;
width: 50%;
transition: width 300ms ease;
color: #222;
border-radius: 5rem;
outline: none;
border: none;
padding: 0 3rem;
}
@media (max-width: 1199px) {
#nav-search-input {
width: 75%;
}
#nav-search-exit {
right: 12.5%;
}
}
@media (max-width: 767px) {
#nav-search-input {
width: 100%;
}
#nav-search-exit {
right: 0;
}
}
#nav-search-input:focus {
background: #f3f8fe;
box-shadow: 0px 0.15rem 1rem #e7f4ff;
outline: none;
}

#nav-search-input::placeholder {
color: #777;
}

#search-results-container {
list-style: none;
padding-left: unset;
margin-top: 1.5rem;
color: #fff;
font-size: 1.5rem;
max-height: calc(100vh - 6.5rem);
overflow-y: auto;
}
#search-results-container a {
color: #fff;
text-decoration: none;
}
#search-results-container a:hover {
color: #fff;
text-decoration: underline;
}

#nav-search-icon {
display: inline-block;
}
#nav-search-text {
display: none;
}

@media (max-width: 1199px) {
#nav-search-icon {
display: none;
}
#nav-search-text {
display: inline-block;
}
}
26 changes: 26 additions & 0 deletions assets/js/beautifuljekyll.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ var BeautifulJekyllJS = {

// show the big header image
BeautifulJekyllJS.initImgs();

BeautifulJekyllJS.initSearch();
},

initNavbar : function() {
Expand Down Expand Up @@ -108,6 +110,30 @@ var BeautifulJekyllJS = {
} else {
$(".img-desc").hide();
}
},

initSearch : function() {
if (!document.getElementById("beautifuljekyll-search-overlay")) {
return;
}

$("#nav-search-link").click(function(e) {
e.preventDefault();
$("#beautifuljekyll-search-overlay").show();
$("#nav-search-input").focus().select();
$("body").addClass("overflow-hidden");
});
$("#nav-search-exit").click(function(e) {
e.preventDefault();
$("#beautifuljekyll-search-overlay").hide();
$("body").removeClass("overflow-hidden");
});
$(document).on('keyup', function(e) {
if (e.key == "Escape") {
$("#beautifuljekyll-search-overlay").hide();
$("body").removeClass("overflow-hidden");
}
});
}
};

Expand Down

0 comments on commit 6a84cef

Please sign in to comment.