Skip to content

Commit

Permalink
Removed HasHugoConfigFile check as it doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
mrusme committed May 21, 2024
1 parent 4c776e6 commit f17f59a
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions plugin/hugohelper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,11 @@ function! s:IsFileInHugoContentDirectory(filepath)
let l:mods .= ':h'
let l:dirname = fnamemodify(l:path, ':t')
if l:dirname == g:hugohelper_content_dir
" Check if the parent of the content directory contains a config file.
let l:parent = fnamemodify(l:path, ":h")
if s:HasHugoConfigFile(l:parent)
return v:true
endif
return v:true
endif
endwhile

return v:false
endfunction

function! s:HasHugoConfigFile(dir)
" :p adds the final path separator if a:dir is a directory.
let l:dirpath = fnamemodify(a:dir, ':p')
for config in g:hugohelper_site_config
let l:file = l:dirpath . config
if filereadable(l:file)
return v:true
endif
endfor
return v:false
endfunction

" vim: expandtab shiftwidth=4

0 comments on commit f17f59a

Please sign in to comment.