WIP: port static markdown files in public root

This commit is contained in:
Sami Samhuri 2019-12-01 21:46:39 -08:00
parent cc1c97b4a1
commit 64d24fa8eb
5 changed files with 61 additions and 5 deletions

View file

@ -23,18 +23,32 @@ Execution, trying TDD for the first time:
- [x] Add support for site styles
- [ ] Add support for page styles
- [x] Add support for page styles
- [x] Add support for site scripts
- [ ] Add support for page scripts
- [x] Add support for page scripts
- [x] Add support for CSS files
- [x] Transform LESS into CSS
- [ ] Migrate static pages to the new site generator
- [ ] About
- [ ] 404 / missing
- [ ] cv
- [ ] check and delete _data.json
- [ ] Migrate projects to the new site generator
- [ ] Migrate projects page
- [ ] Migrate project page
- [ ] Migrate posts to markdown with headers somehow
- [ ] Define the new format, probably with a folder for each year of posts since I don't write very much
@ -43,6 +57,14 @@ Execution, trying TDD for the first time:
- [ ] Migrate posts
- [ ] Migrate year indexes
- [ ] Migrate month indexes
- [ ] Migrate index / recent posts
- [ ] Migrate archive
- [ ] Add a link to the code for samhuri.net somewhere ... so meta (about page?)
- [ ] Generate RSS feed (ditch mustache templates)

View file

@ -0,0 +1,30 @@
//
// Post.swift
// SiteGenerator
//
// Created by Sami Samhuri on 2019-12-01.
//
import Foundation
struct Post {
let date: Date
let formattedDate: String
let title: String
let slug: String
let author: String
let tags: [String]
let body: String
var path: String {
let dateComponents = Calendar.current.dateComponents([.year], from: date)
let year = dateComponents.year!
let month = dateComponents.month!
return "/" + [
"posts",
"\(year)",
"\(month)",
"\(slug)",
].joined(separator: "/")
}
}

View file

@ -2,7 +2,7 @@
<html>
<head>
<title>{{ site.title }}</title>
{% for style in allStyles %}
{% for style in styles %}
<link rel="stylesheet" href="{{ style }}">
{% endfor %}
</head>

View file

@ -1,3 +1,7 @@
---
Title: About me
---
I'm Sami Samhuri, a software developer and general technology geek. Sometimes
I write my thoughts and post my projects here. I moved to [Victoria, BC][vic]
in 2003 to study computer science at the [University of Victoria][uvic], and

View file

@ -15,7 +15,7 @@
<meta name="msapplication-config" content="/images/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
{% for style in allStyles %}
{% for style in styles %}
<link rel="stylesheet" href="{{ style }}">
{% endfor %}
@ -88,7 +88,7 @@
})();
</script>
{% for script in allScripts %}
{% for script in scripts %}
<script defer src="{{ script }}"></script>
{% endfor %}
</body>