Commit Graph

53 Commits

Author SHA1 Message Date
faaef83954 Use less strict condition to avoid problems with concurrency
In latest go versions TestWatcher fails pretty often, because it is
"more concurrent" now. Reproducible with go master:
while go test github.com/mholt/caddy/middleware/markdown; do :; done

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-11 10:25:13 -07:00
7545755b00 Merge pull request #240 from LK4D4/fix_map_race
markdown: fix race in accessing map
2015-09-11 17:00:24 +01:00
a5128da67a markdown: fix race in accessing map
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-11 08:34:52 -07:00
37eedf5cdc Fix race in test
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-11 08:34:08 -07:00
da7b9a6bbc Use markdown.Config as pointer everywhere
* As value mutex was copied and therefore synchronization worked wrong
* It's pretty big structure with reference types, so copying create unnecessary
  pressure on GC

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-10 15:12:50 -07:00
2e8a74ecff markdown: Prefix log messages, and slight refactor
Also change sha1 to md5 for the directory scans; slightly faster.
2015-08-05 08:15:52 -06:00
7173764d6d markdown: Render lists as part of summary (upstream bug workaround)
See github.com/russross/blackfriday/issues/189
2015-08-05 07:37:51 -06:00
3b910645e7 Markdown: generate static sites after links. 2015-08-05 09:55:04 +01:00
b5d79bdccc Markdown: Removed unused constant. 2015-08-05 01:01:57 +01:00
2ab466599d Markdown: Modify development mode to generate links on page requests. 2015-08-05 00:41:04 +01:00
851026d3fa Markdown: Watch for file changes. Removed sitegen dependency for links. 2015-08-04 23:35:09 +01:00
36fa6e857b markdown: Sitegen only occurs if directory exists
We do this by returning an error and stopping link generation (which scans the markdown path for files)
2015-08-01 16:09:10 -06:00
f7129b219e Fix markdown tests that I broke 2015-07-29 17:47:33 -06:00
ff28bc8b0a markdown: Change .Url -> .URL, increase summary length
Also, summary truncated at nearest space instead of middle of word, and code spans become part of summary.
2015-07-29 17:43:00 -06:00
ec51e14451 Merge branch 'master' of https://github.com/mholt/caddy 2015-07-29 23:43:26 +02:00
aa89f30f2a renamed sorter to byDate. 2015-07-29 18:06:53 +01:00
da794a866e Change date of the files in test to serve the static file and not generate a new one 2015-07-29 18:00:08 +02:00
705cd16dee Fixed path issue: was absolute path but should be relative path 2015-07-29 17:12:32 +02:00
0168a627a4 Added test on markdown static files generation 2015-07-29 16:21:35 +02:00
7b29568eb1 Code cleanups.
Fix more race conditions.
2015-07-29 12:21:34 +01:00
e240cd5ba2 Metadata variables flattened.
Fix race condition on parsers.
Added page links generator.
2015-07-28 05:21:09 +01:00
d1eb2ea9e2 Changed metadata variables type:
from map[string]interface{} to map[string]string
2015-07-26 18:32:34 +02:00
453d3eb567 markdown: Fix when md file has front matter but empty body 2015-07-25 15:47:33 -06:00
bf47951f3a Merge pull request #196 from evermax/master
markdown, browse: Integrated Context struct for templating
2015-07-25 15:15:51 -06:00
604c8abb59 Remove debug line, add file name as default title 2015-07-25 22:39:13 +02:00
ef4a4b0ab8 Removed attribute not needed. 2015-07-24 22:17:14 +02:00
24bdb433c9 Changed .Var to .Doc in Markdown templates
Put the title into the .Doc variables as well.
Changed the test template file to use new names.
2015-07-24 22:14:05 +02:00
97dcc79a7f Remove undesired committed debug logs 2015-07-23 11:53:15 +02:00
bc2feece4b Moved test files to testdata folder.
Changed the tests accordingly.
2015-07-23 09:35:46 +02:00
2df30d186e Added a test on markdown for the default template 2015-07-21 17:45:32 +02:00
6451e10d3e Add context to markdown template
Created a struct containing middleware.Context, Title, Markdown and the
variables from the user to use to render the template.
The title now can be accessed via {{.Title}}.
The variables can now be accessed via {{.Var.myVariableName}}.
2015-07-21 07:58:34 +02:00
00997db5ae markdown: Fix large markdown files that got truncated 2015-07-18 12:57:16 -06:00
41e1f1ffa5 Update error strings (start with lowercase letters) 2015-06-07 20:49:17 -04:00
e4b50aa814 Fix more lint warnings 2015-05-24 22:52:34 -04:00
8394d72f48 Fix for Issue 72: Markdown: 500 for YAML metadata 2015-05-13 00:44:35 +01:00
4272536518 markdown: sitegen keyword and run generation at startup
Also fixed bug for markdown files that don't contain front matter
2015-05-09 21:12:52 -06:00
8ea98f8cce markdown: Fix panic: assignment to entry in nil map
Ensures metadata.Variables is made
2015-05-09 11:49:28 -06:00
2f5e2f39cb markdown: remove identifier from Json metadata 2015-05-09 11:49:54 +01:00
6ce83aad2b markdown: Refactor fixes 2015-05-09 00:54:39 +01:00
48a12c605a markdown: Added template support. 2015-05-08 23:45:31 +01:00
0fccd3707d markdown: documentation done. awaiting test 2015-05-08 16:20:07 +01:00
ba613a1567 markdown: template integration done. awaiting documentation and test 2015-05-07 13:45:27 +01:00
0bfdb50ade markdown: working version of template integration. Awaiting static site generation and tests. 2015-05-07 00:19:02 +01:00
25847a6192 markdown: added template codes. awaiting integration and tests 2015-05-06 03:37:29 +01:00
47717fee88 Expanded index file support to other middlewares (fixes #27) 2015-05-05 15:50:42 -06:00
e4fdf171c7 More refactoring - nearly complete 2015-05-04 11:49:49 -06:00
ce74333348 Markdown requires a base path (for now) 2015-04-25 12:26:04 -06:00
d33256f1dc Refactor: Middleware chain uses Handler instead of HandlerFunc 2015-04-02 23:30:54 -06:00
f2f5d4984d Markdown defaults to .md 2015-03-31 23:41:16 -06:00
b87e6ccb76 Refactored markdown middleware to return errors 2015-03-28 16:55:40 -06:00