Initial commit

Go http server serving the resume, all dynamic fu
unimplemented.
This commit is contained in:
Jarno Rankinen 2023-12-02 00:27:32 +02:00
commit 2fadf327e4
16 changed files with 19466 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# Go-resume
## Work in progress
A dynamic resume site using [Bulma CSS](https://github.com/jgthms/bulma) written in Go.
Shamelessly copied from [mazipan's](https://github.com/mazipan) [bulma-resume-template](https://github.com/mazipan/bulma-resume-template).

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/0ranki/go-resume
go 1.21

47
main.go Normal file
View File

@ -0,0 +1,47 @@
package main
import (
"embed"
"html/template"
"log/slog"
"net/http"
)
//go:embed "static/css/*.css"
var static embed.FS
func home(w http.ResponseWriter, r *http.Request) {
templateFiles := []string{
"./templates/index.html",
"./templates/jsonLd.html",
"./templates/metatag.html",
"./templates/githubCorner.html",
}
tmpl, err := template.ParseFiles(templateFiles...)
if err != nil {
slog.Error(err.Error())
http.Error(w, "Server error", http.StatusInternalServerError)
return
}
err = tmpl.Execute(w, nil)
if err != nil {
slog.Error(err.Error())
http.Error(w, "Server error", http.StatusInternalServerError)
}
}
//func css(w http.ResponseWriter, r *http.Request) {
// staticFileServer := http.FileServer(http.FS(static))
// mime.AddExtensionType(".css", "text/css")
// staticFileServer.ServeHTTP(w, r)
//}
func main() {
staticFileServer := http.FileServer(http.FS(static))
mux := http.NewServeMux()
mux.HandleFunc("/", home)
mux.Handle("/static/", staticFileServer)
err := http.ListenAndServe(":3000", mux)
slog.Error(err.Error())
}

75
static/css/base.css Normal file
View File

@ -0,0 +1,75 @@
body {
font-family: 'Raleway', sans-serif; }
.line {
height: 10px; }
.hr {
border-bottom: 10px solid var(--theme-color);
margin: 0 1.5rem; }
.section {
padding: 3rem 1.5rem 1rem; }
.summary,
.experience,
.education,
.projects,
.skills,
.awards,
.languages {
margin-bottom: 1.5rem; }
.summary .title,
.experience .title,
.education .title,
.projects .title,
.skills .title,
.awards .title,
.languages .title {
padding: .5em 0;
border-bottom: 1px solid var(--theme-color); }
.experience .item,
.education .item,
.projects .item,
.skills .item,
.awards .item {
padding: .5em 0; }
.profile .image {
margin: 0 auto; }
.profile svg {
fill: var(--theme-color); }
.social-icon {
display: flex;
justify-content: flex-end;
align-items: center; }
.social-icon a {
display: flex;
align-items: center;
color: var(--theme-color); }
.social-icon svg {
height: 1.5rem;
width: 1.5rem; }
.footer {
padding: 3rem 1.5rem 1rem; }
/* Query for mobile only*/
@media screen and (max-width: 768px) {
.profile {
text-align: center; }
.social-icon {
justify-content: center;
padding: .25rem 0; } }
/* Query for desktop only*/
@media screen and (min-width: 768px) {
.has-text-right-in-desktop {
text-align: right; } }
.ads-square {
min-width: 250px;
min-height: 100px; }

96
static/css/base.scss Normal file
View File

@ -0,0 +1,96 @@
body {
font-family: 'Raleway', sans-serif;
}
.line {
height: 10px;
}
.hr {
border-bottom: 10px solid var(--theme-color);
margin: 0 1.5rem;
}
.section {
padding: 3rem 1.5rem 1rem;
}
.summary,
.experience,
.education,
.projects,
.skills,
.awards,
.languages {
margin-bottom: 1.5rem;
.title {
padding: .5em 0;
border-bottom: 1px solid var(--theme-color);
}
}
.experience,
.education,
.projects,
.skills,
.awards {
.item {
padding: .5em 0;
}
}
.profile {
.image {
margin: 0 auto;
}
svg {
fill: var(--theme-color);
}
}
.social-icon {
display: flex;
justify-content: flex-end;
align-items: center;
a {
display: flex;
align-items: center;
color: var(--theme-color);
}
svg {
height: 1.5rem;
width: 1.5rem;
}
}
.footer {
padding: 3rem 1.5rem 1rem;
}
/* Query for mobile only*/
@media screen and (max-width: 768px) {
.profile {
text-align: center;
}
.social-icon {
justify-content: center;
padding: .25rem 0;
}
}
/* Query for desktop only*/
@media screen and (min-width: 768px) {
.has-text-right-in-desktop {
text-align: right;
}
}
.ads-square {
min-width: 250px;
min-height: 100px;
}

6927
static/css/bulma-dracula.css Normal file

File diff suppressed because it is too large Load Diff

11851
static/css/bulma.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
@import url(bulma-dracula.css);
@import url(base.css);
:root {
--theme-color: #bd93f9;
--thin-color: #b5b5b5; }

View File

@ -0,0 +1,7 @@
:root {
--theme-color: #bd93f9;
--thin-color: #b5b5b5;
}
@import 'bulma-dracula.css';
@import 'base.css';

View File

@ -0,0 +1,80 @@
@import url(bulma.css);
:root {
--theme-color: #00d1b2;
--thin-color: #b5b5b5; }
body {
font-family: 'Raleway', sans-serif; }
.line {
height: 10px; }
.hr {
border-bottom: 10px solid var(--theme-color);
margin: 0 1.5rem; }
.section {
padding: 3rem 1.5rem 1rem; }
.summary,
.experience,
.education,
.projects,
.skills,
.awards,
.languages {
margin-bottom: 1.5rem; }
.summary .title,
.experience .title,
.education .title,
.projects .title,
.skills .title,
.awards .title,
.languages .title {
padding: .5em 0;
border-bottom: 1px solid var(--theme-color); }
.experience .item,
.education .item,
.projects .item,
.skills .item,
.awards .item {
padding: .5em 0; }
.profile .image {
margin: 0 auto; }
.profile svg {
fill: var(--theme-color); }
.social-icon {
display: flex;
justify-content: flex-end;
align-items: center; }
.social-icon a {
display: flex;
align-items: center;
color: var(--theme-color); }
.social-icon svg {
height: 1.5rem;
width: 1.5rem; }
.footer {
padding: 3rem 1.5rem 1rem; }
/* Query for mobile only*/
@media screen and (max-width: 768px) {
.profile {
text-align: center; }
.social-icon {
justify-content: center;
padding: .25rem 0; } }
/* Query for desktop only*/
@media screen and (min-width: 768px) {
.has-text-right-in-desktop {
text-align: right; } }
.ads-square {
min-width: 250px;
min-height: 100px; }

View File

@ -0,0 +1,7 @@
:root {
--theme-color: #00d1b2;
--thin-color: #b5b5b5;
}
@import "bulma.css";
@import 'base.scss';

36
structs.go Normal file
View File

@ -0,0 +1,36 @@
package main
type job struct {
Company string `yaml:"company"`
Location string `yaml:"location"`
Title string `yaml:"title"`
Period string `yaml:"period"`
Description []string `yaml:"description"`
}
type jobs []job
type education struct {
Name string `yaml:"name"`
City string `yaml:"city"`
Degree string `yaml:"degree"`
Period string `yaml:"period"`
Faculty string `yaml:"faculty"`
}
type educations []education
type skill struct {
Name string `yaml:"name"`
Level string `yaml:"level"`
}
type skills []skill
type social struct {
Media string `yaml:"media"`
UserId string `yaml:"userId"`
Link string `yaml:"link"`
}
type socials []social

View File

@ -0,0 +1,20 @@
{{ define "githubCorner" }}
<a href="https://github.com/mazipan/bulma-resume-template" class="github-corner" aria-label="View source on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250" style="
fill: #000000;
color: #fff;
position: absolute;
top: 0;
border: 0;
right: 0;
" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px" class="octo-arm"></path>
<path
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor" class="octo-body"></path>
</svg>
</a>
{{ end }}

161
templates/index.html Normal file
View File

@ -0,0 +1,161 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ template "meta" }}
<link rel="stylesheet" href="/static/css/dark-style.css" />
</head>
<body id="body-app">
{{ template "githubCorner" }}
<header class="line has-background-primary"></header>
<section class="profile section">
<div class="container">
<div class="columns">
<div class="column is-two-fifths">
<h1 class="title is-size-1"><%= content.data.profile.name %></h1>
<p class="subtitle"><%= content.data.profile.title %></p>
</div>
<div class="column is-2">
<figure class="image image is-128x128">
<img alt="Profile photo" class="is-rounded" src="https://avatars.githubusercontent.com/u/50285623?v=4" /> <!--<%= content.data.profile.photo %>" />-->
</figure>
</div>
<div class="column has-text-grey-light has-text-right-in-desktop">
<p class="has-text-weight-light">
<%= content.data.profile.city %>
</p>
<p class="has-text-weight-light">
<%= content.data.profile.phone %>
</p>
<p class="has-text-weight-light">
<%= content.data.profile.mail %>
</p>
<% include /socialIcons %>
</div>
</div>
</div>
</section>
<div class="hr"></div>
<section class="section">
<div class="container">
<div class="columns">
<div class="column is-three-fifths">
<div class="summary">
<div class="title is-size-5 has-text-primary has-text-weight-bold">
SUMMARY
</div>
<div class="wrapper"><%- content.data.summary %></div>
</div>
<div class="experience">
<div class="title is-size-5 has-text-primary has-text-weight-bold">
EXPERIENCE
</div>
<% content.data.experiences.forEach(function(experience){ %>
<div class="item">
<div class="is-size-5">
<b><%= experience.company %>,</b>
<span class="has-text-weight-semi-bold">
<%= experience.location %> — <i><%= experience.title %></i>
</span>
</div>
<div class="is-size-7 tag is-primary"><%= experience.period %></div>
<% if (experience.jobdesc.length > 0) { %>
<ul style="list-style: disc; margin-left: 1em">
<% experience.jobdesc.forEach(function(job){ %>
<li><%= job %></li>
<% }); %>
</ul>
<% } %>
</div>
<% }); %>
</div>
<div class="education">
<div class="title is-size-5 has-text-primary has-text-weight-bold">
EDUCATION
</div>
<% content.data.educations.forEach(function(education){ %>
<div class="item">
<div class="is-size-5">
<b><%= education.name %></b>,
<span class="has-text-weight-semi-bold">
<%= education.city %> — <i><%= education.degree %></i>
</span>
</div>
<div class="is-size-7 tag is-primary"><%= education.period %></div>
<div><%= education.faculty %></div>
</div>
<% }); %>
</div>
</div>
<div class="column">
<div class="projects">
<div class="title is-size-5 has-text-primary has-text-weight-bold">
PROJECTS
</div>
<% content.data.projects.forEach(function(proj){ %>
<div class="item">
<div class="is-size-5">
<b><%= proj.title %></b>
<i><%= proj.company %></i>
</div>
<div class="is-size-7 tag is-primary"><%= proj.period %></div>
</div>
<% }); %>
</div>
<div class="skills">
<div class="title is-size-5 has-text-primary has-text-weight-bold">
SKILLS
</div>
<div class="wrapper">
<% content.data.skills.forEach(function(skill){ %>
<div class="item">
<div><%= skill.name %></div>
</div>
<% }); %>
</div>
</div>
<div class="languages">
<div class="title is-size-5 has-text-primary has-text-weight-bold">
LANGUAGES
</div>
<div class="wrapper">
<%= content.data.languages.join(', ') %>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="content has-text-centered">
<a href="<%= content.config.publicPath %>/light">See Light Theme</a>
<br />
Copyright © 2018-2019 by
<a href="https://mazipan.space">Irfan Maulana</a>
</div>
</footer>
<footer class="line has-background-primary"></footer>
{{ template "jsonLd" }}
</body>
</html>

78
templates/jsonLd.html Normal file
View File

@ -0,0 +1,78 @@
{{ define "jsonLd" }}
<!-- FROM jsonLd.ejs -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.mazipan.github.io/",
"name": "Irfan Maulana | Front End Developer",
"author": "Irfan Maulana",
"image": "http://mazipan.github.io/images/irfan-maulana.jpg",
"description": "Irfan Maulana is Front End Developer from Indonesia - Man that craft some code to build a beauty and readable code, experienced in web and desktop technology.",
"sameAs": [
"https://www.facebook.com/mazipanneh",
"https://instagram.com/maz_ipan",
"https://twitter.com/Maz_Ipan",
"https://id.linkedin.com/in/irfanmaulanamazipan",
"https://www.slideshare.net/IrfanMaulana21",
"https://github.com/mazipan"
]
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"email": "mailto:mazipanneh@gmail.com",
"image": "http://mazipan.github.io/images/irfan-maulana.jpg",
"jobTitle": "Software Engineer",
"name": "Irfan Maulana",
"url": "https://www.mazipan.github.io/",
"sameAs": [
"https://www.facebook.com/mazipanneh",
"https://instagram.com/maz_ipan",
"https://twitter.com/Maz_Ipan",
"https://id.linkedin.com/in/irfanmaulanamazipan",
"https://www.slideshare.net/IrfanMaulana21",
"https://github.com/mazipan"
]
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "http://mazipan.github.io/",
"name": "Home",
"image": "http://mazipan.github.io/images/irfan-maulana.jpg"
}
},
{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "http://mazipan.github.io/demo/",
"name": "Demo",
"image": "http://mazipan.github.io/images/irfan-maulana.jpg"
}
},
{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "http://mazipan.github.io/bulma-resume-template",
"name": "bulma-resume-template",
"image": "https://mazipan.github.io/bulma-resume-template/logo.png"
}
}
]
}
</script>
{{ end }}

66
templates/metatag.html Normal file
View File

@ -0,0 +1,66 @@
{{ define "meta" }}
<meta name="robots" content="index, follow" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=7" />
<meta name="language" content="en-EN" />
<meta name="author" content="Irfan Maulana" />
<title>Bulma Resume Template</title>
<meta name="description" content="Free Resume/CV Page Template with Bulma CSS by Irfan Maulana" />
<meta property="og:title" content="Bulma Resume Template" />
<meta property="og:description" content="Free Resume/CV Page Template with Bulma CSS by Irfan Maulana" />
<meta name="twitter:title" content="Bulma Resume Template" />
<meta name="twitter:description" content="Free Resume/CV Page Template with Bulma CSS by Irfan Maulana" />
<link rel="icon" type="image/png" sizes="16x16" href="https://cloud.oranki.net/apps/theming/favicon?v=2659fc51" />
<meta name="theme-color" content="#bd93f9" />
<link rel="preconnect" href="https://fonts.googleapis.com/css?family=Raleway" />
<link rel="dns-prefetch" href="https://fonts.googleapis.com/css?family=Raleway" />
<link rel="preload" href="https://fonts.googleapis.com/css?family=Raleway" as="style"
onload="this.onload=null;this.rel='stylesheet'" />
<noscript>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway" />
</noscript>
<link rel="stylesheet" href="/static/css/dark-style.css" />
<style>
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out;
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0);
}
20%,
60% {
transform: rotate(-25deg);
}
40%,
80% {
transform: rotate(10deg);
}
}
@media (max-width: 500px) {
.github-corner:hover .octo-arm {
animation: none;
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out;
}
}
</style>
{{ end }}