Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign #13

Merged
merged 13 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ _site
.sass-cache
.jekyll-metadata
node_modules
.jekyll-cache
.jekyll-cache
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ permalink: /quotations/:title:output_ext
# - vendor/gems/
# - vendor/ruby/

# include:
# - build/_snowpack/pkg/

# A few custom collections
collections:
quotations:
Expand Down
2 changes: 0 additions & 2 deletions _includes/foot.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<script src="{{ site.github.url }}/js/smartquotes.js"></script>
<script>smartquotes()</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-79506876-2"></script>
<script>
Expand Down
14 changes: 14 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
name="google-site-verification"
content="cwo7SJgHRGZn64HNxVPjeX-Xa_kKgb-GMfSXQCdZNZ8"
/>
<link
href="https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap"
rel="stylesheet"
/>
<script
src="{% link assets/js/index.js %}"
type="text/javascript"
defer
></script>

<!-- Twitter cards -->
<!-- <meta name="twitter:card" content="summary_large_image">
Expand Down
2 changes: 1 addition & 1 deletion _includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav>
<h2>
<a href="{{ site.github.url }}/">Q</a>
<a href="{{ site.github.url }}/">Quoke</a> -> a few quotations.
</h2>
</nav>
2 changes: 1 addition & 1 deletion _layouts/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% include head.html %}
<body>
{% include nav.html %}
<main>
<main class="author">
<section class="container">
<h1>{{ page.title }}</h1>
{% assign sortedQuotations = site.quotations | sort: 'date' | reverse %}
Expand Down
89 changes: 22 additions & 67 deletions _layouts/home.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,32 @@
<!DOCTYPE html>
<html lang="en">
{% include head.html %}

<body>
{% include nav.html %}
<header>
<h1 class="text-hero">Quoke</h1>
</header>

<main class="home">
<section class="home-section">
<hr class="vr" />

{% assign sortedTopics = site.topics | sort: 'date' | reverse %} {% for
topic in sortedTopics limit:40 %}
<span class="topic-link">
<a href="{{ site.github.url }}{{ topic.url }}">{{ topic.title }}</a>
</span>
{% endfor %}
<span class="author-link">
<a href="https://github.com/quoke/quoke.github.io/tree/master/_topics"
>Add topic</a
>
</span>

<hr class="vr" />

{% assign sortedAuthors = site.authors | sort: 'date' | reverse %} {%
for author in sortedAuthors limit:40 %}
<span class="author-link">
<a href="{{ site.github.url }}{{ author.url }}">{{ author.title }}</a>
</span>
{% endfor %}
<span class="author-link">
<a
href="https://github.com/quoke/quoke.github.io/tree/master/_authors"
>Add author</a
>
</span>

<hr class="vr" />

{% assign sortedSources = site.sources | sort: 'date' | reverse %} {%
for source in sortedSources limit:40 %}
<span class="source-link">
<a href="{{ site.github.url }}{{ source.url }}">{{ source.title }}</a>
</span>
{% endfor %}
<span class="source-link">
<a
href="https://github.com/quoke/quoke.github.io/tree/master/_sources"
>Add source</a
>
</span>

<hr class="vr" />

{% assign sortedQuotations = site.quotations | sort: 'date' | reverse %}
{% for quotation in sortedQuotations limit:40 %}
<span class="quotation-link">
<a href="{{ site.github.url }}{{ quotation.url }}"
>{{ quotation.title }}</a
>
</span>
{% endfor %}
<span class="quotation-link">
<a
href="https://github.com/quoke/quoke.github.io/tree/master/_quotations"
>Add quotation</a
>
</span>
</section>
{% assign sortedQuotations = site.quotations | sort: 'date' | reverse %}
{% for quotation in sortedQuotations limit:2 %} {% if forloop.index == 1
%}
<div class="single-quotation">
<div class="date">{{ quotation.date | date_to_long_string}}</div>
<figure class="quote">
<blockquote><q>{{ quotation.text }}</q></blockquote>
<figcaption>
<footer>
&mdash; {{ quotation.author }}{% if quotation.source %},
<cite>{{quotation.source }}</cite>
{% endif %}
</footer>
</figcaption>
</figure>
</div>
{% endif %} {% if forloop.index == 2 %}
<div class="pagination">
<a href="{{ site.github.url }}{{ quotation.url }}">next quote</a>
</div>
{% endif %} {% endfor %}
</main>

{% include foot.html %}
</body>
</html>
77 changes: 77 additions & 0 deletions _layouts/home.old.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body>
{% include nav.html %}
<!-- <header>
<h1 class="text-hero">Quoke</h1>
</header> -->

<main class="home">
<section class="home-section">
<!-- <hr class="vr" /> -->

{% assign sortedTopics = site.topics | sort: 'date' | reverse %} {% for
topic in sortedTopics limit:40 %}
<span class="topic-link">
<a href="{{ site.github.url }}{{ topic.url }}">{{ topic.title }}</a>
</span>
{% endfor %}
<span class="author-link">
<a href="https://github.com/quoke/quoke.github.io/tree/master/_topics"
>Add topic</a
>
</span>

<!-- <hr class="vr" /> -->

{% assign sortedAuthors = site.authors | sort: 'date' | reverse %} {%
for author in sortedAuthors limit:40 %}
<span class="author-link">
<a href="{{ site.github.url }}{{ author.url }}">{{ author.title }}</a>
</span>
{% endfor %}
<span class="author-link">
<a
href="https://github.com/quoke/quoke.github.io/tree/master/_authors"
>Add author</a
>
</span>

<!-- <hr class="vr" /> -->

{% assign sortedSources = site.sources | sort: 'date' | reverse %} {%
for source in sortedSources limit:40 %}
<span class="source-link">
<a href="{{ site.github.url }}{{ source.url }}">{{ source.title }}</a>
</span>
{% endfor %}
<span class="source-link">
<a
href="https://github.com/quoke/quoke.github.io/tree/master/_sources"
>Add source</a
>
</span>

<!-- <hr class="vr" /> -->

{% assign sortedQuotations = site.quotations | sort: 'date' | reverse %}
{% for quotation in sortedQuotations limit:40 %}
<span class="quotation-link">
<a href="{{ site.github.url }}{{ quotation.url }}"
>{{ quotation.title }}</a
>
</span>
{% endfor %}
<span class="quotation-link">
<a
href="https://github.com/quoke/quoke.github.io/tree/master/_quotations"
>Add quotation</a
>
</span>
</section>
</main>

{% include foot.html %}
</body>
</html>
109 changes: 33 additions & 76 deletions _layouts/quotation.html
Original file line number Diff line number Diff line change
@@ -1,84 +1,41 @@
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body>
{% include nav.html %}
<main class="quotation">
<div class="quotation">
<h1 class="mark">&ldquo;</h1>

<div class="single-quote container">
<div class="quote-content">
<blockquote>
{{ page.text }}
<!-- Check if author exists in collection -->
{% assign linkAuthor = false %}
{% for siteAuthor in site.authors %}
{% assign authorTitleSlug = siteAuthor.title | slugify: 'latin' %}
{% assign pageAuthorSlug = page.author | slugify: 'latin' %}
{% if authorTitleSlug == pageAuthorSlug %}
{% assign linkAuthor = true %}
{% endif %}
{% endfor %}

<!-- Check if source exists in collection -->
{% assign linkSource = false %}
{% for siteSource in site.sources %}
{% assign sourceTitleSlug = siteSource.title | slugify: 'latin' %}
{% assign pageSourceSlug = page.source | slugify: 'latin' %}
{% if sourceTitleSlug == pageSourceSlug %}
{% assign linkSource = true %}
{% include head.html %}
<body>
{% include nav.html %}
<main class="quotation">

<div class="single-quotation">
<div class="date">{{ page.date | date_to_long_string}}</div>
<figure class="quote">
<blockquote><q>{{ page.text }}</q></blockquote>
<figcaption>
<footer>
&mdash; {{ page.author }}{% if page.source %},
<cite>{{page.source }}</cite>
{% endif %}
{% endfor %}

{% if page.author %}
<cite class="author">&mdash;{% if linkAuthor %}<a href="{{ site.github.url }}/author/{{ page.author | slugify: 'latin' }}"><b>{{ page.author }}</b></a>{% else %}<b>{{ page.author }}</b>{% endif %}</cite>{% endif %}{% if page.source %}<cite>, {% if linkSource %}<a href="{{ site.github.url }}/source/{{ page.source | slugify: 'latin' }}">{{ page.source }}</a>{% else %}{{ page.source }}{% endif %}</cite>
{% endif %}
</blockquote>
</div>
</footer>
</figcaption>
</figure>
</div>

<h1 class="mark end-mark"></h1>

<p>
<span class="quotation-date">Added: {{ page.date | date_to_string }}</span>

<!-- {% if page.user %}
&middot;
<span class="quotation-user">by <a href="{{ site.github.url }}/@{{ page.user }}">@{{ page.user }}</a></span>
{% endif %} -->

{% if page.topics %}
&middot;
<span class="quotation-tags">
{% for topic in page.topics %}
{% assign linkTopic = false %}

<!-- Check if topic exists in topics collection -->
{% for siteTopic in site.topics %}
{% assign topicTitleSlug = siteTopic.title | slugify: 'latin' %}
{% assign pageTopicSlug = topic | slugify: 'latin' %}
{% if topicTitleSlug == pageTopicSlug %}
{% assign linkTopic = true %}
{% endif %}
{% endfor %}


{% if linkTopic %}
<span><a href="{{ site.github.url }}/topic/{{ topic | slugify: 'latin' }}">{{ topic }}</a></span>
{% else %}
<span>{{ topic }}</span>
{% endif %}
{% endfor %}
</span>
{% assign sortedQuotations = site.quotations | sort: 'date' | reverse %}
{% for quotation in sortedQuotations %}
{% if quotation.title == page.title %}
{% assign item_index = forloop.index %}
{% endif %}
</p>

<p>
<a href="https://github.com/quoke/quoke.github.io/blob/master/{{page.relative_path}}">Edit this quote</a>
</p>
</div>
</main>
{% include foot.html %}
</body>
{% endfor %}
{% assign prev_index = item_index | minus: 1 %}
{% assign next_index = item_index | plus: 1 %}
{% for quotation in sortedQuotations %}
{% if forloop.index == next_index %}
<div class="pagination">
<a href="{{ site.github.url }}{{ quotation.url }}">next quote</a>
</div>
{% endif %}
{% endfor %}
</main>
{% include foot.html %}
</body>
</html>
Loading