Permalink
Browse files

ver 0.3.1

  * Change category to include full directory path

  * Trimmed begin-end quotes from passed in parameters
    no need to quote parameters in template files
  • Loading branch information...
1 parent 2468e0a commit a7060f4d9e6dcf545ae430f5e90824d5a3de9f84 @mkaz committed Mar 7, 2012
Showing with 11 additions and 3 deletions.
  1. +7 −1 README.md
  2. +4 −2 hastie.go
View
8 README.md
@@ -106,11 +106,17 @@ Data available to templates:
-
--------------------------------------------------------------------------------
### CHANGE LOG
+ver 0.3.1
+
+ * Change category to include full directory path
+
+ * Trimmed begin-end quotes from passed in parameters
+ no need to quote parameters in template files
+
ver 0.3
View
6 hastie.go
@@ -224,6 +224,7 @@ func readParseFile(filename string) (page Page) {
if colonIndex > 0 {
key := strings.TrimSpace(line[:colonIndex])
value := strings.TrimSpace(line[colonIndex+1:])
+ value = strings.Trim(value, "\"") //remove quotes
switch key {
case "title":
page.Title = value
@@ -252,9 +253,10 @@ func readParseFile(filename string) (page Page) {
page.OutFile = filename[strings.Index(filename, "/")+1:]
page.OutFile = strings.Replace(page.OutFile, ".md", ".html", 1)
- // next first directory is category
+ // next directory(s) category, category includes sub-dir = solog/webdev
+ // TODO: allow category parameter
if strings.Contains(page.OutFile, "/") {
- page.Category = page.OutFile[0:strings.Index(page.OutFile, "/")]
+ page.Category = page.OutFile[0:strings.LastIndex(page.OutFile, "/")]
}
// parse date from filename

0 comments on commit a7060f4

Please sign in to comment.