Skip to content

Commit

Permalink
Merge branch 'main' into lunr-custom
Browse files Browse the repository at this point in the history
  • Loading branch information
mattxwang committed Dec 27, 2022
2 parents 9d861f1 + c1c44e8 commit 0013964
Show file tree
Hide file tree
Showing 26 changed files with 681 additions and 302 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,30 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
jekyll-version: [3.8.5, latest]
jekyll-version: [3.9, 4.3]
steps:
- uses: actions/checkout@v3
- name: Build the site in the jekyll/jekyll container
run: |
docker run --rm \
--volume="${{ github.workspace }}:/srv/jekyll" \
jekyll/jekyll:${{ matrix.jekyll-version }} /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && bundle install && bundle exec jekyll build && bundle exec rake search:init"
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: false
- name: Bundle Install
run: bundle install
- name: Install Jekyll ${{ matrix.jekyll-version }}
run: gem install jekyll -v ${{ matrix.jekyll-version }}
- name: Init Search
run: bundle exec rake search:init
- name: Build Site
run: bundle exec jekyll build

assets:
name: Test CSS and JS
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages

on:
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v1

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
_site
Gemfile.lock
node_modules
.DS_Store
48 changes: 42 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ layout: default

# CHANGELOG

All notable changes to this project are documented in this file.
All notable user-facing changes to this project are documented in this file.

{: .highlight }
The project underwent a major maintenance shift in March 2022.
Expand All @@ -20,11 +20,47 @@ This website includes docs for some new features that are not available in `v0.4

Changes to `main` that are *not* in the latest pre-release:

- Fixed: typo in changelog links [@koppor] in [#1000]

- Added: support multiple Google Analytics tracking IDs, document UA -> GA4 switch by [@MichelleBlanchette] in [#1029]
- Added: copy code button to code snippets by [@simonebortolin] in [#945]
- Fixed: incorrect disambiguation in generated TOCs by [@pdmosses] in [#999]
- Fixed: duplicated external links in collections by [@pdmosses] in [#1001]
- Fixed: import order of `custom.scss`; puts at end by [@deseo] in [#1010]
- Fixed: top-level active link styling by [@pdmosses] in [#1015]
- Fixed: external links for sites with no pages by [@pdmosses] in [#1021]
- Fixed: duplicate `title` if `jekyll-seo-tag` not in users's plugins
- Fixed: removes (duplicate) `favicon.html`, shifts content to `head_custom.html` by [@mattxwang] in [#1027]
- Fixed: add `reversed`, deprecate `desc` for nav `child_nav_order` by [@jmertic] in [#1061]
- Fixed: `child.child_nav_order` to `node.child_nav_order` by [@mattxwang] in [#1065]
- Fixed: remove all uses of `/` as SASS division by [@mattxwang] in [#1074]
- note: this was originally merged as [#1074] with a bug; it was reverted in [#1076], and then reimplemented in [#1077]
- Vendor: update `jekyll-anchor-headings`, `lunr.js` by [@mattxwang] in [#1071]
- Docs: fix typo in changelog links [@koppor] in [#1000]
- Docs: update homepage (focus: new features, conciseness, deduplication) by [@pdmosses] in [#1018]
- Docs: update README (focus: new features, conciseness, deduplication) by [@pdmosses] in [#1019]

[#945]: https://github.com/just-the-docs/just-the-docs/pull/945
[#999]: https://github.com/just-the-docs/just-the-docs/pull/999
[#1000]: https://github.com/just-the-docs/just-the-docs/pull/1000
[#1001]: https://github.com/just-the-docs/just-the-docs/pull/1001
[#1010]: https://github.com/just-the-docs/just-the-docs/pull/1010
[#1015]: https://github.com/just-the-docs/just-the-docs/pull/1015
[#1018]: https://github.com/just-the-docs/just-the-docs/pull/1018
[#1019]: https://github.com/just-the-docs/just-the-docs/pull/1019
[#1021]: https://github.com/just-the-docs/just-the-docs/pull/1021
[#1027]: https://github.com/just-the-docs/just-the-docs/pull/1027
[#1029]: https://github.com/just-the-docs/just-the-docs/pull/1029
[#1040]: https://github.com/just-the-docs/just-the-docs/pull/1040
[#1061]: https://github.com/just-the-docs/just-the-docs/pull/1061
[#1065]: https://github.com/just-the-docs/just-the-docs/pull/1065
[#1071]: https://github.com/just-the-docs/just-the-docs/pull/1071
[#1074]: https://github.com/just-the-docs/just-the-docs/pull/1074
[#1076]: https://github.com/just-the-docs/just-the-docs/pull/1076
[#1077]: https://github.com/just-the-docs/just-the-docs/pull/1077

[@koppor]: https://github.com/koppor
[@deseo]: https://github.com/deseo
[@MichelleBlanchette]: https://github.com/MichelleBlanchette
[@simonebortolin]: https://github.com/simonebortolin

## Pre-release v0.4.0.rc3

Expand Down Expand Up @@ -446,17 +482,17 @@ as well as DX improvements like better regression tests, CI, and tooling. If you
[@max06]: https://github.com/max06
[@sehilyi]: https://github.com/sehilyi
[@nathanjessen]: https://github.com/nathanjessen
[@waldyrious]: https://gihhub.com/waldyrious
[@waldyrious]: https://github.com/waldyrious
[@MichelleBlanchette]: https://github.com/MichelleBlanchette
[@henryiii]: https://github.com/henryiii
[@jmertic]: https://github.com/jmertic
[@jacobhq]: https://github.com/jacobhq
[@UnclassedPenguin]: https://gihhub.com/UnclassedPenguin
[@UnclassedPenguin]: https://github.com/UnclassedPenguin
[@alyssais]: https://github.com/alyssais
[@nascosto]: https://github.com/nascosto
[@SPGoding]: https://github.com/SPGoding
[@iridazzle]: https://github.com/iridazzle
[@ivanskodje]: https://gihhub.com/ivanskodje
[@ivanskodje]: https://github.com/ivanskodje
[@Eisverygoodletter]: https://github.com/Eisverygoodletter

**Full Changelog**: https://github.com/just-the-docs/just-the-docs/compare/v0.3.3...v0.4.0.rc1
Expand Down
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,28 @@

## Installation

### via GitHub Pages remote theme
### Use the template

The quickiest way to use Just The Docs is to use GitHub pages [remote theme](https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/) feature in your `_config.yml` file:
The [Just the Docs Template] provides the simplest, quickest, and easiest way to create a new website that uses the Just the Docs theme. To get started with creating a site, just click "[use the template]"!

```yaml
remote_theme: just-the-docs/just-the-docs
```
### via RubyGems:
Note: To use the theme, you do ***not*** need to clone or fork the [Just the Docs repo]! You should do that only if you intend to browse the theme docs locally, contribute to the development of the theme, or develop a new theme based on Just the Docs.

You can easily set the site created by the template to be published on [GitHub Pages] – the [template README] file explains how to do that, along with other details.

If [Jekyll] is installed on your computer, you can also build and preview the created site *locally*. This lets you test changes before committing them, and avoids waiting for GitHub Pages.[^2] And you will be able to deploy your local build to a different platform than GitHub Pages.

More specifically, the created site:

Alternatively you can install it as a Ruby Gem.
- uses a gem-based approach, i.e. uses a `Gemfile` and loads the `just-the-docs` gem
- uses the [GitHub Pages / Actions workflow] to build and publish the site on GitHub Pages

Add this line to your Jekyll site's Gemfile:
Other than that, you're free to customize sites that you create with the template, however you like. You can easily change the versions of `just-the-docs` and Jekyll it uses, as well as adding further plugins.

### Use RubyGems

Alternatively, you can install the theme as a Ruby Gem, without creating a new site.

Add this line to your Jekyll site's `Gemfile`:

```ruby
gem "just-the-docs"
Expand All @@ -50,16 +60,19 @@ Alternatively, you can run it inside Docker while developing your site

## Usage

[View the documentation](https://just-the-docs.github.io/just-the-docs/) for usage information.
[View the documentation][Just the Docs] for usage information.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/just-the-docs/just-the-docs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
Bug reports, proposals of new features, and pull requests are welcome on GitHub at https://github.com/just-the-docs/just-the-docs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

### Submitting code changes:

- Submit an [Issue](https://github.com/just-the-docs/just-the-docs/issues) that motivates the changes, using the appropriate template
- Discuss the proposed changes with other users and the maintainers
- Open a [Pull Request](https://github.com/just-the-docs/just-the-docs/pulls)
- Ensure all CI tests pass
- Provide instructions to check the effect of the changes
- Await code review

### Design and development principles of this theme:
Expand All @@ -71,14 +84,25 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/just-t

## Development

To set up your environment to develop this theme, run `bundle install`.
To set up your environment to develop this theme: fork this repo, the run `bundle install` from the root directory.

A modern [devcontainer configuration](https://code.visualstudio.com/docs/remote/containers) for VSCode is included.

Your theme is set up just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.

When the theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
When this theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be included in the gem.

## License

The theme is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

[^2]: [It can take up to 10 minutes for changes to your site to publish after you push the changes to GitHub](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll#creating-your-site).

[Jekyll]: https://jekyllrb.com
[Just the Docs Template]: https://just-the-docs.github.io/just-the-docs-template/
[Just the Docs]: https://just-the-docs.github.io/just-the-docs/
[Just the Docs repo]: https://github.com/just-the-docs/just-the-docs
[GitHub Pages]: https://pages.github.com/
[Template README]: https://github.com/just-the-docs/just-the-docs-template/blob/main/README.md
[GitHub Pages / Actions workflow]: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/
[use the template]: https://github.com/just-the-docs/just-the-docs-template/generate
5 changes: 4 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ search:
# Supports true or false (default)
button: false

# For copy button on code
enable_copy_code_button: true

# To disable support for mermaid diagrams (https://mermaid-js.github.io/mermaid/),
# comment out the `mermaid` and `version` keys below
# By default, consuming the theme as a gem leaves mermaid disabled; it is opt-in
Expand Down Expand Up @@ -147,7 +150,7 @@ callouts:
color: red

# Google Analytics Tracking (optional)
# e.g, UA-1234567-89
# Supports a CSV of tracking ID strings (eg. "UA-1234567-89,G-1AB234CDE5")
ga_tracking: UA-2709176-10
ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true/nil by default)

Expand Down
2 changes: 1 addition & 1 deletion _includes/css/just-the-docs.scss.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ $logo: "{{ site.logo | relative_url }}";
@import "./color_schemes/light";
@import "./color_schemes/{{ include.color_scheme }}";
@import "./modules";
{% include css/custom.scss.liquid %}
{% include css/callouts.scss.liquid color_scheme = include.color_scheme %}
{% include css/custom.scss.liquid %}
1 change: 0 additions & 1 deletion _includes/favicon.html

This file was deleted.

18 changes: 5 additions & 13 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,20 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">

{% unless site.plugins contains "jekyll-seo-tag" %}
<title>{{ page.title }} - {{ site.title }}</title>

{% if page.description %}
<meta name="Description" content="{{ page.description }}">
{% endif %}
{% endunless %}

{% include favicon.html %}

<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-default.css' | relative_url }}">

{% if site.ga_tracking != nil %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.ga_tracking }}"></script>
{% assign ga_tracking_ids = site.ga_tracking | split: "," %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ ga_tracking_ids.first }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.ga_tracking }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %});
{% for ga_property in ga_tracking_ids %}
gtag('config', '{{ ga_property }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %});
{% endfor %}
</script>

{% endif %}

{% if site.search_enabled != false %}
Expand Down
1 change: 1 addition & 0 deletions _includes/head_custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="shortcut icon" href="{{ 'favicon.ico' | relative_url }}" type="image/x-icon">
15 changes: 15 additions & 0 deletions _includes/icons/code_copy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Feather. MIT License: https://github.com/twbs/icons/blob/main/LICENSE.md -->
<symbol id="svg-copy" viewBox="0 0 16 16">
<title>Copy</title>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
<path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
<path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
</svg>
</symbol>
<symbol id="svg-copied" viewBox="0 0 16 16">
<title>Copied</title>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard-check-fill" viewBox="0 0 16 16">
<path d="M6.5 0A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3Zm3 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3Z"/>
<path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1A2.5 2.5 0 0 1 9.5 5h-3A2.5 2.5 0 0 1 4 2.5v-1Zm6.854 7.354-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 0 1 .708-.708L7.5 10.793l2.646-2.647a.5.5 0 0 1 .708.708Z"/>
</svg>
</symbol>

0 comments on commit 0013964

Please sign in to comment.