1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-03 00:57:37 -04:00

Merge pull request #229 from malsf21/aux-links-new-tab

feat: adds option to open aux links in new tab
This commit is contained in:
Patrick Marsceill 2020-04-27 16:41:37 -04:00 committed by GitHub
commit b4c278cb8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 1 deletions

45
.github/workflows/ci-master.yml vendored Normal file
View File

@ -0,0 +1,45 @@
on:
push:
branches:
- master
name: CI
jobs:
jekyll-latest:
name: Build Jekyll site (latest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build the site in the jekyll/builder container
run: |
docker run --rm \
--volume="${{ github.workspace }}:/srv/jekyll" \
jekyll/builder:latest /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init"
jekyll-3-8-5:
name: Build Jekyll site (v3.8.5)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build the site in the jekyll/builder container
run: |
docker run --rm \
--volume="${{ github.workspace }}:/srv/jekyll" \
jekyll/builder:3.8.5 /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init"
assets:
name: Format and test CSS and JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install
- run: npm test

View File

@ -38,6 +38,9 @@ aux_links:
"Just the Docs on GitHub": "Just the Docs on GitHub":
- "//github.com/pmarsceill/just-the-docs" - "//github.com/pmarsceill/just-the-docs"
# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false
# Sort order for navigation links # Sort order for navigation links
nav_sort: case_insensitive # default, equivalent to nil nav_sort: case_insensitive # default, equivalent to nil
# nav_sort: case_sensitive # Capital letters sorted before lowercase # nav_sort: case_sensitive # Capital letters sorted before lowercase

View File

@ -43,7 +43,15 @@ layout: table_wrappers
{% if site.aux_links != nil %} {% if site.aux_links != nil %}
<ul class="list-style-none text-small aux-nav"> <ul class="list-style-none text-small aux-nav">
{% for link in site.aux_links %} {% for link in site.aux_links %}
<li class="d-inline-block my-0{% unless forloop.last %} mr-2{% endunless %}"><a href="{{ link.last }}">{{ link.first }}</a></li> <li class="d-inline-block my-0{% unless forloop.last %} mr-2{% endunless %}">
<a href="{{ link.last }}"
{% if site.aux_links_new_tab %}
target="_blank" rel="noopener noreferrer"
{% endif %}
>
{{ link.first }}
</a>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}

View File

@ -47,6 +47,9 @@ search_tokenizer_separator: /[\s/]+/
aux_links: aux_links:
"Just the Docs on GitHub": "Just the Docs on GitHub":
- "//github.com/pmarsceill/just-the-docs" - "//github.com/pmarsceill/just-the-docs"
# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false
``` ```
## Heading anchor links ## Heading anchor links