Skip to content

Commit

Permalink
Merge pull request #17 from Martini-Force-Field-Initiative/15-add-a-l…
Browse files Browse the repository at this point in the history
…ist-of-the-main-martini-developers-in-the-contacts-section

15 add a list of the main martini developers in the contacts section
  • Loading branch information
danielpastor97 authored Aug 19, 2024
2 parents cd59ccc + 86288cb commit 6e474c7
Show file tree
Hide file tree
Showing 100 changed files with 1,407 additions and 694 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upload-announcements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:

- name: Sync announcements to S3
run: |
aws s3 sync docs/announcements/posts/ s3://martini-announcements/ --exclude "*" --include "*/*.qmd"
aws s3 sync docs/announcements/posts/ s3://cgmartini-library/2_Announcements/ --exclude "*" --include "*/*.qmd"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Martini FF Developers Team
Copyright (c) 2024 Martini Force Field Developers Team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
21 changes: 21 additions & 0 deletions _extensions/mcanouil/iconify/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Mickaël Canouil

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions _extensions/mcanouil/iconify/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Iconify support
author: Mickaël Canouil
version: 2.1.1
quarto-required: ">=1.2.280"
contributes:
shortcodes:
- iconify.lua
13 changes: 13 additions & 0 deletions _extensions/mcanouil/iconify/iconify-icon.min.js

Large diffs are not rendered by default.

150 changes: 150 additions & 0 deletions _extensions/mcanouil/iconify/iconify.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
--[[
# MIT License
#
# Copyright (c) Mickaël Canouil
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
]]

local function ensure_html_deps()
quarto.doc.add_html_dependency({
name = 'iconify',
version = '2.1.0',
scripts = {"iconify-icon.min.js"}
})
end

local function is_empty(s)
return s == nil or s == ''
end

local function is_valid_size(size)
if is_empty(size) then
return ''
end
local size_table = {
["tiny"] = "0.5em",
["scriptsize"] = "0.7em",
["footnotesize"] = "0.8em",
["small"] = "0.9em",
["normalsize"] = "1em",
["large"] = "1.2em",
["Large"] = "1.5em",
["LARGE"] = "1.75em",
["huge"] = "2em",
["Huge"] = "2.5em",
["1x"] = "1em",
["2x"] = "2em",
["3x"] = "3em",
["4x"] = "4em",
["5x"] = "5em",
["6x"] = "6em",
["7x"] = "7em",
["8x"] = "8em",
["9x"] = "9em",
["10x"] = "10em",
["2xs"] = "0.625em",
["xs"] = "0.75em",
["sm"] = "0.875em",
["lg"] = "1.25em",
["xl"] = "1.5em",
["2xl"] = "2em"
}
for key, value in pairs(size_table) do
if key == size then
return 'font-size: ' .. value .. ';'
end
end
return 'font-size: ' .. size .. ';'
end

return {
["iconify"] = function(args, kwargs)
-- detect html (excluding epub which won't handle fa)
if quarto.doc.is_format("html:js") then
ensure_html_deps()
local icon = pandoc.utils.stringify(args[1])
local set = "fluent-emoji"

if #args > 1 and string.find(pandoc.utils.stringify(args[2]), ":") then
quarto.log.warning(
'Use "set:icon" or "set icon" syntax, not both! ' ..
'Using "set:icon" syntax and discarding first argument!'
)
icon = pandoc.utils.stringify(args[2])
end

if string.find(icon, ":") then
set = string.sub(icon, 1, string.find(icon, ":") - 1)
icon = string.sub(icon, string.find(icon, ":") + 1)
elseif #args > 1 then
set = icon
icon = pandoc.utils.stringify(args[2])
end

local attributes = ' icon="' .. set .. ':' .. icon .. '"'
local default_label = 'Icon ' .. icon .. ' from ' .. set .. ' Iconify.design set.'

local size = is_valid_size(pandoc.utils.stringify(kwargs["size"]))
if not is_empty(size) then
attributes = attributes .. ' style="' .. size .. '"'
end

local aria_label = pandoc.utils.stringify(kwargs["label"])
if is_empty(aria_label) then
aria_label = ' aria-label="' .. default_label .. '"'
else
aria_label = ' aria-label="' .. aria_label .. '"'
end

local title = pandoc.utils.stringify(kwargs["title"])
if is_empty(title) then
title = ' title="' .. default_label .. '"'
else
title = ' title="' .. title .. '"'
end

attributes = attributes .. aria_label .. title

local width = pandoc.utils.stringify(kwargs["width"])
if not is_empty(width) and is_empty(size) then
attributes = attributes .. ' width="' .. width .. '"'
end
local height = pandoc.utils.stringify(kwargs["height"])
if not is_empty(height) and is_empty(size) then
attributes = attributes .. ' height="' .. height .. '"'
end
local flip = pandoc.utils.stringify(kwargs["flip"])
if not is_empty(flip) then
attributes = attributes .. ' flip="' .. flip.. '"'
end
local rotate = pandoc.utils.stringify(kwargs["rotate"])
if not is_empty(rotate) then
attributes = attributes .. ' rotate="' .. rotate .. '"'
end

return pandoc.RawInline(
'html',
'<iconify-icon inline=true role="img"' .. attributes .. '></iconify-icon>'
)
else
return pandoc.Null()
end
end
}
18 changes: 8 additions & 10 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project:
website:
title: "Martini Force Field Initiative"
image: "images/martini.gif"
favicon: "images/favicon.jpg"
favicon: "images/favicon.png"
open-graph: true
twitter-card: true
site-url: http://cgmartini.nl
Expand All @@ -16,20 +16,18 @@ website:

page-footer:
background: "#fdfffc"
left:
- text: <div class="footer-left"></div>
left: <div class="footer-left"></div>
center:
- icon: twitter
href: https://x.com/cg_martini
aria-label: Martini Twitter
- text: "{{< iconify hugeicons:help-circle size=lg title=FAQs label=FAQs >}}"
href: docs/faq/index.qmd
aria-label: FAQs
- icon: github
href: https://github.com/Martini-Force-Field-Initiative
aria-label: Martini GitHub
- icon: "question-circle"
href: https://github.com/orgs/Martini-Force-Field-Initiative/discussions/categories/q-a
aria-label: Ask a Question
right:
- text: <div class="footer-right">Maintained by the Martini Developers Team <img src="https://martini-library.s3.us-east-2.amazonaws.com/icon.png" alt="Icon"> </div>
right: <div class="footer-right">Maintained by the Martini Developers Team <img src="https://cgmartini-library.s3.ca-central-1.amazonaws.com/icon.png" alt="Icon"> </div>


navbar:
Expand Down Expand Up @@ -69,9 +67,9 @@ website:
- text: "Report an Issue"
icon: "bug"
href: "https://github.com/orgs/Martini-Force-Field-Initiative/discussions"
- text: "Ask a Question"
- text: "FAQs"
icon: "question-circle"
href: "https://github.com/orgs/Martini-Force-Field-Initiative/discussions/categories/q-a"
href: docs/faq/index.qmd

tools:
- icon: twitter
Expand Down
Binary file added apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/announcements/backend/lambda/sendAnnouncement.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ exports.handler = async (event) => {
const subscribers = await dynamoDb.scan({ TableName: tableName }).promise();
const emailPromises = subscribers.Items.map(item => {
const emailParams = {
Source: '[email protected]',
Source: '[email protected]',
Destination: { ToAddresses: [item.email] },
Message: {
Subject: { Data: `New Announcement from the Martini FF Initiative.` },
Subject: { Data: `New Announcement from the Martini Force Field Initiative.` },
Body: { Html: { Data:
`
<h3>Title<hr></h3>
Expand All @@ -43,7 +43,7 @@ exports.handler = async (event) => {
<br><br>
<hr style="border: 0.5px solid #000;">
If you no longer wish to receive emails from us, you can <a href="https://ilidpuzbe9.execute-api.ca-central-1.amazonaws.com/prod/unsubscribe?email=${encodeURIComponent(item.email)}&token=${item.token}">unsubscribe from our mailing list</a>.
<em>If you no longer wish to receive emails from us, you can <a href="https://q8hgi2weih.execute-api.ca-central-1.amazonaws.com/prod/unsubscribe?email=${encodeURIComponent(item.email)}&token=${item.token}">unsubscribe from our mailing list</a>.</em>
<hr style="border: 0.5px solid #000;">
Expand Down
12 changes: 8 additions & 4 deletions docs/announcements/backend/lambda/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ exports.handler = async (event) => {
await dynamoDb.put(verificationParams).promise();

// Send a verification email
const verificationUrl = `${baseUrl}/verify?token=${token}&email=${encodeURIComponent(email)}`;
const verificationUrl = `${baseUrl}/verifyEmail?token=${token}&email=${encodeURIComponent(email)}`;
const emailParams = {
Destination: {
ToAddresses: [email],
},
Message: {
Body: {
Text: {
Data: `Please verify your email by clicking the following link: ${verificationUrl}`,
Html: {
Data: `
Please verify your email by clicking the following link: ${verificationUrl}. <br><br>
<em>Note: If you did not submit a subscription request to the Martini Force Field Initiative, please ignore this email.</em>
`,
},
},
Subject: {
Data: 'Email Verification',
Data: 'Email Verification for Martini Announcements.',
},
},
Source: process.env.SOURCE_EMAIL,
Expand Down
69 changes: 67 additions & 2 deletions docs/announcements/backend/lambda/unsubscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,73 @@ exports.handler = async (event) => {
await dynamoDb.delete(params).promise();
return {
statusCode: 200,
body: JSON.stringify({ message: 'Unsubscription successful' }),
};
headers: {
'Content-Type': 'text/html',
},
body: `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Verification</title>
<script>
function closeCurrentTab() {
window.open('', '_self').close();
}
</script>
<style>
body {
font-family: 'Arial', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(135deg, #72edf2, #5151e5);
color: #fff;
}
.container {
text-align: center;
background: rgba(0, 0, 0, 0.5);
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
h1 {
margin: 0 0 20px;
font-size: 2.5em;
}
p {
font-size: 1.2em;
}
.button {
display: inline-block;
padding: 10px 20px;
margin-top: 20px;
font-size: 1em;
color: #5151e5;
background-color: #fff;
border: none;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #72edf2;
}
</style>
</head>
<body>
<div class="container">
<h1>Sorry to see you go!</h1>
<p>You have successfully unsubscribed to receive announcements from the Martini Force Field Initiative.</p>
<a onclick="closeCurrentTab()" href="#" class="button">Close</a>
</div>
</body>
</html>
`,
};
} else {
return {
statusCode: 400,
Expand Down
Loading

0 comments on commit 6e474c7

Please sign in to comment.