🗃️ Refactor job history to use data file

This commit is contained in:
Dan Jones 2025-11-22 16:30:04 -06:00
commit bc56a55a31
6 changed files with 271 additions and 134 deletions

View file

@ -75,7 +75,18 @@
{{ end }}
<div class="post-content">
{{ .Content }}
{{ with .Resources.Get "data/jobs.yaml" }}
{{ with . | transform.Unmarshal -}}
<section id="workhistory">
{{ $.Content }}
{{ partial "jobs.html" . }}
</section>
{{ else }}
{{ errorf "Unable to parse jobs" }}
{{ end }}
{{ else }}
{{ errorf "Unable to read jobs" }}
{{ end }}
</div>
{{ range .Resources.Match "sections/foot-*.md" }}

View file

@ -39,9 +39,20 @@
</aside>
{{ end }}
{{ with .Resources.Get "data/jobs.yaml" }}
{{ with . | transform.Unmarshal -}}
<div class="post-content">
{{ .Content }}
<section id="workhistory">
{{ $.Content }}
{{ partial "jobs.resume.html" . }}
</section>
</div>
{{ else }}
{{ errorf "Unable to parse jobs" }}
{{ end }}
{{ else }}
{{ errorf "Unable to read jobs" }}
{{ end }}
{{ with .Resources.Get "sections/foot-015-edu.md" }}
<aside id="{{ .Params.id }}" class="{{ .Params.class }}">

View file

@ -0,0 +1,27 @@
<ul class="history">
{{ range . }}
<li id="{{ .id }}" class="{{ .class }}">
<p>
{{ with .url }}<a href="{{ . }}">{{ end }}{{ .name | markdownify }}{{ if .url }}</a>{{ end }}
{{- with .title }}<br/><em>{{ . }}</em>{{ end -}}
{{- if or .start .end}}<br/>
{{ with .start }}<span class="work-period"><time datetime="{{ .datetime }}">{{ .text }}</time>{{ end -}}
{{- if and .start .end}} - {{ end -}}
{{- with .end -}}
<span class="work-period">
{{- with .datetime }}<time datetime="{{ . }}">{{ end }}
{{- .text -}}
{{- if .datetime }}</time>{{ end -}}
</span>
{{- end -}}
{{- end -}}
</p>
{{- with .headline }}<p class="headline">{{ . | markdownify }}</p>{{ end }}
{{ with .res }}<ul class="results">
{{ range . }}<li>{{ . | markdownify }}</li>{{ end }}
</ul>{{ end }}
{{- with .tech}}<p class="tech">{{ . | markdownify }}</p>{{ end -}}
</li>
{{ end }}
</ul>

View file

@ -0,0 +1,27 @@
<ul class="history">
{{ range . }}
<li id="{{ .id }}" class="job {{ .class }}">
<p class="title">
{{- with .title }}<strong>{{ . }}</strong> / {{ end -}}
{{ with .url }}<a href="{{ . }}">{{ end }}{{ .name | markdownify }}{{ if .url }}</a>{{ end }}
{{- if or .start .end}}<span class="work-dates">
{{ with .start }}<span class="work-period"><time datetime="{{ .datetime }}">{{ .text }}</time>{{ end -}}
{{- if and .start .end}} - {{ end -}}
{{- with .end -}}
<span class="work-period">
{{- with .datetime }}<time datetime="{{ . }}">{{ end }}
{{- .text -}}
{{- if .datetime }}</time>{{ end -}}
</span>
{{- end -}}
</span>{{- end -}}
</p>
{{- with .headline }}<p class="headline">{{ . | markdownify }}</p>{{ end }}
{{ with .res }}<ul class="results">
{{ range . }}<li>{{ . | markdownify }}</li>{{ end }}
</ul>{{ end }}
{{- with .tech}}<p class="tech">{{ . | markdownify }}</p>{{ end -}}
</li>
{{ end }}
</ul>