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

Move dictionary to dedicated page #458

Open
wants to merge 4 commits into
base: prod
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions 11ty/_includes/components/base/site-footer.njk
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<footer class="site-footer">
<nav aria-label="Complimentary">
<ul class="navigation-list">
<li>
<a href="/documentation/">Documentation</a>
</li>
<li>
<a href="/content-warning-guidelines/">Content Warning Guidelines</a>
</li>
<li>
<a href="{{ metadata.feedPermalink | absoluteUrl(metadata.url) }}">RSS Feed</a>
</li>
Expand Down
18 changes: 18 additions & 0 deletions 11ty/_includes/components/base/site-header.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<header class="site-header">
<h1 class="site-header__title" id="title">
<a href="/">Self-Defined</a>
</h1>
<nav aria-label="Main">
<ul class="navigation-list">
<li>
<a href="/dictionary/">Dictionary</a>
</li>
<li>
<a href="/about">About</a>
</li>
<li>
<a href="/contribute">Contribute</a>
</li>
</ul>
<nav>
</header>
9 changes: 9 additions & 0 deletions 11ty/_includes/layouts/about.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends 'layouts/base.njk' %}
{% set titleWithPath = 'About « ' %}

{% block content %}
<main>
{{ content | safe }}
</main>

{% endblock %}
1 change: 1 addition & 0 deletions 11ty/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
document.documentElement.removeAttribute('data-user-theme');
}
</script>
{% include 'components/base/site-header.njk' %}
{% block content %}{% endblock content %}
{% include 'components/base/site-footer.njk' %}
{% block pageScript %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{% extends 'layouts/base.njk' %}
{% set pageType = 'Page' %}
{% set titleWithPath = title + ' « Documentation « ' %}
{% set titleWithPath = title + ' « Contribute « ' %}
{% block pageStyles %}
{# Code highlighting #}
<link rel="stylesheet" href="https://unpkg.com/prism-themes@^1.3/themes/prism-a11y-dark.css"/>
{% endblock %}
{% block content %}
<div class="article-content">
{% include 'components/sub-page-header.njk' %}
<main class="page">
{%- if parent -%}
<div>
Expand Down
34 changes: 16 additions & 18 deletions 11ty/_includes/layouts/definition.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@
{% set description = 'The definition of ' + title + ' in Self-Defined, a modern dictionary about us.'%}

{% block content %}
<div class="wide-content">
{% include 'components/sub-page-header.njk' %}
<main>
<article class="definition">
<header class="definition__header">
{% definitionFlag flag %}
<h1 class="main-headline" >{{ title }}</h1>
<section class="u-margin-bottom-double" aria-labelledby="definition-speech">
<h2 id="definition-speech" class="visually-hidden">Speech</h2>
<p class="definition-content__speech">{{ speech }}</p>
</section>
</header>
{% include 'components/content-warning-flag.njk' %}
{% include 'components/definition-content.njk' %}
{% include 'components/alertbox.njk' %}
{% renderDefinitionContentNextEntries title, slug, collections.definedWords %}
</article>
</main>
<main>
<article class="definition">
<header class="definition__header">
{% definitionFlag flag %}
<h1 class="main-headline" >{{ title }}</h1>
<section class="u-margin-bottom-double" aria-labelledby="definition-speech">
<h2 id="definition-speech" class="visually-hidden">Speech</h2>
<p class="definition-content__speech">{{ speech }}</p>
</section>
</header>
{% include 'components/content-warning-flag.njk' %}
{% include 'components/definition-content.njk' %}
{% include 'components/alertbox.njk' %}
{% renderDefinitionContentNextEntries title, slug, collections.definedWords %}
</article>
</main>
{% endblock %}
30 changes: 30 additions & 0 deletions 11ty/_includes/layouts/dictionary.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends 'layouts/base.njk' %}
{% set titleWithPath = 'Dictionary « ' %}

{% block content %}
<main>
{{ content | safe }}
{% include 'components/table-of-content.njk' %}

</main>
{% endblock %}


{% block pageScript%}
<script>
// don't use es6+ here because it will not be transpiled
window.addEventListener('DOMContentLoaded', function() {
if (location.hash) {
var allLinks = Array.from(document.querySelectorAll('.toc__list-item > a'));

for (var i = 0; i < allLinks.length; i++) {
var link = allLinks[i]

if (link.href.includes(location.hash.replace('#', ''))) {
window.location = link.href
}
}
}
})
</script>
{% endblock %}
22 changes: 0 additions & 22 deletions 11ty/_includes/layouts/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,6 @@
{% block content %}
<main>
{{ content | safe }}
{% include 'components/table-of-content.njk' %}

</main>

{% endblock %}


{% block pageScript%}
<script>
// don't use es6+ here because it will not be transpiled
window.addEventListener('DOMContentLoaded', function() {
if (location.hash) {
var allLinks = Array.from(document.querySelectorAll('.toc__list-item > a'));

for (var i = 0; i < allLinks.length; i++) {
var link = allLinks[i]

if (link.href.includes(location.hash.replace('#', ''))) {
window.location = link.href
}
}
}
})
</script>
{% endblock %}
23 changes: 23 additions & 0 deletions 11ty/about.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: layouts/about.njk
---

<section>
<p class="introduction__body">A modern dictionary about us.<br>We define our words, but they don't define us.</p>
<div>
<p class="summary">
Self-Defined seeks to provide more inclusive, holistic, and fluid definitions to reflect the diverse perspectives of the modern world.
</p>
<p>
With the foundation of vocabulary, we can begin to understand lived experiences of people different than us. Words can provide us with a sense of identity and allow us to find kinship through common experiences.
</p>
</div>
<div class="box">
<h2 class="sub-headline">Ways to help</h2>
<ol class="list">
<li>Submit words and definitions or contribute to our code base through <a href="https://github.com/tatianamac/selfdefined/pulls" rel="noreferrer">pull requests</a> or <a href="https://github.com/tatianamac/selfdefined/issues" rel="noreferrer">issues</a>. Start with our <a href="https://github.com/selfdefined/web-app/blob/prod/CONTRIBUTING.md" rel="noreferrer">contributing guidelines</a> and <a href="/documentation/">documentation</a>.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this link correct? I don't think the codebase is in Tatiana's personal github anymore, is it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct. @kkemple Do you want to fix this in this PR? It’s not strictly in the scope of it, so we can fix this separately.

<li>Sponsor this work through <a href="https://opencollective.com/selfdefined">Open Collective</a> or <a href="https://github.com/sponsors/tatianamac">GitHub Sponsors</a>.</li>
<li>Follow us on Twitter <a href="https://www.twitter.com/selfdefinedapp">@SelfDefinedApp</a>.</li>
</ol>
</div>
</section>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"layout": "layouts/documentation.njk"
"layout": "layouts/contribute.njk"
}
3 changes: 3 additions & 0 deletions 11ty/contribute/contribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"layout": "layouts/contribute.njk"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Development & Build
parent:
title: Documentation
href: '/documentation'
title: Contribute
href: '/contribute'
---

This guide will walk you through the current state of the development config. Things get a bit technical here. 🤖
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Basic Definition
parent:
title: Examples
href: '/documentation/examples'
href: '/contribute/examples'
---

This example is the very basic variant. It is not very involved, but gets its job done.
Expand Down
3 changes: 3 additions & 0 deletions 11ty/contribute/examples/examples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"layout": "layouts/contribute.njk"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Flagged Word
parent:
title: Examples
href: '/documentation/examples'
href: '/contribute/examples'
---

As explained in the [Front Matter documentation](/documentation/front-matter/#flag) we can use different flags which inform readers at a glance how this word is used. Here are some examples.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Definition Examples
parent:
title: Documentation
href: '/documentation'
title: Contribute
href: '/contribute'
---

Below are links to grab-and-go examples of various common use cases.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: FAQs
parent:
title: Documentation
href: '/documentation'
title: Contribute
href: '/contribute'
---

<p>Answers to frequently asked questions.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Front Matter
parent:
title: Documentation
href: '/documentation'
title: Contribute
href: '/contribute'
---

We use Front Matter for a range of things. Of course, we provide basic information through it. But also more advanced stuff (technical term) such as sub terms for items in the table of content or further reading links for the definition.

This page will tell you all you need to know.

Note: We also maintain a list of annotated, complete example definitions, which you can grab and go. They are listed on the [Examples documentation page](/documentation/examples).
Note: We also maintain a list of annotated, complete example definitions, which you can grab and go. They are listed on the [Examples documentation page](/contribute/examples).

## Title

Expand Down Expand Up @@ -55,9 +55,9 @@ defined: true

## Excerpt

| Key | Type | required |
| ------- | ------- | -------- |
| excerpt | String | true |
| Key | Type | required |
| ------- | ------ | -------- |
| excerpt | String | true |

An abbreviated version of the definition that will appear in social media previews. In the social preview, the excerpt will be prefaced with the flag level.

Expand Down
9 changes: 9 additions & 0 deletions 11ty/contribute/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Contribute
---

- [Development & Build](/contribute/development/): Notes for developing the site
- [Front Matter](/contribute/front-matter/): Configuration possibilities through front matter
- [Examples](/contribute/examples/): Grab-and-go definition examples
- [FAQs](/contribute/frequently-asked-questions): Answers to frequently asked questions
- [Content Warning Guidelines](/content-warning-guidelines): Guidelines for using content and trigger warnings
9 changes: 9 additions & 0 deletions 11ty/dictionary.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: layouts/dictionary.njk
---

<div>
<p class="summary">
Should provide high-level instructions for using the dictionary.
</p>
</div>
3 changes: 0 additions & 3 deletions 11ty/documentation/documentation.json

This file was deleted.

3 changes: 0 additions & 3 deletions 11ty/documentation/examples/examples.json

This file was deleted.

10 changes: 0 additions & 10 deletions 11ty/documentation/index.md

This file was deleted.

25 changes: 3 additions & 22 deletions 11ty/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,6 @@
layout: layouts/index.njk
---

<header class="auto-grid introduction">
<h1 class="introduction__title thicc-headline" id="title">
Self-Defined
</h1>
<p class="introduction__body">A modern dictionary about us.<br>We define our words, but they don't define us.</p>
<div>
<p class="summary">
Self-Defined seeks to provide more inclusive, holistic, and fluid definitions to reflect the diverse perspectives of the modern world.
</p>
<p>
With the foundation of vocabulary, we can begin to understand lived experiences of people different than us. Words can provide us with a sense of identity and allow us to find kinship through common experiences.
</p>
</div>
<div class="box">
<h2 class="sub-headline">Ways to help</h2>
<ol class="list">
<li>Submit words and definitions or contribute to our code base through <a href="https://github.com/tatianamac/selfdefined/pulls" rel="noreferrer">pull requests</a> or <a href="https://github.com/tatianamac/selfdefined/issues" rel="noreferrer">issues</a>. Start with our <a href="https://github.com/selfdefined/web-app/blob/prod/CONTRIBUTING.md" rel="noreferrer">contributing guidelines</a> and <a href="/documentation/">documentation</a>.</li>
<li>Sponsor this work through <a href="https://opencollective.com/selfdefined">Open Collective</a> or <a href="https://github.com/sponsors/tatianamac">GitHub Sponsors</a>.</li>
<li>Follow us on Twitter <a href="https://www.twitter.com/selfdefinedapp">@SelfDefinedApp</a>.</li>
</ol>
</div>
</header>
<section class="slogan">
<p>A modern dictionary about us.<br>We define our words, but they don't define us.</p>
</section>
10 changes: 1 addition & 9 deletions assets/css/layouts/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
}
}

.article-content {
display: grid;
grid-gap: 1rem;

@media (min-width: 800px) {
grid-template-columns: 10rem 45rem;
}
}

.wide-content {
@media (min-width: 800px) {
display: grid;
Expand All @@ -26,6 +17,7 @@
}

.definition {
margin: auto;
max-width: 47rem;
}

Expand Down
11 changes: 0 additions & 11 deletions assets/css/structures/_definition-content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@
margin-top: 2rem;
}

@supports (display: grid) {
// align-items: flex-start;
display: grid;
grid-gap: 1rem;
grid-template-columns: 1fr 4fr;

& > * {
margin: 0 !important;
}
}

& > p,
& > ul {
font-family: $sans-serif;
Expand Down
Loading