Reputation: 2094
I have a website; some pages I maintain manually, some others, I generate using tools (mostly Shinx). For manually maintained pages, I'd like to migrate to Jekyll.
So my idea was to copy my whole website in a jekyll project, and progressively move pages from static HTML files to jekyll-managed markdown files, much easier to maintain. Generated pages, on the other hand, would be copied untouched.
It works pretty well... except that Jekyll does not copy the files starting with an underscore, which I have quite a lot: Sphinx names some special directories with a leading underscore (_static
, _modules
...), and I publish some python code, in which leading underscore are also used (e.g. __init__.py
).
I know I could use the include
directive in _config.yml
, and add one by one all known files/directories that I want to keep. But I would still risk to miss some files (especially when my generators evolve).
I would rather be able to tell Jekyll, for each generated subdirectory, "this directory should be copied as-is". This would prevent it to look at every file in it to see if it should be processed, and so any file, starting with an underscore or not, would be blindly copied.
Is there a way to do that? I could not find any...
Upvotes: 5
Views: 2386
Reputation: 759
This is odd. A folder named hippo_menus wasn't being included in my output. It used to, but then stopped all of sudden. I changed it to hippomenus and now it's included in the output.
Upvotes: 0
Reputation: 1699
The strategy I use (and, I assume, the strategy intended by the jekyll developers) is to have the generation tool (sphinx, yard, ...) generate directly into the output directory (e.g. _site/api) and add the resulting folder to the keep_files configuration option in _config.yml
Upvotes: 7
Reputation: 2413
Jekyll copies any folders it finds, as is, unless their names begin with an underscore. An underscore tells Jekyll to not copy the directory to _sites directly.
As you are moving to Jekyll I'd say it's best to follow Jekyll's standard naming format and remove the underscores from directories that you do want copied to _sites.
Upvotes: 3