Skip to content

Commit

Permalink
Use baseurl for the configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bebatut committed Nov 25, 2021
1 parent c09ca94 commit 0147f99
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 49 deletions.
44 changes: 1 addition & 43 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,51 +43,9 @@ install: clean ## install dependencies

serve: ## run a local server
$(ACTIVATE_ENV) && \
bundle exec jekyll serve
bundle exec jekyll serve --strict_front_matter -d _site/DNAnalyzer -P ${PORT} -H ${PDF_HOST} ${FLAGS}
.PHONY: serve

detached-serve: ## run a local server in detached mode
$(ACTIVATE_ENV) && \
bundle exec jekyll serve --detach -P ${PORT} -H ${PDF_HOST} ${FLAGS}
.PHONY: detached-serve

pdf: detached-serve ## generate the PDF of the protocols
mkdir -p $(PDF_DIR)
@for t in $(PROTOCOLS); do \
name="$(PDF_DIR)/$$(echo $$t | tr '/' '-' | sed -e 's/.html/-instructors.pdf/' -e 's/^-//' -e 's/-index//')"; \
${CHROME} \
--headless \
--disable-gpu \
--print-to-pdf="$$name" \
"$(SITE_URL)/protocols/$$t" \
2> /dev/null ; \
name="$(PDF_DIR)/$$(echo $$t | tr '/' '-' | sed -e 's/.html/-learners.pdf/' -e 's/^-//' -e 's/-index//')"; \
${CHROME} \
--headless \
--disable-gpu \
--print-to-pdf="$$name" \
"$(SITE_URL)/protocols/$$t?without-details" \
2> /dev/null ; \
done

${CHROME} \
--headless \
--disable-gpu \
--print-to-pdf="$(PDF_DIR)/beer-dna-sequencing-flongle-instructor.pdf" \
"$(SITE_URL)/protocols/beer-dna-sequencing?flongle" \
2> /dev/null

${CHROME} \
--headless \
--disable-gpu \
--print-to-pdf="$(PDF_DIR)/beer-dna-sequencing-flongle-learners.pdf" \
"$(SITE_URL)/protocols/beer-dna-sequencing?flongle?without-details" \
2> /dev/null


pkill -f jekyll
.PHONY: pdf

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: DNAnalyzer
description: >
An online & interactive game on DNA data analysis!
url: "https://streetscience.community"
baseurl: "/DNAnalyzer"

# Social
Expand Down
9 changes: 5 additions & 4 deletions _includes/default-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<div class="container">
<div class="navbar-brand">

<a class="navbar-item" href="{{ site.baseurl}}/">
<img src="{{ site.baseurl}}/images/logo.png" alt="DNAnalyzer">
<a class="navbar-item" href="{{ site.baseurl }}/">
<img src="{{ site.baseurl }}/images/logo.png" alt="DNAnalyzer">
{{ site.title }}
</a>

<a
Expand All @@ -20,8 +21,8 @@

<div id="top-menu" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="{{ site.baseurl}}/about"> About </a>
<a class="navbar-item" href="https://streetscience.community/"> Street Science Community </a>
<a class="navbar-item" href="{{ site.baseurl }}/about"> About </a>
<a class="navbar-item" href="{{ site.url }}"> Street Science Community </a>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
{% seo %}
<meta name="twitter:card" content="summary_large_image" />
<link rel="stylesheet" href="{{ site.baseurl}}/css/styles.css" />
<link rel="stylesheet" href="{{ "/css/styles.css" | prepend: site.baseurl }}"/>
</head>
<body>
{% include _includes/default-header.html %}
Expand All @@ -17,7 +17,7 @@
{% include _includes/default-footer.html %}

<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<script src="{{ site.baseurl}}/js/scripts.js"></script>
<script src="{{ "/js/scripts.js" | prepend: site.baseurl }}"></script>
{% if page.twitter_moment %}
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
{% endif %}
Expand Down

0 comments on commit 0147f99

Please sign in to comment.