Skip to content

Commit

Permalink
extra_config test
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnyder committed Oct 7, 2023
1 parent 315bcf2 commit be84fe5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 43 deletions.
17 changes: 0 additions & 17 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,3 @@ baseurl: /
layout:
header: false
footer: false

nav:
- label: Home
href: /
icon: <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"/></svg>
- label: About
href: /about
icon: <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>
- label: Contributors
href: /contributors
icon: <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 640 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192h42.7c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0H21.3C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7h42.7C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3H405.3zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352H378.7C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7H154.7c-14.7 0-26.7-11.9-26.7-26.7z"/></svg>
- label: Contact Us
href: /contact
icon: <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"/></svg>
- label: Search
href: /search
icon: <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>
22 changes: 0 additions & 22 deletions config.yml → _extra_config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
title: Plant Humanities Lab
author:
name: rsnyder
email: [email protected]

# The `>` after `description:` means to ignore line-breaks until next key.
# If you want to omit the line-break after the end of text, use `>-` instead.
description: >-
Quickly build websites using Github Pages, Markdown, and interactive viewers.
github:
owner: jstor-labs
repo: plant-humanities
branch: gh-pages

url: https://beta.plant-humanities.org/
baseurl: /

layout:
header: false
footer: false

nav:
- label: Home
href: /
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{%- if site.layout.header == "true" -%}
{%- include header.html -%}
{%- endif -%}
<main class="page-content" aria-label="Content">
<main class="page-content" aria-label="Content">
{{ content }}
</main>
{%- if site.layout.footer == "true" -%}
Expand Down
8 changes: 5 additions & 3 deletions juncture/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ if (referrerUrl) {

async function getConfig() {
if (window._config) return window._config
let resp = await fetch('/config.yml')
if (resp.ok) window._config = window.jsyaml.load(await resp.text())

let resp = await fetch('/_extra_config.yml')
if (resp.ok) window._config = {
...window.config,
...window.jsyaml.load(await resp.text())
}
return window._config
}

Expand Down
1 change: 1 addition & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
html_template = html_template.replace('{{ site.github.owner }}', config['github']['owner'])
html_template = html_template.replace('{{ site.github.repo }}', config['github']['repo'])
html_template = html_template.replace('{{ site.github.branch }}', config['github']['branch'])
html_template = html_template.replace('{{ site.nav }}', json.dumps(config['nav']))
html_template = html_template.replace('{{ site.baseurl }}', '')
html_template = html_template.replace('{%- if site.mode == "juncture" -%}', '')
# html_template = re.sub(r'^\s*{%-\s+else\s+-%}\s*.*\s*{%-\s+endif\s+-%}', '', html_template, flags=re.MULTILINE)
Expand Down

0 comments on commit be84fe5

Please sign in to comment.