Skip to content

Commit

Permalink
subtitle and fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
beggers committed Jun 25, 2024
1 parent 7b08be2 commit 6bca90d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Test
run: pytest

- name: Generate content
run: make content

- name: "Configure AWS Credentials"
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
Expand Down Expand Up @@ -60,7 +63,7 @@ jobs:
uses: unfor19/install-aws-cli-action@v1

- name: Deploy
env:
DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
run: |
make full
run: make deploy

- name: Clear caches
run: make clear-caches
43 changes: 43 additions & 0 deletions layouts/home-subtitle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% define home-subtitle %}
<h2 class="page-subtitle">GMO-free!</h2>
<script>
function setSubtitle() {
const nouns = [
['GMO', 'GMOs'],
['Pesticide', 'Pesticides'],
['Asbestos', 'Asbestos'],
['Lead', 'Lead'],
['Mercury', 'Mercury'],
['Cadmium', 'Cadmium'],
['Arsenic', 'Arsenic'],
['Dioxin', 'Dioxin'],
['PCB', 'PCBs'],
['DDT', 'DDT'],
['BPA', 'BPA'],
['Phthalate', 'Phthalates'],
['Paraben', 'Parabens'],
['Sulfate', 'Sulfates'],
['Sulfite', 'Sulfites'],
['Nitrate', 'Nitrates'],
['Nitrite', 'Nitrites'],
['BHA', 'BHAs'],
['MSG', 'MSG'],
['HFCS', 'HFCS'],
['PFAS', 'PFAS'],
['Micronutrient', 'Micronutrients'],
]
const modifiers = [
[(noun) => `Now With 30% Less ${noun}!`, 1],
[(noun) => `Now With 30% More ${noun}!`, 1],
[(noun) => `${noun}-Free!`, 0],
[(noun) => `Full of ${noun}!`, 1],
];
const noun = nouns[Math.floor(Math.random() * nouns.length)];
const modifier = modifiers[Math.floor(Math.random() * modifiers.length)];
console.log(noun, modifier);
const subtitle = modifier[0](noun[modifier[1]]);
document.querySelector('.page-subtitle').textContent = subtitle;
}
window.onload = setSubtitle();
</script>
{% end home-subtitle %}
2 changes: 1 addition & 1 deletion layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% include nav-sidebar %}
<section class="content">
<h1 class="page-title">The Ben Eggers Fun and Silly Online Experience™</h1>
<h2 class="page-subtitle">GMO-free!</h2>
{% include home-subtitle %}
<p>
Hi! My name is Ben Eggers -- I'm also known as beggers and (sometimes) cantbechoosers.
</p>
Expand Down

0 comments on commit 6bca90d

Please sign in to comment.