I made a new professional website to let people know that I write code in exchange of money. Now with handcrafted HTML.
LGPL-3.0 License
Yes, I made a new portfolio website for my freelance services. Features include:
Powered by Nuxt 3 and UnoCSS.
npm install
npm run dev
npm run build
npm run preview
It uses an integration against Mailgun. There is a server endpoint in /server/api/contact.post.ts which will receive the payload from the contact form and deliver it via their REST API. Here are some important remarks.
It is important that the contact form does content negotiation, period. I've seen a couple of times an unhandled exception inside the Nuxt internals that causes all the JavaScript of the site to stop working and handling events, so this is a real threat.
Pressing "Send" and not having the form submitted is unacceptable, which means
that the form requires proper action
and method
parameters so that if the
JavaScript event handler fails, it does a standard HTTP POST submit like in the
good old times.
It is important that the AJAX request sets the Accept
header to
application/json
, because that is what the backend endpoint will use to detect
if this is a XHR request or not. XHR requests will receive a JSON body as this
is what the Accept header asks. If it's not an XHR request, the endpoint will
302 to contact/success.vue, which presents a fairly traditional and boring
confirmation message.
The following four environment variables must be declared and present:
MAILGUN_API_KEY
: An API key to use Mailgun's REST API in order to deliverMAILGUN_API_DOMAIN
: The domain to use when sending an e-mail. Might beMAILGUN_API_FROM
: Just a way to parameterize the email to show in the FromMAILGUN_API_TO
: Just a way to parameterize the email where the contact formMAILGUN_API_ENDPOINT
: Set to https://api.eu.mailgun.net when Mailgun isSituation:
Additional requirements (should be covered by nuxt-i18n but it is important to take a look):